Jspice3
Main Page
Data Structures
Files
File List
Globals
resacld.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
9
#include "
spice.h
"
10
#include <stdio.h>
11
#include "
resdefs.h
"
12
#include "
sperror.h
"
13
14
15
/*ARGSUSED*/
16
int
17
RESacLoad
(inModel,ckt)
18
19
/* actually load the current resistance value into the
20
* sparse matrix previously provided
21
*/
22
GENmodel
*inModel;
23
CKTcircuit
*ckt;
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
}
sRESinstance::RESnegNode
int RESnegNode
Definition:
resdefs.h:26
sRESmodel::RESnextModel
struct sRESmodel * RESnextModel
Definition:
resdefs.h:56
CKTcircuit
Definition:
cktdefs.h:62
if
if(TDesc==NULL)
Definition:
cd.c:1326
resdefs.h
sRESinstance
Definition:
resdefs.h:18
sRESinstance::RESnegPosptr
double * RESnegPosptr
Definition:
resdefs.h:39
sRESinstance::RESposPosptr
double * RESposPosptr
Definition:
resdefs.h:33
sRESinstance::RESposNode
int RESposNode
Definition:
resdefs.h:25
OK
#define OK
Definition:
iferrmsg.h:17
sRESinstance::RESconduct
double RESconduct
Definition:
resdefs.h:29
sperror.h
NULL
#define NULL
Definition:
spdefs.h:121
spice.h
sGENmodel
Definition:
gendefs.h:39
RESacLoad
int RESacLoad(GENmodel *inModel, CKTcircuit *ckt)
Definition:
resacld.c:17
sRESmodel
Definition:
resdefs.h:54
model
static char model[32]
Definition:
subckt.c:76
sRESinstance::RESposNegptr
double * RESposNegptr
Definition:
resdefs.h:37
sRESmodel::RESinstances
RESinstance * RESinstances
Definition:
resdefs.h:58
sRESinstance::RESnextInstance
struct sRESinstance * RESnextInstance
Definition:
resdefs.h:20
sRESinstance::RESnegNegptr
double * RESnegNegptr
Definition:
resdefs.h:35
src
lib
dev
res
resacld.c
Generated by
1.8.11