Jspice3
mesgetic.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 S. Hwang
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "mesdefs.h"
11 #include "sperror.h"
12 #include "util.h"
13 
14 
15 int
16 MESgetic(inModel,ckt)
17  GENmodel *inModel;
18  CKTcircuit *ckt;
19 {
20  MESmodel *model = (MESmodel*)inModel;
21  MESinstance *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->MESnextModel) {
28  for(here = model->MESinstances; here ; here = here->MESnextInstance) {
29  if(!here->MESicVDSGiven) {
30  here->MESicVDS =
31  *(ckt->CKTrhs + here->MESdrainNode) -
32  *(ckt->CKTrhs + here->MESsourceNode);
33  }
34  if(!here->MESicVGSGiven) {
35  here->MESicVGS =
36  *(ckt->CKTrhs + here->MESgateNode) -
37  *(ckt->CKTrhs + here->MESsourceNode);
38  }
39  }
40  }
41  return(OK);
42 }
MESinstance * MESinstances
Definition: mesdefs.h:163
struct sMESmodel * MESnextModel
Definition: mesdefs.h:161
int MESgetic(GENmodel *inModel, CKTcircuit *ckt)
Definition: mesgetic.c:16
struct sMESinstance * MESnextInstance
Definition: mesdefs.h:22
#define OK
Definition: iferrmsg.h:17
int MESgateNode
Definition: mesdefs.h:28
unsigned MESicVGSGiven
Definition: mesdefs.h:69
unsigned MESicVDSGiven
Definition: mesdefs.h:68
static char model[32]
Definition: subckt.c:76
int MESsourceNode
Definition: mesdefs.h:29
double MESicVGS
Definition: mesdefs.h:34
int MESdrainNode
Definition: mesdefs.h:27
double MESicVDS
Definition: mesdefs.h:33
double * CKTrhs
Definition: cktdefs.h:97