diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEtrunc.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEtrunc.c.xml new file mode 100644 index 000000000..8075f2c42 --- /dev/null +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEtrunc.c.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "ngspice.h" +#include "cktdefs.h" +#include "$(module)defs.h" +#include "sperror.h" +#include "suffix.h" + +int $(module)trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) +{ + register $(module)model *model = ($(module)model*)inModel; + register $(module)instance *here; + +#ifdef STEPDEBUG + double debugtemp; +#endif /* STEPDEBUG */ + + for ( ; model != NULL; model = model->$(module)nextModel ) + { + /* loop through all the instances of the model */ + for (here = model->$(module)instances; here != NULL ; here = here->$(module)nextInstance) + { +#ifdef STEPDEBUG + debugtemp = *timeStep; +#endif /* STEPDEBUG */ + + + + + CKTterr(here->state_%s_%s, ckt, timeStep); + + + +#ifdef STEPDEBUG + if(debugtemp != *timeStep) + { printf("device %%s reduces step from %%g to %%g\\n", + here->$(module)name,debugtemp,*timeStep); + } +#endif /* STEPDEBUG */ + + } /* End of Instance */ + } /* End of Model */ + return(OK); +} + + + + + + + + + + + + + + + + + +