OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
NGSpice Class Reference

#include "NGSpice.h"

Public Member Functions

 NGSpice ()
 
void runSimulation (std::list< std::string > &_netlist)
 
void initializeCallbacks ()
 
void intializeNGSpice ()
 
void updateBufferClasses (std::map< ot::UID, std::shared_ptr< EntityBlockConnection > >, std::map< ot::UID, std::shared_ptr< EntityBlock > > &, std::string)
 
std::list< std::string > generateNetlist (EntityBase *solverEntity, std::map< ot::UID, std::shared_ptr< EntityBlockConnection > >, std::map< ot::UID, std::shared_ptr< EntityBlock > > &, std::string editorname)
 
std::string generateNetlistDCSimulation (EntityBase *solverEntity, std::map< ot::UID, std::shared_ptr< EntityBlockConnection > >, std::map< ot::UID, std::shared_ptr< EntityBlock > > &, std::string editorname)
 
std::string generateNetlistACSimulation (EntityBase *solverEntity, std::map< ot::UID, std::shared_ptr< EntityBlockConnection > >, std::map< ot::UID, std::shared_ptr< EntityBlock > > &, std::string editorname)
 
std::string generateNetlistTRANSimulation (EntityBase *solverEntity, std::map< ot::UID, std::shared_ptr< EntityBlockConnection > >, std::map< ot::UID, std::shared_ptr< EntityBlock > > &, std::string editorname)
 
std::list< std::string > ngSpice_Initialize (EntityBase *solverEntity, std::map< ot::UID, std::shared_ptr< EntityBlockConnection > >, std::map< ot::UID, std::shared_ptr< EntityBlock > > &, std::string)
 
void clearBufferStructure (std::string name)
 
void connectionAlgorithmWithGNDElement (std::string startingElement, int counter, ot::UID startingElementUID, ot::UID elementUID, std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities, std::map< ot::UID, std::shared_ptr< EntityBlock > > &allEntitiesByBlockID, std::string editorname, std::set< ot::UID > &visitedElements)
 
void connectionAlgorithmWithGNDVoltageSource (std::string startingElement, int counter, ot::UID startingElementUID, ot::UID elementUID, std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities, std::map< ot::UID, std::shared_ptr< EntityBlock > > &allEntitiesByBlockID, std::string editorname, std::set< ot::UID > &visitedElements)
 
void handleWithConnectors (ot::UID elementUID, std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities, std::map< ot::UID, std::shared_ptr< EntityBlock > > &allEntitiesByBlockID, std::string editorname, std::set< ot::UID > &visitedElements)
 
void setNodeNumbers (Connection &myConn)
 
void setNodeNumbersWithGNDVoltageSource (Connection &myConn, ot::UID startingElementUID)
 
bool checkIfElementOrConnectionVisited (std::set< ot::UID > &visitedElements, ot::UID elementUID)
 
Connection createConnection (std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities, ot::UID connection)
 
bool checkIfConnectionIsConnectedToGND (std::string pole)
 
bool checkIfConnectionIsConnectedToGndVoltageSource (std::string pole, ot::UID voltageSourceUID, ot::UID elementUID)
 
bool checkIfConnectionIsConnectedToVoltageMeter (std::string blockTitle)
 
void setNodeNumbersOfVoltageSource (std::string startingElement, int counter, ot::UID startingElementUID, ot::UID elementUID, std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities, std::map< ot::UID, std::shared_ptr< EntityBlock > > &allEntitiesByBlockID, std::string editorname, std::set< ot::UID > &visitedElements)
 
bool addToCustomNameToNetlistMap (const std::string &, const std::string &)
 
bool addToNetlistNameToCustomMap (const std::string &, const std::string &)
 
std::string assignElementID (const std::string &elementType)
 
std::string to_lowercase (const std::string &str)
 
std::map< std::string, Circuit > & getMapOfCircuits ()
 
std::string const getVoltMeterConnectionName () const
 
std::map< std::string, std::string > & getMapOfCustomToNetlistName ()
 
std::map< std::string, int > & getMapOfElementCounters ()
 
std::string getNetlistNameOfMap (const std::string &customName) const
 

Static Public Member Functions

static int MySendCharFunction (char *, int, void *)
 
static int MySendStat (char *, int, void *)
 
static int MyControlledExit (int, bool imidiate, bool quitexit, int, void *)
 
static int MySendDataFunction (pvecvaluesall, int, int, void *)
 
static int MySendInitDataFunction (pvecinfoall, int, void *)
 

Public Attributes

std::map< std::string, CircuitmapOfCircuits
 
std::map< std::pair< ot::UID, std::string >, std::string > connectionNodeNumbers
 
std::map< std::string, std::string > customNameToNetlistNameMap
 
std::map< std::string, std::string > netlistNameToCustomNameMap
 
std::map< std::string, int > elementCounters
 

Constructor & Destructor Documentation

◆ NGSpice()

NGSpice::NGSpice ( )

Member Function Documentation

◆ addToCustomNameToNetlistMap()

bool NGSpice::addToCustomNameToNetlistMap ( const std::string & customName,
const std::string & netlistName )

◆ addToNetlistNameToCustomMap()

bool NGSpice::addToNetlistNameToCustomMap ( const std::string & customName,
const std::string & netlistName )

◆ assignElementID()

std::string NGSpice::assignElementID ( const std::string & elementType)

◆ checkIfConnectionIsConnectedToGND()

bool NGSpice::checkIfConnectionIsConnectedToGND ( std::string pole)

◆ checkIfConnectionIsConnectedToGndVoltageSource()

bool NGSpice::checkIfConnectionIsConnectedToGndVoltageSource ( std::string pole,
ot::UID voltageSourceUID,
ot::UID elementUID )

◆ checkIfConnectionIsConnectedToVoltageMeter()

bool NGSpice::checkIfConnectionIsConnectedToVoltageMeter ( std::string blockTitle)

◆ checkIfElementOrConnectionVisited()

bool NGSpice::checkIfElementOrConnectionVisited ( std::set< ot::UID > & visitedElements,
ot::UID elementUID )

◆ clearBufferStructure()

void NGSpice::clearBufferStructure ( std::string name)

◆ connectionAlgorithmWithGNDElement()

void NGSpice::connectionAlgorithmWithGNDElement ( std::string startingElement,
int counter,
ot::UID startingElementUID,
ot::UID elementUID,
std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities,
std::map< ot::UID, std::shared_ptr< EntityBlock > > & allEntitiesByBlockID,
std::string editorname,
std::set< ot::UID > & visitedElements )

◆ connectionAlgorithmWithGNDVoltageSource()

void NGSpice::connectionAlgorithmWithGNDVoltageSource ( std::string startingElement,
int counter,
ot::UID startingElementUID,
ot::UID elementUID,
std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities,
std::map< ot::UID, std::shared_ptr< EntityBlock > > & allEntitiesByBlockID,
std::string editorname,
std::set< ot::UID > & visitedElements )

◆ createConnection()

Connection NGSpice::createConnection ( std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities,
ot::UID connection )

◆ generateNetlist()

std::list< std::string > NGSpice::generateNetlist ( EntityBase * solverEntity,
std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities,
std::map< ot::UID, std::shared_ptr< EntityBlock > > & allEntitiesByBlockID,
std::string editorname )

◆ generateNetlistACSimulation()

std::string NGSpice::generateNetlistACSimulation ( EntityBase * solverEntity,
std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > ,
std::map< ot::UID, std::shared_ptr< EntityBlock > > & ,
std::string editorname )

◆ generateNetlistDCSimulation()

std::string NGSpice::generateNetlistDCSimulation ( EntityBase * solverEntity,
std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > ,
std::map< ot::UID, std::shared_ptr< EntityBlock > > & ,
std::string editorname )

◆ generateNetlistTRANSimulation()

std::string NGSpice::generateNetlistTRANSimulation ( EntityBase * solverEntity,
std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > ,
std::map< ot::UID, std::shared_ptr< EntityBlock > > & ,
std::string editorname )

◆ getMapOfCircuits()

std::map< std::string, Circuit > & NGSpice::getMapOfCircuits ( )
inline

◆ getMapOfCustomToNetlistName()

std::map< std::string, std::string > & NGSpice::getMapOfCustomToNetlistName ( )
inline

◆ getMapOfElementCounters()

std::map< std::string, int > & NGSpice::getMapOfElementCounters ( )
inline

◆ getNetlistNameOfMap()

std::string NGSpice::getNetlistNameOfMap ( const std::string & customName) const

◆ getVoltMeterConnectionName()

std::string const NGSpice::getVoltMeterConnectionName ( ) const
inline

◆ handleWithConnectors()

void NGSpice::handleWithConnectors ( ot::UID elementUID,
std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities,
std::map< ot::UID, std::shared_ptr< EntityBlock > > & allEntitiesByBlockID,
std::string editorname,
std::set< ot::UID > & visitedElements )

◆ initializeCallbacks()

void NGSpice::initializeCallbacks ( )

◆ intializeNGSpice()

void NGSpice::intializeNGSpice ( )

◆ MyControlledExit()

int NGSpice::MyControlledExit ( int exitstatus,
bool imidiate,
bool quitexit,
int ident,
void * userdata )
static

◆ MySendCharFunction()

int NGSpice::MySendCharFunction ( char * output,
int ident,
void * userData )
static

◆ MySendDataFunction()

int NGSpice::MySendDataFunction ( pvecvaluesall vectorsAll,
int numStructs,
int idNumNGSpiceSharedLib,
void * userData )
static

◆ MySendInitDataFunction()

int NGSpice::MySendInitDataFunction ( pvecinfoall vectorInfoAll,
int idNumNGSpiceSharedLib,
void * userData )
static

◆ MySendStat()

int NGSpice::MySendStat ( char * outputReturn,
int ident,
void * userData )
static

◆ ngSpice_Initialize()

std::list< std::string > NGSpice::ngSpice_Initialize ( EntityBase * solverEntity,
std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities,
std::map< ot::UID, std::shared_ptr< EntityBlock > > & allEntitiesByBlockID,
std::string editorname )

◆ runSimulation()

void NGSpice::runSimulation ( std::list< std::string > & _netlist)

◆ setNodeNumbers()

void NGSpice::setNodeNumbers ( Connection & myConn)

◆ setNodeNumbersOfVoltageSource()

void NGSpice::setNodeNumbersOfVoltageSource ( std::string startingElement,
int counter,
ot::UID startingElementUID,
ot::UID elementUID,
std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities,
std::map< ot::UID, std::shared_ptr< EntityBlock > > & allEntitiesByBlockID,
std::string editorname,
std::set< ot::UID > & visitedElements )

◆ setNodeNumbersWithGNDVoltageSource()

void NGSpice::setNodeNumbersWithGNDVoltageSource ( Connection & myConn,
ot::UID startingElementUID )

◆ to_lowercase()

std::string NGSpice::to_lowercase ( const std::string & str)

◆ updateBufferClasses()

void NGSpice::updateBufferClasses ( std::map< ot::UID, std::shared_ptr< EntityBlockConnection > > allConnectionEntities,
std::map< ot::UID, std::shared_ptr< EntityBlock > > & allEntitiesByBlockID,
std::string editorname )

Member Data Documentation

◆ connectionNodeNumbers

std::map<std::pair<ot::UID, std::string>, std::string> NGSpice::connectionNodeNumbers

◆ customNameToNetlistNameMap

std::map<std::string, std::string> NGSpice::customNameToNetlistNameMap

◆ elementCounters

std::map<std::string, int> NGSpice::elementCounters

◆ mapOfCircuits

std::map<std::string, Circuit> NGSpice::mapOfCircuits

◆ netlistNameToCustomNameMap

std::map<std::string, std::string> NGSpice::netlistNameToCustomNameMap

The documentation for this class was generated from the following files: