From 36313d59f3a5cc3de51d7f54afe4e1d0aec8073e Mon Sep 17 00:00:00 2001 From: Brian Taylor Date: Wed, 15 Sep 2021 08:09:10 -0700 Subject: [PATCH] Use the current point number as the single digit index for Cider 2D ascii save files. This conforms to the normal usage with other types of ascii rawfile. The numd parser table entry for ic.file now has the correct IF_STRING type. --- src/ciderlib/twod/twoprint.c | 7 +++++-- src/spicelib/devices/numd/numd.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ciderlib/twod/twoprint.c b/src/ciderlib/twod/twoprint.c index 2e204fcc2..9b0f9a2dd 100644 --- a/src/ciderlib/twod/twoprint.c +++ b/src/ciderlib/twod/twoprint.c @@ -35,6 +35,7 @@ TWOprnSolution(FILE *file, TWOdevice *pDevice, OUTPcard *output, BOOLEAN asciiSa double *xScale = pDevice->xScale; double *yScale = pDevice->yScale; int ii; + int point_number = 0; if (output->OUTPnumVars == -1) { /* First pass. Need to count number of variables in output. */ @@ -320,7 +321,8 @@ TWOprnSolution(FILE *file, TWOdevice *pDevice, OUTPcard *output, BOOLEAN asciiSa if (asciiSave) { for (ii = 0; ii < numVars; ii++) { if (ii == 0) { - fprintf(file, "%d %d", yIndex, xIndex); + fprintf(file, "%d", point_number); + point_number++; } fprintf(file, "\t%e\n", data[ii]); } @@ -336,7 +338,8 @@ TWOprnSolution(FILE *file, TWOdevice *pDevice, OUTPcard *output, BOOLEAN asciiSa if (asciiSave) { for (ii = 0; ii < numVars; ii++) { if (ii == 0) { - fprintf(file, "%d %d", yIndex, xIndex); + fprintf(file, "%d", point_number); + point_number++; } fprintf(file, "\t%e\n", data[ii]); } diff --git a/src/spicelib/devices/numd/numd.c b/src/spicelib/devices/numd/numd.c index 9223c0fd6..f792d79f6 100644 --- a/src/spicelib/devices/numd/numd.c +++ b/src/spicelib/devices/numd/numd.c @@ -10,7 +10,7 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group IFparm NUMDpTable[] = { /* parameters */ IP("off", NUMD_OFF, IF_FLAG, "Initially off"), - IP("ic.file", NUMD_IC_FILE, IF_REAL, "Initial conditions file"), + IP("ic.file", NUMD_IC_FILE, IF_STRING, "Initial conditions file"), IOP("area", NUMD_AREA, IF_REAL, "Area factor"), IP("save", NUMD_PRINT, IF_INTEGER, "Save Solutions"), IPR("print", NUMD_PRINT, IF_INTEGER, "Print Solutions"),