niconv.c, NIconvTest(), NaN in CKTrhs denotes non-convergence
emit a warning message, but only if ft_ngdebug is set
This commit is contained in:
parent
dc6e1cb064
commit
d696aa8781
|
|
@ -14,6 +14,8 @@ Author: 1985 Thomas L. Quarles
|
|||
#include "ngspice/cktdefs.h"
|
||||
#include "ngspice/smpdefs.h"
|
||||
|
||||
extern bool ft_ngdebug;
|
||||
|
||||
|
||||
int
|
||||
NIconvTest(CKTcircuit *ckt)
|
||||
|
|
@ -38,6 +40,11 @@ NIconvTest(CKTcircuit *ckt)
|
|||
node = node->next;
|
||||
new = ckt->CKTrhs [i] ;
|
||||
old = ckt->CKTrhsOld [i] ;
|
||||
if (isnan(new)) {
|
||||
if (ft_ngdebug)
|
||||
fprintf(stderr, "Warning: non-convergence, node %s is nan\n", CKTnodName(ckt, i));
|
||||
return 1;
|
||||
}
|
||||
if(node->type == SP_VOLTAGE) {
|
||||
tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) +
|
||||
ckt->CKTvoltTol;
|
||||
|
|
|
|||
Loading…
Reference in New Issue