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

View File

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

View File

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