1 /**********
2 Copyright 1999 Regents of the University of California.  All rights reserved.
3 Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang
4 File: b3soiddtrunc.c          98/5/01
5 Modified by Paolo Nenzi 2002
6 **********/
7 
8 /*
9  * Revision 2.1  99/9/27 Pin Su
10  * BSIMDD2.1 release
11  */
12 
13 #include "ngspice/ngspice.h"
14 #include "ngspice/cktdefs.h"
15 #include "b3soidddef.h"
16 #include "ngspice/sperror.h"
17 #include "ngspice/suffix.h"
18 
19 
20 int
B3SOIDDtrunc(GENmodel * inModel,CKTcircuit * ckt,double * timeStep)21 B3SOIDDtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep)
22 {
23 B3SOIDDmodel *model = (B3SOIDDmodel*)inModel;
24 B3SOIDDinstance *here;
25 
26 #ifdef STEPDEBUG
27     double debugtemp;
28 #endif /* STEPDEBUG */
29 
30     for (; model != NULL; model = B3SOIDDnextModel(model))
31     {    for (here = B3SOIDDinstances(model); here != NULL;
32 	      here = B3SOIDDnextInstance(here))
33 	 {
34 
35 #ifdef STEPDEBUG
36             debugtemp = *timeStep;
37 #endif /* STEPDEBUG */
38             CKTterr(here->B3SOIDDqb,ckt,timeStep);
39             CKTterr(here->B3SOIDDqg,ckt,timeStep);
40             CKTterr(here->B3SOIDDqd,ckt,timeStep);
41 #ifdef STEPDEBUG
42             if(debugtemp != *timeStep)
43 	    {  printf("device %s reduces step from %g to %g\n",
44                        here->B3SOIDDname,debugtemp,*timeStep);
45             }
46 #endif /* STEPDEBUG */
47         }
48     }
49     return(OK);
50 }
51 
52 
53 
54