From 6e2be0877a503e0a31eda2915d36c3e219d9e37b Mon Sep 17 00:00:00 2001 From: Brian Taylor Date: Tue, 7 Nov 2023 11:06:01 -0800 Subject: [PATCH] Make previous KLU support check more transparent. --- src/include/ngspice/cidersupt.h | 11 ----------- src/spicelib/devices/nbjt/nbjtset.c | 8 +++++++- src/spicelib/devices/nbjt2/nbt2set.c | 8 +++++++- src/spicelib/devices/numd/numdset.c | 9 ++++++++- src/spicelib/devices/numd2/nud2set.c | 8 +++++++- src/spicelib/devices/numos/nummset.c | 8 +++++++- 6 files changed, 36 insertions(+), 16 deletions(-) diff --git a/src/include/ngspice/cidersupt.h b/src/include/ngspice/cidersupt.h index e42f76569..1f13682b8 100644 --- a/src/include/ngspice/cidersupt.h +++ b/src/include/ngspice/cidersupt.h @@ -89,15 +89,4 @@ extern BOOLEAN hasSORConverged(double *, double *, int); extern BOOLEAN foundError(int ); extern BOOLEAN compareFiletypeVar(char *); -#ifdef KLU -#define klu_support_for_cider \ - if (ckt->CKTkluMODE) { \ - fprintf(stderr, "Error: CIDER simulation is not (yet) supported with 'option klu'.\n"); \ - fprintf(stderr, " Use 'option sparse' instead.\n"); \ - controlled_exit(1); \ - } -#else -#define klu_support_for_cider -#endif - #endif diff --git a/src/spicelib/devices/nbjt/nbjtset.c b/src/spicelib/devices/nbjt/nbjtset.c index 12aa5a696..34f62293d 100644 --- a/src/spicelib/devices/nbjt/nbjtset.c +++ b/src/spicelib/devices/nbjt/nbjtset.c @@ -44,7 +44,13 @@ NBJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) ONEmaterial *pM, *pMaterial = NULL, *materialList = NULL; double startTime; - klu_support_for_cider +#ifdef KLU + if (ckt->CKTkluMODE) { + fprintf(stderr, "Error: CIDER simulation is not (yet) supported with 'option klu'.\n"); + fprintf(stderr, " Use 'option sparse' instead.\n"); + controlled_exit(1); + } +#endif /* loop through all the diode models */ for (; model != NULL; model = NBJTnextModel(model)) { diff --git a/src/spicelib/devices/nbjt2/nbt2set.c b/src/spicelib/devices/nbjt2/nbt2set.c index 1b126b98e..3164d329f 100644 --- a/src/spicelib/devices/nbjt2/nbt2set.c +++ b/src/spicelib/devices/nbjt2/nbt2set.c @@ -47,7 +47,13 @@ NBJT2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) DOPtable *dopTableList = NULL; double startTime; - klu_support_for_cider +#ifdef KLU + if (ckt->CKTkluMODE) { + fprintf(stderr, "Error: CIDER simulation is not (yet) supported with 'option klu'.\n"); + fprintf(stderr, " Use 'option sparse' instead.\n"); + controlled_exit(1); + } +#endif /* loop through all the models */ for (; model != NULL; model = NBJT2nextModel(model)) { diff --git a/src/spicelib/devices/numd/numdset.c b/src/spicelib/devices/numd/numdset.c index fd9efa662..365d290d4 100644 --- a/src/spicelib/devices/numd/numdset.c +++ b/src/spicelib/devices/numd/numdset.c @@ -45,7 +45,14 @@ NUMDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) DOPtable *dopTableList = NULL; double startTime; - klu_support_for_cider + +#ifdef KLU + if (ckt->CKTkluMODE) { + fprintf(stderr, "Error: CIDER simulation is not (yet) supported with 'option klu'.\n"); + fprintf(stderr, " Use 'option sparse' instead.\n"); + controlled_exit(1); + } +#endif /* loop through all the models */ for (; model != NULL; model = NUMDnextModel(model)) { diff --git a/src/spicelib/devices/numd2/nud2set.c b/src/spicelib/devices/numd2/nud2set.c index 973b0140d..a35a3132f 100644 --- a/src/spicelib/devices/numd2/nud2set.c +++ b/src/spicelib/devices/numd2/nud2set.c @@ -47,7 +47,13 @@ NUMD2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) DOPtable *dopTableList = NULL; double startTime; - klu_support_for_cider +#ifdef KLU + if (ckt->CKTkluMODE) { + fprintf(stderr, "Error: CIDER simulation is not (yet) supported with 'option klu'.\n"); + fprintf(stderr, " Use 'option sparse' instead.\n"); + controlled_exit(1); + } +#endif /* loop through all the models */ for (; model != NULL; model = NUMD2nextModel(model)) { diff --git a/src/spicelib/devices/numos/nummset.c b/src/spicelib/devices/numos/nummset.c index 0ae7760ff..7e9838056 100644 --- a/src/spicelib/devices/numos/nummset.c +++ b/src/spicelib/devices/numos/nummset.c @@ -47,7 +47,13 @@ NUMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) DOPtable *dopTableList = NULL; double startTime; - klu_support_for_cider +#ifdef KLU + if (ckt->CKTkluMODE) { + fprintf(stderr, "Error: CIDER simulation is not (yet) supported with 'option klu'.\n"); + fprintf(stderr, " Use 'option sparse' instead.\n"); + controlled_exit(1); + } +#endif /* loop through all the models */ for (; model != NULL; model = NUMOSnextModel(model)) {