committed by
rlar
12 changed files with 86 additions and 2 deletions
-
1src/spicelib/devices/res/Makefile.am
-
4src/spicelib/devices/res/res.c
-
3src/spicelib/devices/res/resask.c
-
6src/spicelib/devices/res/resdefs.h
-
1src/spicelib/devices/res/resext.h
-
2src/spicelib/devices/res/resinit.c
-
3src/spicelib/devices/res/resmask.c
-
4src/spicelib/devices/res/resmpar.c
-
4src/spicelib/devices/res/resparam.c
-
5src/spicelib/devices/res/ressetup.c
-
51src/spicelib/devices/res/ressoachk.c
-
4visualc/vngspice.vcproj
@ -0,0 +1,51 @@ |
|||||
|
/********** |
||||
|
Copyright 2013 Dietmar Warning. All rights reserved. |
||||
|
Author: 2013 Dietmar Warning |
||||
|
**********/ |
||||
|
|
||||
|
#include "ngspice/ngspice.h" |
||||
|
#include "ngspice/cktdefs.h" |
||||
|
#include "resdefs.h" |
||||
|
#include "ngspice/trandefs.h" |
||||
|
#include "ngspice/sperror.h" |
||||
|
#include "ngspice/suffix.h" |
||||
|
#include "ngspice/cpdefs.h" |
||||
|
|
||||
|
|
||||
|
int |
||||
|
RESsoaCheck(CKTcircuit *ckt, GENmodel *inModel) |
||||
|
{ |
||||
|
RESmodel *model = (RESmodel *) inModel; |
||||
|
RESinstance *here; |
||||
|
double vr; /* current resistor voltage */ |
||||
|
int maxwarns; |
||||
|
static int warns_bv = 0; |
||||
|
|
||||
|
if (!ckt) { |
||||
|
warns_bv = 0; |
||||
|
return OK; |
||||
|
} |
||||
|
|
||||
|
maxwarns = ckt->CKTsoaMaxWarns; |
||||
|
|
||||
|
for (; model; model = model->RESnextModel) { |
||||
|
|
||||
|
for (here = model->RESinstances; here; here = here->RESnextInstance) { |
||||
|
|
||||
|
vr = fabs(ckt->CKTrhsOld [here->RESposNode] - |
||||
|
ckt->CKTrhsOld [here->RESnegNode]); |
||||
|
|
||||
|
if (vr > here->RESbv_max) |
||||
|
if (warns_bv < maxwarns) { |
||||
|
soa_printf(ckt, (GENinstance*) here, |
||||
|
"|Vr|=%g has exceeded Bv_max=%g\n", |
||||
|
vr, here->RESbv_max); |
||||
|
warns_bv++; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
return OK; |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue