Jspice3
b1getic.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 Hong J. Park, Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "bsim1def.h"
11 #include "sperror.h"
12 
13 
14 int
15 B1getic(inModel,ckt)
16  GENmodel *inModel;
17  CKTcircuit *ckt;
18 
19 {
20 
21  B1model *model = (B1model*)inModel;
22  B1instance *here;
23  /*
24  * grab initial conditions out of rhs array. User specified, so use
25  * external nodes to get values
26  */
27 
28  for( ; model ; model = model->B1nextModel) {
29  for(here = model->B1instances; here ; here = here->B1nextInstance) {
30  if(!here->B1icVBSGiven) {
31  here->B1icVBS =
32  *(ckt->CKTrhs + here->B1bNode) -
33  *(ckt->CKTrhs + here->B1sNode);
34  }
35  if(!here->B1icVDSGiven) {
36  here->B1icVDS =
37  *(ckt->CKTrhs + here->B1dNode) -
38  *(ckt->CKTrhs + here->B1sNode);
39  }
40  if(!here->B1icVGSGiven) {
41  here->B1icVGS =
42  *(ckt->CKTrhs + here->B1gNode) -
43  *(ckt->CKTrhs + here->B1sNode);
44  }
45  }
46  }
47  return(OK);
48 }
double B1icVBS
Definition: bsim1def.h:45
int B1getic(GENmodel *inModel, CKTcircuit *ckt)
Definition: b1getic.c:15
#define OK
Definition: iferrmsg.h:17
double B1icVGS
Definition: bsim1def.h:47
double B1icVDS
Definition: bsim1def.h:46
B1instance * B1instances
Definition: bsim1def.h:303
unsigned B1icVGSGiven
Definition: bsim1def.h:95
static char model[32]
Definition: subckt.c:76
struct sBSIM1model * B1nextModel
Definition: bsim1def.h:301
struct sBSIM1instance * B1nextInstance
Definition: bsim1def.h:22
unsigned B1icVDSGiven
Definition: bsim1def.h:94
unsigned B1icVBSGiven
Definition: bsim1def.h:93
double * CKTrhs
Definition: cktdefs.h:97