Jspice3
capacld.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 "sperror.h"
12 
13 
14 int
15 CAPacLoad(inModel,ckt)
16 
17 GENmodel *inModel;
18 CKTcircuit *ckt;
19 {
20  CAPmodel *model = (CAPmodel*)inModel;
21  double val;
22  CAPinstance *here;
23 
24  for ( ; model != NULL; model = model->CAPnextModel) {
25  for (here = model->CAPinstances; here != NULL;
26  here = here->CAPnextInstance) {
27 
28  val = ckt->CKTomega * here->CAPcapac;
29  *(here->CAPposPosptr +1) += val;
30  *(here->CAPnegNegptr +1) += val;
31  *(here->CAPposNegptr +1) -= val;
32  *(here->CAPnegPosptr +1) -= val;
33  }
34  }
35  return (OK);
36 }
37 
double * CAPnegPosptr
Definition: capdefs.h:40
struct sCAPinstance * CAPnextInstance
Definition: capdefs.h:21
double * CAPposNegptr
Definition: capdefs.h:38
CAPinstance * CAPinstances
Definition: capdefs.h:57
#define OK
Definition: iferrmsg.h:17
double * CAPposPosptr
Definition: capdefs.h:34
#define NULL
Definition: spdefs.h:121
double CKTomega
Definition: cktdefs.h:198
static char model[32]
Definition: subckt.c:76
double * CAPnegNegptr
Definition: capdefs.h:36
int CAPacLoad(GENmodel *inModel, CKTcircuit *ckt)
Definition: capacld.c:15
double CAPcapac
Definition: capdefs.h:27
struct sCAPmodel * CAPnextModel
Definition: capdefs.h:55