From a20afc54a512839bbfa9dbf6751a16f22e33c38c Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 24 May 2020 20:27:15 +0200 Subject: [PATCH] When we sre ready, reset CKTmaxstep to its previous value --- src/spicelib/analysis/optran.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/spicelib/analysis/optran.c b/src/spicelib/analysis/optran.c index 65abdff64..7986fecb9 100644 --- a/src/spicelib/analysis/optran.c +++ b/src/spicelib/analysis/optran.c @@ -209,7 +209,7 @@ OPtran(CKTcircuit *ckt) int error; int save_order; long save_mode; - double maxstepsize = 0.0; + double maxstepsize = 0.0, prevmaxstepsize = 0.0; int ltra_num; @@ -242,6 +242,7 @@ OPtran(CKTcircuit *ckt) ckt->CKTstep = opfinaltime / 1000.; } #else + prevmaxstepsize = ckt->CKTmaxStep; ckt->CKTmaxStep = ckt->CKTstep = opstepsize; #endif delta=MIN(opfinaltime/100,ckt->CKTstep)/10; @@ -367,6 +368,7 @@ OPtran(CKTcircuit *ckt) if(AlmostEqualUlps( optime, opfinaltime, 100 ) ) { tfree(opbreaks); SPfrontEnd->IFerrorf(ERR_INFO, "Transient op finished successfully"); + ckt->CKTmaxStep = prevmaxstepsize; return(OK); }