Browse Source

optran is only selected when the 'optran' command has been processed.

If not, the call to the OPtran() function returns the previous
'converged' value.
pre-master-46
Holger Vogt 5 years ago
parent
commit
493cf73f7f
  1. 2
      src/include/ngspice/cktdefs.h
  2. 4
      src/spicelib/analysis/cktop.c
  3. 6
      src/spicelib/analysis/optran.c

2
src/include/ngspice/cktdefs.h

@ -405,7 +405,7 @@ extern int PZpost(CKTcircuit *);
extern int PZaskQuest(CKTcircuit *, JOB *, int , IFvalue *);
extern int PZsetParm(CKTcircuit *, JOB *, int , IFvalue *);
extern int OPtran(CKTcircuit *);
extern int OPtran(CKTcircuit *, int);
#ifdef WANT_SENSE2
extern int SENaskQuest(CKTcircuit *, JOB *, int , IFvalue *);

4
src/spicelib/analysis/cktop.c

@ -89,7 +89,9 @@ CKTop (CKTcircuit *ckt, long int firstmode, long int continuemode,
return converged;
}
converged = OPtran(ckt);
/* If command 'optran' is not given, the function
returns immediately with the previous 'converged' */
converged = OPtran(ckt, converged);
#ifdef XSPICE
/* gtri - wbk - add convergence problem reporting flags */

6
src/spicelib/analysis/optran.c

@ -220,7 +220,7 @@ int OPsetBreak(CKTcircuit *ckt, double time)
Thus this algorithm creates an operating point to start other simulations.
The code is derived from dctran.c by removing all un-needed parts.*/
int
OPtran(CKTcircuit *ckt)
OPtran(CKTcircuit *ckt, int oldconverged)
{
int i;
double olddelta;
@ -243,10 +243,10 @@ OPtran(CKTcircuit *ckt)
int redostep;
#endif
/* if optran command has not been given (in .spiceinit or in .control section,
/* if optran command has not been given (in .spiceinit or in .control section),
we don' use optran */
if (nooptran)
return 1;
return oldconverged;
/*
ACAN *acjob = (ACAN *) ckt->CKTcurJob;
TRANan *trjob = (TRANan *) ckt->CKTcurJob;

Loading…
Cancel
Save