Jspice3
capgetic.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 "capdefs.h"
11 #include "util.h"
12 #include "sperror.h"
13 
14 
15 int
16 CAPgetic(inModel,ckt)
17 
18 GENmodel *inModel;
19 CKTcircuit *ckt;
20 {
21 
22  CAPmodel *model = (CAPmodel*)inModel;
23  CAPinstance *here;
24  /*
25  * grab initial conditions out of rhs array. User specified, so use
26  * external nodes to get values
27  */
28 
29  for ( ; model; model = model->CAPnextModel) {
30  for (here = model->CAPinstances; here;
31  here = here->CAPnextInstance) {
32  if (!here->CAPicGiven) {
33  here->CAPinitCond =
34  *(ckt->CKTrhs + here->CAPposNode) -
35  *(ckt->CKTrhs + here->CAPnegNode);
36  }
37  }
38  }
39  return (OK);
40 }
41 
int CAPnegNode
Definition: capdefs.h:26
struct sCAPinstance * CAPnextInstance
Definition: capdefs.h:21
int CAPgetic(GENmodel *inModel, CKTcircuit *ckt)
Definition: capgetic.c:16
unsigned CAPicGiven
Definition: capdefs.h:45
CAPinstance * CAPinstances
Definition: capdefs.h:57
#define OK
Definition: iferrmsg.h:17
int CAPposNode
Definition: capdefs.h:25
double CAPinitCond
Definition: capdefs.h:28
static char model[32]
Definition: subckt.c:76
struct sCAPmodel * CAPnextModel
Definition: capdefs.h:55
double * CKTrhs
Definition: cktdefs.h:97