debug printf, which expose the second bogus niiter()

-----------------
CKTload
MIFload: not yet valid, setting CKTnoncon
niiter[4], solving
niiter[4], skipping NIconvTest

-----------------
CKTload
niiter[5], solving
niiter[5], NIconvTest->0
niiter[5], accepted and return

in niiter[4] the matrix stamp and rhs is not yet valid,
  a solution is produced nontheless

in niiter[5] matrix stamp and rhs are valid, for the first time,
  a solution is produce,
  in niconvtest this first "real" solution is compared to the previous
    "bugos"/"invalid" solution, and by mere accidendence
    happens to compare well
  thus the new solution, is accepted, even though the descicion was
    based on comparsion with an arbitrary vector
This commit is contained in:
rlar 2018-01-31 19:11:56 +01:00
parent b668f76c4e
commit cf6625a5a8
3 changed files with 11 additions and 2 deletions

View File

@ -31,6 +31,7 @@ NIiter(CKTcircuit *ckt, int maxIter)
int iterno = 0; int iterno = 0;
int ipass = 0; int ipass = 0;
printf("\n\n-------------------------------------------------\n");
/* some convergence issues that get resolved by increasing max iter */ /* some convergence issues that get resolved by increasing max iter */
if (maxIter < 100) if (maxIter < 100)
maxIter = 100; maxIter = 100;
@ -160,6 +161,7 @@ NIiter(CKTcircuit *ckt, int maxIter)
startTime = SPfrontEnd->IFseconds(); startTime = SPfrontEnd->IFseconds();
SMPsolve(ckt->CKTmatrix, ckt->CKTrhs, ckt->CKTrhsSpare); SMPsolve(ckt->CKTmatrix, ckt->CKTrhs, ckt->CKTrhsSpare);
printf("niiter[%d], solving\n", iterno);
ckt->CKTstat->STATsolveTime += ckt->CKTstat->STATsolveTime +=
SPfrontEnd->IFseconds() - startTime; SPfrontEnd->IFseconds() - startTime;
#ifdef STEPDEBUG #ifdef STEPDEBUG
@ -189,10 +191,13 @@ NIiter(CKTcircuit *ckt, int maxIter)
return(E_ITERLIM); return(E_ITERLIM);
} }
if ((ckt->CKTnoncon == 0) && (iterno != 1)) if ((ckt->CKTnoncon == 0) && (iterno != 1)) {
ckt->CKTnoncon = NIconvTest(ckt); ckt->CKTnoncon = NIconvTest(ckt);
else printf("niiter[%d], NIconvTest->%d\n", iterno, ckt->CKTnoncon);
} else {
printf("niiter[%d], skipping NIconvTest\n", iterno);
ckt->CKTnoncon = 1; ckt->CKTnoncon = 1;
}
#ifdef STEPDEBUG #ifdef STEPDEBUG
printf("noncon is %d\n", ckt->CKTnoncon); printf("noncon is %d\n", ckt->CKTnoncon);
@ -205,6 +210,7 @@ NIiter(CKTcircuit *ckt, int maxIter)
{ {
CKTnode *node; CKTnode *node;
double diff, maxdiff = 0; double diff, maxdiff = 0;
printf("niiter[%d], nodedamping\n", iterno);
for (node = ckt->CKTnodes->next; node; node = node->next) for (node = ckt->CKTnodes->next; node; node = node->next)
if (node->type == SP_VOLTAGE) { if (node->type == SP_VOLTAGE) {
diff = ckt->CKTrhs[node->number] - ckt->CKTrhsOld[node->number]; diff = ckt->CKTrhs[node->number] - ckt->CKTrhsOld[node->number];
@ -237,6 +243,7 @@ NIiter(CKTcircuit *ckt, int maxIter)
if (ckt->CKTnoncon == 0) { if (ckt->CKTnoncon == 0) {
ckt->CKTstat->STATnumIter += iterno; ckt->CKTstat->STATnumIter += iterno;
FREE(OldCKTstate0); FREE(OldCKTstate0);
printf("niiter[%d], accepted and return\n", iterno);
return(OK); return(OK);
} }
} else if (ckt->CKTmode & MODEINITJCT) { } else if (ckt->CKTmode & MODEINITJCT) {

View File

@ -39,6 +39,7 @@ CKTload(CKTcircuit *ckt)
int noncon; int noncon;
#endif /* STEPDEBUG */ #endif /* STEPDEBUG */
printf("\n-----------------\nCKTload\n");
#ifdef XSPICE #ifdef XSPICE
/* gtri - begin - Put resistors to ground at all nodes */ /* gtri - begin - Put resistors to ground at all nodes */
/* SMPmatrix *matrix; maschmann : deleted , because unused */ /* SMPmatrix *matrix; maschmann : deleted , because unused */

View File

@ -359,6 +359,7 @@ MIFload(
fast->input.rvalue = last_input + conv_limit; fast->input.rvalue = last_input + conv_limit;
else else
fast->input.rvalue = last_input - conv_limit; fast->input.rvalue = last_input - conv_limit;
printf("MIFload: not yet valid, setting CKTnoncon\n");
(ckt->CKTnoncon)++; (ckt->CKTnoncon)++;
/* report convergence problem if last call */ /* report convergence problem if last call */
if(ckt->enh->conv_debug.report_conv_probs) { if(ckt->enh->conv_debug.report_conv_probs) {