Browse Source

gendef.h, get rid of awkward counted GENnode macros

pre-master-46
rlar 8 years ago
parent
commit
e311096429
  1. 9
      src/include/ngspice/gendefs.h
  2. 8
      src/spicelib/analysis/tfanal.c
  3. 2
      src/spicelib/devices/urc/urcsetup.c

9
src/include/ngspice/gendefs.h

@ -25,15 +25,6 @@ struct GENinstance {
/* carefull, thats overlayed into the actual device structs */
};
/* argh, terminals are counted from 1 */
#define GENnode1 GENnode[0]
#define GENnode2 GENnode[1]
#define GENnode3 GENnode[2]
#define GENnode4 GENnode[3]
#define GENnode5 GENnode[4]
#define GENnode6 GENnode[5]
#define GENnode7 GENnode[6]
/* per model data */

8
src/spicelib/analysis/tfanal.c

@ -76,8 +76,8 @@ TFanal(CKTcircuit *ckt, int restart)
}
if (job->TFinIsI) {
ckt->CKTrhs[ptr->GENnode1] -= 1;
ckt->CKTrhs[ptr->GENnode2] += 1;
ckt->CKTrhs[ptr->GENnode[0]] -= 1;
ckt->CKTrhs[ptr->GENnode[1]] += 1;
} else {
insrc = CKTfndBranch(ckt, job->TFinSrc);
ckt->CKTrhs[insrc] += 1;
@ -119,8 +119,8 @@ TFanal(CKTcircuit *ckt, int restart)
/* now for input resistance */
if (job->TFinIsI) {
outputs[1] = ckt->CKTrhs[ptr->GENnode2] -
ckt->CKTrhs[ptr->GENnode1];
outputs[1] = ckt->CKTrhs[ptr->GENnode[1]] -
ckt->CKTrhs[ptr->GENnode[0]];
} else {
if(fabs(ckt->CKTrhs[insrc])<1e-20) {
outputs[1]=1e20;

2
src/spicelib/devices/urc/urcsetup.c

@ -302,7 +302,7 @@ URCunsetup(GENmodel *inModel, CKTcircuit *ckt)
return E_NOMOD;
for (in = modfast->GENinstances; in; in = in->GENnextInstance)
CKTdltNNum(ckt, in->GENnode1);
CKTdltNNum(ckt, in->GENnode[0]);
CKTdltMod(ckt, modfast); /* Does the elements too */

Loading…
Cancel
Save