Corrected a possible bug that

probably comes from SPICE
 Berkeley in NIiter. It can
 affect convergence during
 dynamic gmin stepping algorithm
This commit is contained in:
Francesco Lannutti 2012-09-08 21:43:39 -07:00 committed by Francesco Lannutti
parent 9e29756a98
commit 9df5a4c2d0
3 changed files with 34 additions and 3 deletions

View File

@ -5423,6 +5423,15 @@
Removed the PARALLEL_ARCH macro
Removed the Combine algorithm from Sparse and Analyses
2012-09-08 Francesco Lannutti
* src/maths/KLU/klusmp.c
* src/maths/ni/niiter.c
Corrected a possible bug that
probably comes from SPICE
Berkeley in NIiter. It can
affect convergence during
dynamic gmin stepping algorithm
2012-08-25 Francesco Lannutti
* src/maths/KLU/klusmp.c
* src/spicelib/analysis/cktsetup.c

View File

@ -232,7 +232,14 @@ SMPluFac (SMPmatrix *Matrix, double PivTol, double Gmin)
LoadGmin_CSC (Matrix->CKTdiag_CSC, Matrix->CKTkluN, Gmin) ;
ret = klu_refactor (Matrix->CKTkluAp, Matrix->CKTkluAi, Matrix->CKTkluAx,
Matrix->CKTkluSymbolic, Matrix->CKTkluNumeric, Matrix->CKTkluCommon) ;
return (!ret) ;
if (ret == 1)
return 0 ;
else if (ret == 0)
return (E_SINGULAR) ;
else {
fprintf (stderr, "KLU Error in re-factor!") ;
return 1 ;
}
} else {
spSetReal (Matrix->SPmatrix) ;
LoadGmin (Matrix, Gmin) ;

View File

@ -25,6 +25,10 @@ Modified: 2001 AlansFixes
int
NIiter(CKTcircuit *ckt, int maxIter)
{
/* Francesco Lannutti - NEED TO PIVOT Fix */
int SMPreorderFromSMPluFac ;
SMPreorderFromSMPluFac = 0 ;
int iterno;
int ipass;
int error;
@ -78,10 +82,17 @@ NIiter(CKTcircuit *ckt, int maxIter)
#else /* NEWPRED */
if(1) { /* } */
#endif /* NEWPRED */
error = CKTload(ckt);
/* Francesco Lannutti - NEED TO PIVOT Fix */
error = 0 ;
if (!SMPreorderFromSMPluFac)
{
error = CKTload (ckt) ;
iterno++ ;
}
/*printf("loaded, noncon is %d\n",ckt->CKTnoncon);*/
/*fflush(stdout);*/
iterno++;
if(error) {
ckt->CKTstat->STATnumIter += iterno;
#ifdef STEPDEBUG
@ -143,6 +154,10 @@ NIiter(CKTcircuit *ckt, int maxIter)
SPfrontEnd->IFseconds() - startTime;
if(error) {
if( error == E_SINGULAR ) {
/* Francesco Lannutti - NEED TO PIVOT Fix */
SMPreorderFromSMPluFac = 1 ;
fprintf (stderr, "CIAO\n") ;
ckt->CKTniState |= NISHOULDREORDER;
DEBUGMSG(" forced reordering....\n");
continue;