Jspice3
respzld.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  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "resdefs.h"
11 #include "sperror.h"
12 
13 
14 /*ARGSUSED*/
15 int
16 RESpzLoad(inModel,ckt,s)
17 
18 GENmodel *inModel;
19 CKTcircuit *ckt;
20 SPcomplex *s;
21 /* actually load the current resistance value into the
22  * sparse matrix previously provided
23  */
24 {
25  RESmodel *model = (RESmodel *)inModel;
26  RESinstance *here;
27 
28  /* loop through all the resistor models */
29  for ( ; model != NULL; model = model->RESnextModel) {
30 
31  /* loop through all the instances of the model */
32  for (here = model->RESinstances; here != NULL ;
33  here = here->RESnextInstance) {
34 
35  *(here->RESposPosptr) += here->RESconduct;
36  *(here->RESnegNegptr) += here->RESconduct;
37  *(here->RESposNegptr) -= here->RESconduct;
38  *(here->RESnegPosptr) -= here->RESconduct;
39  }
40  }
41  return (OK);
42 }
Definition: cddefs.h:119
struct sRESmodel * RESnextModel
Definition: resdefs.h:56
double * RESnegPosptr
Definition: resdefs.h:39
double * RESposPosptr
Definition: resdefs.h:33
int RESpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
Definition: respzld.c:16
#define OK
Definition: iferrmsg.h:17
double RESconduct
Definition: resdefs.h:29
#define NULL
Definition: spdefs.h:121
static char model[32]
Definition: subckt.c:76
double * RESposNegptr
Definition: resdefs.h:37
RESinstance * RESinstances
Definition: resdefs.h:58
struct sRESinstance * RESnextInstance
Definition: resdefs.h:20
double * RESnegNegptr
Definition: resdefs.h:35