Jspice3
mesgetic.c File Reference
#include "spice.h"
#include <stdio.h>
#include "mesdefs.h"
#include "sperror.h"
#include "util.h"
Include dependency graph for mesgetic.c:

Go to the source code of this file.

Functions

int MESgetic (GENmodel *inModel, CKTcircuit *ckt)
 

Function Documentation

int MESgetic ( GENmodel inModel,
CKTcircuit ckt 
)

Definition at line 16 of file mesgetic.c.

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
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