From c78d71c3635dd06d27f2e9f2c972ad17681c514f Mon Sep 17 00:00:00 2001 From: h_vogt Date: Thu, 17 May 2012 23:26:47 +0200 Subject: [PATCH] .nodeset all = value added to set all voltage nodes at once --- src/spicelib/parser/inppas3.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/spicelib/parser/inppas3.c b/src/spicelib/parser/inppas3.c index c882db187..33eb7d405 100644 --- a/src/spicelib/parser/inppas3.c +++ b/src/spicelib/parser/inppas3.c @@ -9,6 +9,7 @@ Modified: AlansFixes #include "ngspice/iferrmsg.h" #include "ngspice/ifsim.h" #include "ngspice/inpmacs.h" +#include "ngspice/cktdefs.h" #include "inppas3.h" @@ -68,9 +69,19 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task, for(;;) { /* loop until we run out of data */ INPgetTok(&line,&name,1); - - /* check to see if in the form V(xxx) and grab the xxx */ if( *name == 0) break; /* end of line */ + + /* If we have 'all = value' , then set all voltage nodes to 'value', + except for ground node at node->number 0 */ + if ( cieq(name, "all")) { + ptemp.rValue = INPevaluate(&line,&error,1); + for (node1 = ckt->CKTnodes; node1 != NULL; node1 = node1->next) { + if ((node1->type == 3) && (node1->number > 0)) + IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL)); + } + break; + } + /* check to see if in the form V(xxx) and grab the xxx */ if( (*name == 'V' || *name == 'v') && !name[1] ) { /* looks like V - must be V(xx) - get xx now*/ INPgetTok(&line,&name,1);