Browse Source

dctran.c, sharedspice.c: function sharedsync has modified parameter list

pre-master-46
h_vogt 13 years ago
committed by rlar
parent
commit
962c73e14e
  1. 13
      src/sharedspice.c
  2. 9
      src/spicelib/analysis/dctran.c

13
src/sharedspice.c

@ -202,7 +202,7 @@ void sighandler_sharedspice(int num);
void wl_delete_first(wordlist **wlstart, wordlist **wlend);
int add_bkpt(void);
int sharedsync(double*, double*, double, double, int, int*, int);
int sharedsync(double*, double*, double, double, double, int, int*, int);
#if !defined(low_latency)
static char* outstorage(char*, bool);
@ -1775,7 +1775,8 @@ getisrcval(double time, char *iname)
convergence, after olddelta had been added in the previous step.
cktdelta pointer to newly defined ckt->CKTdelta, e.g. by recognizing truncation errors
olddelta old ckt->CKTdelta, has already been added in the previous step.
finalt final time
finalt final time CKTfinaltime
delmin minimum delta CKTdelmin
redostep if 0, converged,
if 1, either no convergence, need to redo with new ckt->CKTdelta
or ckt->CKTdelta has been reduced by tuncation errors too large.
@ -1784,7 +1785,8 @@ getisrcval(double time, char *iname)
*/
int
sharedsync(double *pckttime, double *pcktdelta, double olddelta, double finalt, int redostep, int *rejected, int loc)
sharedsync(double *pckttime, double *pcktdelta, double olddelta, double finalt,
double delmin, int redostep, int *rejected, int loc)
{
/* standard procedure, cktdelta has been provided by ngspice */
if (!wantsync) {
@ -1803,6 +1805,9 @@ sharedsync(double *pckttime, double *pcktdelta, double olddelta, double finalt,
/* use cktdelta as suggested by ngspice or acquire new cktdelta
via pointer pcktdelta in user supplied callback */
getsync(*pckttime, pcktdelta, olddelta, redostep, ng_ident, loc, userptr);
/* never move beyond final time */
if (*pckttime + *pcktdelta > finalt)
*pcktdelta = finalt - *pckttime - 1.1 * delmin;
return 1;
}
else {
@ -1812,7 +1817,7 @@ sharedsync(double *pckttime, double *pcktdelta, double olddelta, double finalt,
int retval = getsync(*pckttime, pcktdelta, olddelta, redostep, ng_ident, loc, userptr);
/* never move beyond final time */
if (*pckttime + *pcktdelta > finalt)
*pcktdelta = finalt - *pckttime;
*pcktdelta = finalt - *pckttime - 1.1 * delmin;
/* user has decided to redo the step, ignoring redostep being set to 0
by ngspice. */

9
src/spicelib/analysis/dctran.c

@ -36,7 +36,7 @@ extern struct dbcomm *dbs;
#ifdef SHARED_MODULE
extern int add_bkpt(void);
extern int sharedsync(double*, double*, double, double, int, int*, int);
extern int sharedsync(double*, double*, double, double, double, int, int*, int);
extern int ng_ident; /* for debugging */
static double del_before; /* for debugging */
#endif
@ -630,7 +630,8 @@ resume:
#ifdef SHARED_MODULE
/* Either directly go to next time step, or modify ckt->CKTdelta depending on
synchronization requirements. sharedsync() returns 0. */
sharedsync(&ckt->CKTtime, &ckt->CKTdelta, 0, ckt->CKTfinalTime, 0, &ckt->CKTstat->STATrejected, 0);
sharedsync(&ckt->CKTtime, &ckt->CKTdelta, 0, ckt->CKTfinalTime,
ckt->CKTdelmin, 0, &ckt->CKTstat->STATrejected, 0);
#endif
/* gtri - begin - wbk - Do event solution */
@ -965,8 +966,8 @@ resume:
function.
*/
chkStep:
if(sharedsync(&ckt->CKTtime, &ckt->CKTdelta, olddelta, ckt->CKTfinalTime, redostep,
&ckt->CKTstat->STATrejected, 1) == 0)
if(sharedsync(&ckt->CKTtime, &ckt->CKTdelta, olddelta, ckt->CKTfinalTime,
ckt->CKTdelmin, redostep, &ckt->CKTstat->STATrejected, 1) == 0)
goto nextTime;
#endif

Loading…
Cancel
Save