Simulation: do not add .save V(0) and/or .save V(GND) to ngspice.

These 2 nets are internally added by ngspice (info from Holger Vogt)

(cherry picked from commit d92396341e)
This commit is contained in:
jean-pierre charras 2019-07-07 17:55:43 +02:00 committed by Seth Hillbrand
parent c8f40e1d26
commit d34b664933
1 changed files with 8 additions and 2 deletions

View File

@ -187,8 +187,14 @@ void NETLIST_EXPORTER_PSPICE_SIM::writeDirectives( OUTPUTFORMATTER* aFormatter,
// If we print out .save directives for currents, then it needs to be done for voltages as well
for( const auto& netMap : GetNetIndexMap() )
{
aFormatter->Print( 0, ".save %s\n",
(const char*) GetSpiceVector( netMap.first, SPT_VOLTAGE ).c_str() );
// the "0" and the "GND" nets are automaticallly saved internally by ngspice.
// Skip them
wxString netname = GetSpiceVector( netMap.first, SPT_VOLTAGE );
if( netname == "V(0)" || netname == "V(GND)" )
continue;
aFormatter->Print( 0, ".save %s\n", (const char*) netname.c_str() );
}
if( m_simCommand.IsEmpty() )