OMSimulatorLib
The OMSimulator project is a FMI-based co-simulation environment that supports ordinary (i.e., non-delayed) and TLM connections.
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
oms::SystemWC Class Reference

#include <SystemWC.h>

Inheritance diagram for oms::SystemWC:
Inheritance graph
Collaboration diagram for oms::SystemWC:
Collaboration graph

Public Member Functions

 ~SystemWC ()
 
oms_status_enu_t exportToSSD_SimulationInformation (pugi::xml_node &node) const
 
oms_status_enu_t importFromSSD_SimulationInformation (const pugi::xml_node &node, const std::string &sspVersion)
 
oms_status_enu_t instantiate ()
 
oms_status_enu_t initialize ()
 
oms_status_enu_t terminate ()
 
oms_status_enu_t reset ()
 
oms_status_enu_t stepUntil (double stopTime, void(*cb)(const char *ident, double time, oms_status_enu_t status))
 
oms_status_enu_t stepUntilASSC (double stopTime, void(*cb)(const char *ident, double time, oms_status_enu_t status))
 
std::string getSolverName () const
 
oms_status_enu_t setSolverMethod (std::string)
 
oms_status_enu_t setSolver (oms_solver_enu_t solver)
 
oms_status_enu_t getInputs (DirectedGraph &graph, std::vector< double > &inputs)
 
oms_status_enu_t setInputsDer (oms::DirectedGraph &graph, const std::vector< double > &inputsDer)
 
oms_status_enu_t getInputAndOutput (DirectedGraph &graph, std::vector< double > &inputVect, std::vector< double > &outputVect, std::map< ComRef, Component *> FMUcomponents)
 
oms_status_enu_t updateInputs (DirectedGraph &graph)
 
oms_status_enu_t getRealOutputDerivative (const ComRef &cref, SignalDerivative &der)
 
oms_status_enu_t setRealInputDerivative (const ComRef &cref, const SignalDerivative &der)
 
unsigned int getMaxOutputDerivativeOrder ()
 
oms_status_enu_t addEventIndicator (const ComRef &signal)
 
oms_status_enu_t addTimeIndicator (const ComRef &signal)
 
oms_status_enu_t addStaticValueIndicator (const ComRef &signal, double lowerBound, double upperBound, double stepSize)
 
oms_status_enu_t addDynamicValueIndicator (const ComRef &signal, const ComRef &lower, const ComRef &upper, double stepSize)
 
oms_status_enu_t registerSignalsForResultFile (ResultWriter &resultFile)
 
oms_status_enu_t updateSignals (ResultWriter &resultFile)
 
- Public Member Functions inherited from oms::System
virtual ~System ()
 
SystemgetSystem (const ComRef &cref)
 
ComponentgetComponent (const ComRef &cref)
 
SystemgetSubSystem (const ComRef &cref)
 
VariablegetVariable (const ComRef &cref)
 
const ComRefgetCref () const
 
ComRef getFullCref () const
 
ElementgetElement ()
 
oms_status_enu_t listUnconnectedConnectors (char **contents) const
 
oms_system_enu_t getType () const
 
oms_status_enu_t addSubSystem (const ComRef &cref, oms_system_enu_t type)
 
oms_status_enu_t addSubModel (const ComRef &cref, const std::string &fmuPath)
 
bool validCref (const ComRef &cref)
 
oms_status_enu_t exportToSSD (pugi::xml_node &node, pugi::xml_node &ssvNode) const
 
oms_status_enu_t importFromSSD (const pugi::xml_node &node, const std::string &sspVersion)
 
void setGeometry (const ssd::ElementGeometry &geometry)
 
oms_status_enu_t addConnector (const ComRef &cref, oms_causality_enu_t causality, oms_signal_type_enu_t type)
 
ConnectorgetConnector (const ComRef &cref)
 
std::string getConnectorOwner (const ComRef &cref) const
 
Connector ** getConnectors ()
 
BusConnectorgetBusConnector (const ComRef &cref)
 
oms_status_enu_t addTLMConnection (const ComRef &crefA, const ComRef &crefB, double delay, double alpha, double linearimpedance, double angularimpedance)
 
oms_status_enu_t setTLMConnectionParameters (const ComRef &crefA, const ComRef &crefB, const oms_tlm_connection_parameters_t *parameters)
 
oms_status_enu_t addTLMBus (const ComRef &cref, oms_tlm_domain_t domain, const int dimensions, const oms_tlm_interpolation_t interpolation)
 
oms_status_enu_t addConnectorToTLMBus (const ComRef &busCref, const ComRef &connectorCref, const std::string type)
 
oms_status_enu_t deleteConnectorFromTLMBus (const ComRef &busCref, const ComRef &connectorCref)
 
oms_status_enu_t setTLMBusGeometry (const ComRef &cref, const oms::ssd::ConnectorGeometry *geometry)
 
TLMBusConnectorgetTLMBusConnector (const ComRef &cref)
 
TLMBusConnector ** getTLMBusConnectors ()
 
ConnectiongetConnection (const ComRef &crefA, const ComRef &crefB)
 
Connection ** getConnections (const ComRef &cref)
 
oms_status_enu_t addConnection (const ComRef &crefA, const ComRef &crefB)
 
oms_status_enu_t deleteConnection (const ComRef &crefA, const ComRef &crefB)
 
oms_status_enu_t setConnectorGeometry (const ComRef &cref, const oms::ssd::ConnectorGeometry *geometry)
 
oms_status_enu_t setConnectionGeometry (const ComRef &crefA, const ComRef &crefB, const oms::ssd::ConnectionGeometry *geometry)
 
oms_status_enu_t addBus (const ComRef &cref)
 
oms_status_enu_t addConnectorToBus (const ComRef &busCref, const ComRef &connectorCref)
 
oms_status_enu_t deleteConnectorFromBus (const ComRef &busCref, const ComRef &connectorCref)
 
oms_status_enu_t setBusGeometry (const ComRef &cref, const oms::ssd::ConnectorGeometry *geometry)
 
oms_status_enu_t addExternalModel (const ComRef &cref, std::string path, std::string startscript)
 
oms_status_enu_t delete_ (const ComRef &cref)
 
oms_status_enu_t deleteAllConectionsTo (const ComRef &cref)
 
bool isConnected (const ComRef &cref) const
 
ModelgetModel ()
 
SystemgetParentSystem () const
 
bool copyResources ()
 
oms_status_enu_t getAllResources (std::vector< std::string > &resources)
 
const std::map< ComRef, System * > & getSubSystems ()
 
const std::map< ComRef, Component * > & getComponents ()
 
oms_status_enu_t updateDependencyGraphs ()
 
const DirectedGraphgetInitialUnknownsGraph ()
 
const DirectedGraphgetOutputsGraph ()
 
oms_status_enu_t exportDependencyGraphs (const std::string &pathInitialization, const std::string &pathEvent, const std::string &pathSimulation)
 
oms_status_enu_t setFaultInjection (const ComRef &signal, oms_fault_type_enu_t faultType, double faultValue)
 
double getTime () const
 
oms_status_enu_t getBoolean (const ComRef &cref, bool &value)
 
oms_status_enu_t getInteger (const ComRef &cref, int &value)
 
oms_status_enu_t getReal (const ComRef &cref, double &value)
 
oms_status_enu_t setBoolean (const ComRef &cref, bool value)
 
oms_status_enu_t setInteger (const ComRef &cref, int value)
 
oms_status_enu_t setReal (const ComRef &cref, double value)
 
oms_status_enu_t getReals (const std::vector< ComRef > &crefs, std::vector< double > &values)
 
oms_status_enu_t setReals (const std::vector< ComRef > &crefs, std::vector< double > values)
 
oms_status_enu_t setRealInputDerivatives (const ComRef &cref, int order, double value)
 
bool isTopLevelSystem () const
 
oms_status_enu_t addSignalsToResults (const char *regex)
 
oms_status_enu_t removeSignalsFromResults (const char *regex)
 
void getTolerance (double *absoluteTolerance, double *relativeTolerance) const
 
void getStepSize (double *initialStepSize, double *minimumStepSize, double *maximumStepSize) const
 
oms_status_enu_t setTolerance (double absoluteTolerance, double relativeTolerance)
 
oms_status_enu_t setFixedStepSize (double stepSize)
 
oms_status_enu_t setVariableStepSize (double initialStepSize, double minimumStepSize, double maximumStepSize)
 
double getMaximumStepSize ()
 
oms_solver_enu_t getSolver ()
 
AlgLoopgetAlgLoop (const int systemNumber)
 
oms_status_enu_t addAlgLoop (oms_ssc_t SCC, const int algLoopNum)
 
oms_status_enu_t updateAlgebraicLoops (const std::vector< oms_ssc_t > &sortedConnections)
 
oms_status_enu_t solveAlgLoop (DirectedGraph &graph, int loopNumber)
 
bool useThreadPool ()
 
ctpl::thread_pool & getThreadPool ()
 
std::string getUniqueID () const
 

Static Public Member Functions

static SystemNewSystem (const ComRef &cref, Model *parentModel, System *parentSystem)
 
- Static Public Member Functions inherited from oms::System
static SystemNewSystem (const ComRef &cref, oms_system_enu_t type, Model *parentModel, System *parentSystem)
 

Protected Member Functions

 SystemWC (const ComRef &cref, Model *parentModel, System *parentSystem)
 
 SystemWC (SystemWC const &copy)
 not implemented More...
 
SystemWCoperator= (SystemWC const &copy)
 not implemented More...
 
- Protected Member Functions inherited from oms::System
 System (const ComRef &cref, oms_system_enu_t type, Model *parentModel, System *parentSystem, oms_solver_enu_t solverMethod)
 
 System (System const &copy)
 not implemented More...
 
Systemoperator= (System const &copy)
 not implemented More...
 

Private Attributes

StepSizeConfiguration stepSizeConfiguration
 Configuration data structure for assc. More...
 
unsigned int h_id
 
unsigned int roll_iter_id
 
unsigned int max_error_id
 
unsigned int error_id
 
double stepSize = 1e-4
 
double maxError = 0.0
 
double normError = 0.0
 
unsigned int rollBackIt = 0
 

Additional Inherited Members

- Public Attributes inherited from oms::System
std::map< std::string, std::string > startValuesFileSources
 ssvFileSource mapped with ssmFilesource if mapping is provided, otherwise only ssvFilesource entry is made More...
 
- Protected Attributes inherited from oms::System
double time
 
DirectedGraph initializationGraph
 dependency graph, with all connections, solved at initialization More...
 
DirectedGraph eventGraph
 filtered dependency graph, without parameters, solved at event mode More...
 
DirectedGraph simulationGraph
 filtered dependency graph, with connections of type Real, solved at continuous time mode; More...
 
Clock clock
 
unsigned int clock_id
 
oms_solver_enu_t solverMethod = oms_solver_none
 
double absoluteTolerance = 1e-4
 
double relativeTolerance = 1e-4
 
double minimumStepSize = 1e-4
 
double maximumStepSize = 1e-1
 
double initialStepSize = 1e-4
 
std::unordered_map< unsigned int, unsigned int > resultFileMapping
 
std::unordered_map< ComRef, bool > exportConnectors
 
bool loopsNeedUpdate = true
 

Constructor & Destructor Documentation

◆ ~SystemWC()

oms::SystemWC::~SystemWC ( )

◆ SystemWC() [1/2]

oms::SystemWC::SystemWC ( const ComRef cref,
Model parentModel,
System parentSystem 
)
protected
Here is the caller graph for this function:

◆ SystemWC() [2/2]

oms::SystemWC::SystemWC ( SystemWC const &  copy)
protected

not implemented

Member Function Documentation

◆ addDynamicValueIndicator()

oms_status_enu_t oms::SystemWC::addDynamicValueIndicator ( const ComRef signal,
const ComRef lower,
const ComRef upper,
double  stepSize 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addEventIndicator()

oms_status_enu_t oms::SystemWC::addEventIndicator ( const ComRef signal)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addStaticValueIndicator()

oms_status_enu_t oms::SystemWC::addStaticValueIndicator ( const ComRef signal,
double  lowerBound,
double  upperBound,
double  stepSize 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addTimeIndicator()

oms_status_enu_t oms::SystemWC::addTimeIndicator ( const ComRef signal)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportToSSD_SimulationInformation()

oms_status_enu_t oms::SystemWC::exportToSSD_SimulationInformation ( pugi::xml_node &  node) const
virtual

Implements oms::System.

Here is the call graph for this function:

◆ getInputAndOutput()

oms_status_enu_t oms::SystemWC::getInputAndOutput ( oms::DirectedGraph graph,
std::vector< double > &  inputVect,
std::vector< double > &  outputVect,
std::map< ComRef, Component *>  FMUcomponents 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInputs()

oms_status_enu_t oms::SystemWC::getInputs ( oms::DirectedGraph graph,
std::vector< double > &  inputs 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMaxOutputDerivativeOrder()

unsigned int oms::SystemWC::getMaxOutputDerivativeOrder ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRealOutputDerivative()

oms_status_enu_t oms::SystemWC::getRealOutputDerivative ( const ComRef cref,
SignalDerivative der 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSolverName()

std::string oms::SystemWC::getSolverName ( ) const
Here is the caller graph for this function:

◆ importFromSSD_SimulationInformation()

oms_status_enu_t oms::SystemWC::importFromSSD_SimulationInformation ( const pugi::xml_node &  node,
const std::string &  sspVersion 
)
virtual

Implements oms::System.

Here is the call graph for this function:

◆ initialize()

oms_status_enu_t oms::SystemWC::initialize ( )
virtual

Implements oms::System.

Here is the call graph for this function:

◆ instantiate()

oms_status_enu_t oms::SystemWC::instantiate ( )
virtual

Implements oms::System.

Here is the call graph for this function:

◆ NewSystem()

oms::System * oms::SystemWC::NewSystem ( const ComRef cref,
oms::Model parentModel,
oms::System parentSystem 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

SystemWC& oms::SystemWC::operator= ( SystemWC const &  copy)
protected

not implemented

Here is the caller graph for this function:

◆ registerSignalsForResultFile()

oms_status_enu_t oms::SystemWC::registerSignalsForResultFile ( ResultWriter resultFile)
virtual

Reimplemented from oms::System.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

oms_status_enu_t oms::SystemWC::reset ( )
virtual

Implements oms::System.

Here is the call graph for this function:

◆ setInputsDer()

oms_status_enu_t oms::SystemWC::setInputsDer ( oms::DirectedGraph graph,
const std::vector< double > &  inputsDer 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRealInputDerivative()

oms_status_enu_t oms::SystemWC::setRealInputDerivative ( const ComRef cref,
const SignalDerivative der 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSolver()

oms_status_enu_t oms::SystemWC::setSolver ( oms_solver_enu_t  solver)
inlinevirtual

Reimplemented from oms::System.

Here is the call graph for this function:

◆ setSolverMethod()

oms_status_enu_t oms::SystemWC::setSolverMethod ( std::string  solver)
Here is the caller graph for this function:

◆ stepUntil()

oms_status_enu_t oms::SystemWC::stepUntil ( double  stopTime,
void(*)(const char *ident, double time, oms_status_enu_t status)  cb 
)
virtual

Implements oms::System.

Here is the call graph for this function:

◆ stepUntilASSC()

oms_status_enu_t oms::SystemWC::stepUntilASSC ( double  stopTime,
void(*)(const char *ident, double time, oms_status_enu_t status)  cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ terminate()

oms_status_enu_t oms::SystemWC::terminate ( )
virtual

Implements oms::System.

Here is the call graph for this function:

◆ updateInputs()

oms_status_enu_t oms::SystemWC::updateInputs ( oms::DirectedGraph graph)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateSignals()

oms_status_enu_t oms::SystemWC::updateSignals ( ResultWriter resultFile)
virtual

Reimplemented from oms::System.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ error_id

unsigned int oms::SystemWC::error_id
private

◆ h_id

unsigned int oms::SystemWC::h_id
private

◆ max_error_id

unsigned int oms::SystemWC::max_error_id
private

◆ maxError

double oms::SystemWC::maxError = 0.0
private

◆ normError

double oms::SystemWC::normError = 0.0
private

◆ roll_iter_id

unsigned int oms::SystemWC::roll_iter_id
private

◆ rollBackIt

unsigned int oms::SystemWC::rollBackIt = 0
private

◆ stepSize

double oms::SystemWC::stepSize = 1e-4
private

◆ stepSizeConfiguration

StepSizeConfiguration oms::SystemWC::stepSizeConfiguration
private

Configuration data structure for assc.


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