Jspice3
resacld.c File Reference
#include "spice.h"
#include <stdio.h>
#include "resdefs.h"
#include "sperror.h"
Include dependency graph for resacld.c:

Go to the source code of this file.

Functions

int RESacLoad (GENmodel *inModel, CKTcircuit *ckt)
 

Function Documentation

int RESacLoad ( GENmodel inModel,
CKTcircuit ckt 
)

Definition at line 17 of file resacld.c.

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  if (!here->RESnegNode)
36  *(here->RESposPosptr) += here->RESconduct;
37  else if (!here->RESposNode)
38  *(here->RESnegNegptr) += here->RESconduct;
39  else {
40  *(here->RESposPosptr) += here->RESconduct;
41  *(here->RESnegNegptr) += here->RESconduct;
42  *(here->RESposNegptr) -= here->RESconduct;
43  *(here->RESnegPosptr) -= here->RESconduct;
44  }
45  }
46  }
47  return (OK);
48 }
int RESnegNode
Definition: resdefs.h:26
struct sRESmodel * RESnextModel
Definition: resdefs.h:56
if(TDesc==NULL)
Definition: cd.c:1326
double * RESnegPosptr
Definition: resdefs.h:39
double * RESposPosptr
Definition: resdefs.h:33
int RESposNode
Definition: resdefs.h:25
#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