Improved reporting (from Phil Barker)
This commit is contained in:
parent
3097c4e04b
commit
008c9d7a4c
|
|
@ -1,4 +1,9 @@
|
|||
2207-10-8 Paolo Nenzi <p.nenzi@ieee.org>
|
||||
2007-10-8 Paolo Nenzi <p.nenzi@ieee.org>
|
||||
* src/frontend/plotting/plotit.c, src/frontend/{nutimp.c, parse.c},
|
||||
src/maths/ni/{niconv.c, niiter.c}, src/spicelib/analysis/dctran.c:
|
||||
Applied patch from Phil barker, iproved error/warning reporting.
|
||||
|
||||
2007-10-8 Paolo Nenzi <p.nenzi@ieee.org>
|
||||
* src/frontend/numparam/{general.h, mystring.c, numpaif.h, numparam.h,
|
||||
nupatest.c, spicenum.c, washprog.c, xpressn.c}: Applied patch from Phil
|
||||
Barker that improves the capabilites of numparam library. Now numparam
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ inp_nutsource(FILE *fp, bool comfile, char *filename)
|
|||
if (deck->li_next) {
|
||||
/* There is something left after the controls. */
|
||||
fprintf(cp_out, "\nCircuit: %s\n\n", tt);
|
||||
fprintf(stderr, "\nCircuit: %s\n\n", tt);
|
||||
|
||||
/* Now expand subcircuit macros. Note that we have to
|
||||
* fix the case before we do this but after we
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ checkvalid(struct pnode *pn)
|
|||
pn->pn_value->v_name);
|
||||
else
|
||||
fprintf(cp_err,
|
||||
"Error: %s: no such vector.\n",
|
||||
"Error(parse.c--checkvalid): %s: no such vector.\n",
|
||||
pn->pn_value->v_name);
|
||||
return (FALSE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -591,7 +591,7 @@ plotit(wordlist *wl, char *hcopy, char *devname)
|
|||
/* Now check for 0-length vectors. */
|
||||
for (d = vecs; d; d = d->v_link2)
|
||||
if (!d->v_length) {
|
||||
fprintf(cp_err, "Error: %s: no such vector\n",
|
||||
fprintf(cp_err, "Error(plotit.c--plotit): %s: no such vector\n",
|
||||
d->v_name);
|
||||
goto quit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,13 @@ NIconvTest(CKTcircuit *ckt)
|
|||
|
||||
node = ckt->CKTnodes;
|
||||
size = SMPmatSize(ckt->CKTmatrix);
|
||||
#ifdef STEPDEBUG
|
||||
for (i=1;i<=size;i++) {
|
||||
new = *((ckt->CKTrhs) + i ) ;
|
||||
old = *((ckt->CKTrhsOld) + i ) ;
|
||||
printf("chk for convergence: %s new: %g old: %g\n",CKTnodName(ckt,i),new,old);
|
||||
}
|
||||
#endif /* STEPDEBUG */
|
||||
for (i=1;i<=size;i++) {
|
||||
node = node->next;
|
||||
new = *((ckt->CKTrhs) + i ) ;
|
||||
|
|
@ -37,7 +44,8 @@ NIconvTest(CKTcircuit *ckt)
|
|||
ckt->CKTvoltTol;
|
||||
if (fabs(new-old) >tol ) {
|
||||
#ifdef STEPDEBUG
|
||||
printf(" non-convergence at node %s\n",CKTnodName(ckt,i));
|
||||
printf(" non-convergence at node (type=3) %s (fabs(new-old)>tol --> fabs(%g-%g)>%g)\n",CKTnodName(ckt,i),new,old,tol);
|
||||
printf(" reltol: %g voltTol: %g (tol=reltol*(MAX(fabs(old),fabs(new))) + voltTol)\n",ckt->CKTreltol,ckt->CKTvoltTol);
|
||||
#endif /* STEPDEBUG */
|
||||
ckt->CKTtroubleNode = i;
|
||||
ckt->CKTtroubleElt = NULL;
|
||||
|
|
@ -48,7 +56,8 @@ NIconvTest(CKTcircuit *ckt)
|
|||
ckt->CKTabstol;
|
||||
if (fabs(new-old) >tol ) {
|
||||
#ifdef STEPDEBUG
|
||||
printf(" non-convergence at node %s\n",CKTnodName(ckt,i));
|
||||
printf(" non-convergence at node (type=%d) %s (fabs(new-old)>tol --> fabs(%g-%g)>%g)\n",node->type,CKTnodName(ckt,i),new,old,tol);
|
||||
printf(" reltol: %g abstol: %g (tol=reltol*(MAX(fabs(old),fabs(new))) + abstol)\n",ckt->CKTreltol,ckt->CKTabstol);
|
||||
#endif /* STEPDEBUG */
|
||||
ckt->CKTtroubleNode = i;
|
||||
ckt->CKTtroubleElt = NULL;
|
||||
|
|
|
|||
|
|
@ -184,9 +184,9 @@ NIiter(CKTcircuit *ckt, int maxIter)
|
|||
*ckt->CKTrhsSpare = 0;
|
||||
*ckt->CKTrhsOld = 0;
|
||||
|
||||
if(iterno > maxIter) {
|
||||
/*printf("too many iterations without convergence: %d iter's\n",
|
||||
iterno);*/
|
||||
if(iterno > maxIter) {
|
||||
/*fprintf(stderr,"too many iterations without convergence: %d iter's (max iter == %d)\n",
|
||||
iterno,maxIter);*/
|
||||
ckt->CKTstat->STATnumIter += iterno;
|
||||
errMsg = MALLOC(strlen(msg)+1);
|
||||
strcpy(errMsg,msg);
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@ DCtran(CKTcircuit *ckt,
|
|||
if(restart || ckt->CKTtime == 0) {
|
||||
delta=MIN(ckt->CKTfinalTime/200,ckt->CKTstep)/10;
|
||||
|
||||
#ifdef STEPDEBUG
|
||||
printf("delta = %g finalTime/200: %g CKTstep: %g\n",delta,ckt->CKTfinalTime/200,ckt->CKTstep);
|
||||
#endif
|
||||
/* begin LTRA code addition */
|
||||
if (ckt->CKTtimePoints != NULL)
|
||||
FREE(ckt->CKTtimePoints);
|
||||
|
|
@ -371,7 +374,7 @@ nextTime:
|
|||
*/
|
||||
|
||||
#ifdef STEPDEBUG
|
||||
printf("Delta %g accepted at time %g\n",ckt->CKTdelta,ckt->CKTtime);
|
||||
printf("Delta %g accepted at time %g (finaltime: %g)\n",ckt->CKTdelta,ckt->CKTtime,ckt->CKTfinalTime);
|
||||
fflush(stdout);
|
||||
#endif /* STEPDEBUG */
|
||||
ckt->CKTstat->STATaccepted ++;
|
||||
|
|
@ -508,7 +511,7 @@ resume:
|
|||
if(ckt->CKTfinalTime/50<ckt->CKTmaxStep) {
|
||||
(void)printf("limited by Tstop/50\n");
|
||||
} else {
|
||||
(void)printf("limited by Tmax\n");
|
||||
(void)printf("limited by Tmax == %g\n",ckt->CKTmaxStep);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -538,7 +541,8 @@ resume:
|
|||
if( (ckt->CKTdelta >.1* ckt->CKTsaveDelta) ||
|
||||
(ckt->CKTdelta > .1*(*(ckt->CKTbreaks+1)-*(ckt->CKTbreaks))) ) {
|
||||
if(ckt->CKTsaveDelta < (*(ckt->CKTbreaks+1)-*(ckt->CKTbreaks))) {
|
||||
(void)printf("limited by pre-breakpoint delta\n");
|
||||
(void)printf("limited by pre-breakpoint delta (saveDelta: %g, nxt_breakpt: %g, curr_breakpt: %g\n",
|
||||
ckt->CKTsaveDelta, *(ckt->CKTbreaks+1), *(ckt->CKTbreaks));
|
||||
} else {
|
||||
(void)printf("limited by next breakpoint\n");
|
||||
}
|
||||
|
|
@ -776,6 +780,7 @@ resume:
|
|||
ckt->CKTtime -= ckt->CKTdelta;
|
||||
ckt->CKTdelta = g_mif_info.breakpoint.current - ckt->CKTtime;
|
||||
g_mif_info.breakpoint.last = ckt->CKTtime + ckt->CKTdelta;
|
||||
|
||||
if(firsttime) {
|
||||
ckt->CKTmode = (ckt->CKTmode&MODEUIC)|MODETRAN | MODEINITTRAN;
|
||||
}
|
||||
|
|
@ -869,8 +874,8 @@ resume:
|
|||
|
||||
#ifdef STEPDEBUG
|
||||
(void)printf(
|
||||
"delta set to truncation error result: %g. Point accepted\n",
|
||||
ckt->CKTdelta);
|
||||
"delta set to truncation error result: %g. Point accepted at CKTtime: %g\n",
|
||||
ckt->CKTdelta,ckt->CKTtime);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef WANT_SENSE2
|
||||
|
|
|
|||
Loading…
Reference in New Issue