#include "spice.h"
#include <stdio.h>
#include <math.h>
#include "srcdefs.h"
#include "sperror.h"
#include "outdata.h"
#include "trandefs.h"
#include "optdefs.h"
#include "tskdefs.h"
#include "cpdefs.h"
#include "util.h"
#include "cktext.h"
#include "niext.h"
Go to the source code of this file.
|
static int | tran_dcoperation () |
|
static void | tran_setbp () |
|
static int | tran_accept () |
|
static int | tran_step () |
|
static int | interpolate () |
|
static int | is_trunc_dev () |
|
int | TRANan (GENERIC *cktp, int restart) |
|
static int | tran_dcoperation (CKTcircuit *ckt, struct sOUTdata *outd, int restart) |
|
static void | tran_setbp (CKTcircuit *ckt, struct sTRANint *tran) |
|
static int | tran_accept (CKTcircuit *ckt, struct sTRANint *tran, STATistics *stat, struct sOUTdata *outd, bool *done, bool *afterpause) |
|
static int | tran_step (CKTcircuit *ckt, struct sTRANint *tran, STATistics *stat) |
|
static int | interpolate (CKTcircuit *ckt, struct sTRANint *tran, int *count) |
|
static int | is_trunc_dev (CKTcircuit *ckt) |
|
static int interpolate |
( |
| ) |
|
|
static |
Definition at line 572 of file tranan.c.
585 double d1,d2,d3,d4,diff[4];
587 double finalmax,finalmin;
620 for (i = 1; i <= size; i++) {
625 if (tran->
tcheck < finalmax) {
631 if (finalmin < tran->tcheck)
652 diff[0] = d2*d3/((c2)*(c3));
653 diff[1] = d1*d3/((c2)*(c2-c3));
654 diff[2] = d1*d2/((c3)*(c3-c2));
656 for (i = 1; i <= size; i++) {
662 if (tran->
tcheck < finalmax) {
668 if (finalmin < tran->tcheck)
691 diff[0] = d2*d3*d4/((-c2)*(c3)*(c4));
692 diff[1] = d1*d3*d4/((c2)*(c2-c3)*(c2-c4));
693 diff[2] = d1*d2*d4/((c3)*(c3-c2)*(c3-c4));
694 diff[3] = d1*d2*d3/((c4)*(c4-c2)*(c4-c3));
696 for (i = 1; i <= size; i++) {
703 if (tran->
tcheck < finalmax) {
709 if (finalmin < tran->tcheck)
716 if (tran->
tcheck > finalmin)
static int is_trunc_dev |
( |
| ) |
|
|
static |
Definition at line 722 of file tranan.c.
struct sCKTmodHead * next
struct sCKTmodHead * CKTheadList
static int tran_accept |
( |
| ) |
|
|
static |
static int tran_dcoperation |
( |
| ) |
|
|
static |
Definition at line 184 of file tranan.c.
196 bool afterpause =
false;
197 int i, error = 0,
type;
199 afterpause = !restart;
229 tran->dumpit =
false;
231 tran->tcheck = (ckt->
CKTinitTime || !tran->nointerp) ?
234 tran->firsttime =
true;
269 for (i = 0; i < 7; i++) {
278 bcopy((
char *)ckt->CKTstate0,(
char *)ckt->CKTstate1,
288 error =
tran_accept(ckt,tran,stat,outd,&done,&afterpause);
289 if (error || done)
break;
296 for (i = 5; i >= 0; i--) {
struct sSRCinstance * SRCnextInstance
double STATtranDecompTime
SRCinstance * SRCinstances
void bcopy(char *from, char *to, int num)
GENmodel * CKThead[MAXNUMDEVS]
struct sSRCmodel * SRCnextModel
static void tran_setbp |
( |
| ) |
|
|
static |
Definition at line 322 of file tranan.c.
356 if (ttmp < ckt->CKTdelta)
Definition at line 466 of file tranan.c.
472 double olddelta,
new;
473 int i, error, converged;
491 *(ckt->CKTstate2+i) = *(ckt->CKTstate1+i);
492 *(ckt->CKTstate3+i) = *(ckt->CKTstate1+i);
495 if (converged != 0) {
538 if (new <= 1.05*ckt->CKTdelta) {
int TRANan |
( |
GENERIC * |
cktp, |
|
|
int |
restart |
|
) |
| |
Definition at line 43 of file tranan.c.
57 tran->startTime = (*(
SPfrontEnd->IFseconds))();
63 WARNmsg(
"Using initial conditions");
91 tran->nointerp =
false;
92 tran->hitusertp =
false;
97 if (job->
DC.
eltName[0] && tran->nointerp) {
99 "Note: DCsource given, \"set nousertp\" ignored.");
100 tran->nointerp =
false;
102 if (tran->nointerp && tran->hitusertp) {
104 "Note: nousertp set, \"set hitusertp\" ignored.");
105 tran->hitusertp =
false;
109 tran->nojjtp =
false;
128 "DCtrCurv: source %s not in circuit",
136 error =
CKTnames(ckt,&outd.numNames,&outd.dataNames);
149 outd.circuitPtr = (
GENERIC *)ckt;
161 FREE(outd.dataNames);
163 tran->startIters = stat->STATnumIter;
164 tran->startdTime = stat->STATdecompTime;
165 tran->startsTime = stat->STATsolveTime;
177 tran->startTime += (*(
SPfrontEnd->IFseconds))() - tt0;
bool cp_getvar(char *n, int t, char *r)
int DCTloop(int(*func)(), CKTcircuit *ckt, int restart, struct sDCTprms *dc, struct sOUTdata *outd)
IFuid eltName[DCTNESTLEVEL]
double vsave[DCTNESTLEVEL]
static int is_trunc_dev()
static int tran_dcoperation()
GENinstance * elt[DCTNESTLEVEL]