Jspice3
diogetic.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1985 Thomas L. Quarles
5  1992 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "diodefs.h"
11 #include "sperror.h"
12 
13 
14 int
15 DIOgetic(inModel,ckt)
16 
17 GENmodel *inModel;
18 CKTcircuit *ckt;
19 {
20  DIOmodel *model = (DIOmodel*)inModel;
21  DIOinstance *here;
22  /*
23  * grab initial conditions out of rhs array. User specified, so use
24  * external nodes to get values
25  */
26 
27  for ( ; model; model = model->DIOnextModel) {
28  for (here = model->DIOinstances; here;
29  here = here->DIOnextInstance) {
30 
31  if (!here->DIOinitCondGiven) {
32  here->DIOinitCond =
33  *(ckt->CKTrhs + here->DIOposNode) -
34  *(ckt->CKTrhs + here->DIOnegNode);
35  }
36  }
37  }
38  return (OK);
39 }
struct sDIOinstance * DIOnextInstance
Definition: diodefs.h:20
#define OK
Definition: iferrmsg.h:17
DIOinstance * DIOinstances
Definition: diodefs.h:121
unsigned DIOinitCondGiven
Definition: diodefs.h:44
int DIOgetic(GENmodel *inModel, CKTcircuit *ckt)
Definition: diogetic.c:15
struct sDIOmodel * DIOnextModel
Definition: diodefs.h:119
static char model[32]
Definition: subckt.c:76
int DIOnegNode
Definition: diodefs.h:25
int DIOposNode
Definition: diodefs.h:24
double * CKTrhs
Definition: cktdefs.h:97
double DIOinitCond
Definition: diodefs.h:49