maxord set to min 2 or max 6

This commit is contained in:
h_vogt 2009-05-01 17:30:35 +00:00
parent 05c0d50e55
commit bdbee943bf
3 changed files with 14 additions and 6 deletions

View File

@ -1,4 +1,8 @@
2009-04-26 Holger Vogt
2009-05-01 Holger Vogt
* cktdojob.c, cktsopt.c: moved to cktsopt.c:
maxord set to min 2 or max 6
2009-04-28 Holger Vogt
* winmain.c, inp.c, cktop.c: SetAnalyse() modified/added
cktdojob.c: maxord set to minimum 2 (prevent crash in dctran.c:774)

View File

@ -52,11 +52,6 @@ CKTdoJob(void *inCkt, int reset, void *inTask)
ckt->CKTtemp = task->TSKtemp;
ckt->CKTnomTemp = task->TSKnomTemp;
/* Check options method and maxorder for consistency */
if (task->TSKmaxOrder < 2) {
task->TSKmaxOrder = 2;
fprintf(stderr,"\nWarning -- Option maxord < 2 not allowed in this build\nSet to 2\n\n");
}
ckt->CKTmaxOrder = task->TSKmaxOrder;
ckt->CKTintegrateMethod = task->TSKintegrateMethod;
ckt->CKTbypass = task->TSKbypass;

View File

@ -112,6 +112,15 @@ CKTsetOpt(CKTcircuit *ckt, void *anal, int opt, IFvalue *val)
break;
case OPT_MAXORD:
task->TSKmaxOrder = val->iValue;
/* Check options method and maxorder for consistency */
if (task->TSKmaxOrder < 2) {
task->TSKmaxOrder = 2;
fprintf(stderr,"\nWarning -- Option maxord < 2 not allowed in ngspice\nSet to 2\n\n");
}
else if (task->TSKmaxOrder > 6) {
task->TSKmaxOrder = 6;
fprintf(stderr,"\nWarning -- Option maxord > 6 not allowed in ngspice\nSet to 6\n\n");
}
break;
case OPT_OLDLIMIT:
task->TSKfixLimit = val->iValue;