Added a comment in NIiter
This commit is contained in:
parent
919ace8d8c
commit
82eb9ef996
|
|
@ -136,6 +136,13 @@ NIiter(CKTcircuit *ckt, int maxIter)
|
||||||
|
|
||||||
#ifdef KLU
|
#ifdef KLU
|
||||||
if (error == E_SINGULAR) {
|
if (error == E_SINGULAR) {
|
||||||
|
|
||||||
|
/* Francesco Lannutti - 25 Aug 2020
|
||||||
|
* If the matrix is numerically singular during ReFactorization, take the same matrix and factor it from scratch in the same iteration.
|
||||||
|
* This is my mod with KLU. It saves run-time, but also the system at the next iteration may be different.
|
||||||
|
* How do we guarantee that the system is the same at the next iteration? So, the original SPARSE version below sounds like a bug.
|
||||||
|
*/
|
||||||
|
|
||||||
fprintf (stderr, "Warning: KLU ReFactor failed. Factoring again...\n") ;
|
fprintf (stderr, "Warning: KLU ReFactor failed. Factoring again...\n") ;
|
||||||
ckt->CKTniState |= NISHOULDREORDER;
|
ckt->CKTniState |= NISHOULDREORDER;
|
||||||
error = SMPreorder(ckt->CKTmatrix, ckt->CKTpivotAbsTol, ckt->CKTpivotRelTol, ckt->CKTdiagGmin);
|
error = SMPreorder(ckt->CKTmatrix, ckt->CKTpivotAbsTol, ckt->CKTpivotRelTol, ckt->CKTdiagGmin);
|
||||||
|
|
@ -158,6 +165,12 @@ NIiter(CKTcircuit *ckt, int maxIter)
|
||||||
#else
|
#else
|
||||||
if (error) {
|
if (error) {
|
||||||
if (error == E_SINGULAR) {
|
if (error == E_SINGULAR) {
|
||||||
|
|
||||||
|
/* Francesco Lannutti - 25 Aug 2020
|
||||||
|
* If the matrix is numerically singular during ReFactorization, factor it from scratch at the next iteration.
|
||||||
|
* This is the original SPICE3F5 code and uses SPARSE.
|
||||||
|
*/
|
||||||
|
|
||||||
ckt->CKTniState |= NISHOULDREORDER;
|
ckt->CKTniState |= NISHOULDREORDER;
|
||||||
DEBUGMSG(" forced reordering....\n");
|
DEBUGMSG(" forced reordering....\n");
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue