Fixed DiagGmin Stepping Algorithm
This commit is contained in:
parent
962c73e14e
commit
debb5b8ece
|
|
@ -107,6 +107,11 @@ struct CKTcircuit {
|
|||
#define GEAR 2
|
||||
|
||||
SMPmatrix *CKTmatrix; /* pointer to sparse matrix */
|
||||
|
||||
/*!!*/
|
||||
/* GMIN Stepping */
|
||||
double **CKTdiag ; /* Vector of pointers to the real diagonal elements */
|
||||
|
||||
int CKTniState; /* internal state */
|
||||
double *CKTrhs; /* current rhs value - being loaded */
|
||||
double *CKTrhsOld; /* previous rhs value for convergence
|
||||
|
|
|
|||
|
|
@ -33,6 +33,14 @@ NIreinit( CKTcircuit *ckt)
|
|||
CKALLOC(CKTirhs,size+1,double);
|
||||
CKALLOC(CKTirhsOld,size+1,double);
|
||||
CKALLOC(CKTirhsSpare,size+1,double);
|
||||
|
||||
/*!!*/
|
||||
/* GMIN Stepping */
|
||||
int i ;
|
||||
CKALLOC(CKTdiag,size+1,double*);
|
||||
for (i = 0 ; i <= size ; i++)
|
||||
ckt->CKTdiag [i] = NULL ;
|
||||
|
||||
#ifdef PREDICTOR
|
||||
CKALLOC(CKTpred,size+1,double);
|
||||
for( i=0;i<8;i++) {
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ extern double scalbn(double, int);
|
|||
extern double logb(double);
|
||||
#endif
|
||||
|
||||
/*!!*/
|
||||
static void LoadGmin(SMPmatrix *Matrix, double Gmin);
|
||||
|
||||
|
||||
|
|
@ -170,7 +171,10 @@ SMPluFac(SMPmatrix *Matrix, double PivTol, double Gmin)
|
|||
{
|
||||
NG_IGNORE(PivTol);
|
||||
spSetReal( Matrix );
|
||||
LoadGmin( Matrix, Gmin );
|
||||
|
||||
/*!!*/
|
||||
// LoadGmin( Matrix, Gmin );
|
||||
|
||||
return spFactor( Matrix );
|
||||
}
|
||||
|
||||
|
|
@ -194,7 +198,10 @@ int
|
|||
SMPreorder(SMPmatrix *Matrix, double PivTol, double PivRel, double Gmin)
|
||||
{
|
||||
spSetReal( Matrix );
|
||||
LoadGmin( Matrix, Gmin );
|
||||
|
||||
/*!!*/
|
||||
// LoadGmin( Matrix, Gmin );
|
||||
|
||||
return spOrderAndFactor( Matrix, NULL,
|
||||
PivRel, PivTol, YES );
|
||||
}
|
||||
|
|
@ -419,6 +426,7 @@ SMPcDProd(SMPmatrix *Matrix, SPcomplex *pMantissa, int *pExponent)
|
|||
* for compatibility with Spice3.
|
||||
*/
|
||||
|
||||
/*!!*/
|
||||
static void
|
||||
LoadGmin(SMPmatrix *Matrix, double Gmin)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -294,8 +294,10 @@ SwapCols( MatrixPtr Matrix, ElementPtr pTwin1, ElementPtr pTwin2 )
|
|||
Matrix->ExtToIntColMap[Matrix->IntToExtColMap[Col1]]=Col1;
|
||||
#endif
|
||||
|
||||
/*!!*/
|
||||
Matrix->Diag[Col1] = pTwin2;
|
||||
Matrix->Diag[Col2] = pTwin1;
|
||||
|
||||
Matrix->NumberOfInterchangesIsOdd = !Matrix->NumberOfInterchangesIsOdd;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,15 @@ CKTload(CKTcircuit *ckt)
|
|||
}
|
||||
}
|
||||
|
||||
/*!!*/
|
||||
/* GMIN Stepping */
|
||||
for (i = 1 ; i <= size ; i++)
|
||||
{
|
||||
if (ckt->CKTdiag [i] != NULL)
|
||||
{
|
||||
*(ckt->CKTdiag [i]) += ckt->CKTdiagGmin ;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef XSPICE
|
||||
/* gtri - add - wbk - 11/26/90 - reset the MIF init flags */
|
||||
|
|
|
|||
|
|
@ -127,6 +127,22 @@ CKTsetup(CKTcircuit *ckt)
|
|||
|
||||
/* gtri - end - Setup for adding rshunt option resistors */
|
||||
#endif
|
||||
|
||||
/*!!*/
|
||||
/* GMIN Stepping */
|
||||
CKTnode *node ;
|
||||
|
||||
node = ckt->CKTnodes ;
|
||||
for (i = 1 ; i <= SMPmatSize (ckt->CKTmatrix) ; i++)
|
||||
{
|
||||
node = node->next ;
|
||||
|
||||
if (node->type == SP_VOLTAGE)
|
||||
{
|
||||
ckt->CKTdiag [i] = SMPmakeElt (ckt->CKTmatrix, i, i) ;
|
||||
}
|
||||
}
|
||||
|
||||
return(OK);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue