OMSimulatorLib The OMSimulator project is a FMI-based co-simulation environment.

Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
oms::SystemSC Class Reference

`#include <SystemSC.h>`

Inheritance diagram for oms::SystemSC:
[legend]
Collaboration diagram for oms::SystemSC:
[legend]

## Classes
union | SolverData_t
struct | SolverDataCVODE_t
struct | SolverDataEuler_t

## Public Member Functions
| ~SystemSC ()
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 | doStep ()
oms_status_enu_t | stepUntil (double stopTime)
oms_status_enu_t | updateInputs (DirectedGraph &graph)
std::string | getSolverName () const
oms_status_enu_t | setSolverMethod (std::string)
oms_status_enu_t | setSolver (oms_solver_enu_t solver)
Public Member Functions inherited from oms::System
virtual | ~System ()
virtual oms_status_enu_t | registerSignalsForResultFile (ResultWriter &resultFile)
virtual oms_status_enu_t | updateSignals (ResultWriter &resultFile)
const ComRef & | getCref () const
ComRef | getFullCref () const
System * | getSystem (const ComRef &cref)
Component * | getComponent (const ComRef &cref)
Variable * | getVariable (const ComRef &cref)
Element * | getElement ()
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)
oms_status_enu_t | setExportName (const ComRef &cref, const std::string &exportName)
oms_status_enu_t | setAliasName (const ComRef &cref, const std::string &aliasName)
oms_status_enu_t | replaceSubModel (const ComRef &cref, const std::string &fmuPath, bool dryRun, int &warningCount)
bool | isValidScalarVariable (Component *referenceComponent, Component *replacingComponent, Connection *connection, const ComRef &crefA, const ComRef &crefB, const ComRef &signalName, const std::string &path, std::vector< std::string > &warningList)
bool | validCref (const ComRef &cref)
oms_status_enu_t | exportToSSD (pugi::xml_node &node, Snapshot &snapshot, std::string variantName) const
oms_status_enu_t | exportToSSV (Snapshot &snapshot) const
oms_status_enu_t | importFromSnapshot (const pugi::xml_node &node, const std::string &sspVersion, const Snapshot &snapshot, std::string variantName)
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)
Connector * | getConnector (const ComRef &cref)
std::string | getConnectorOwner (const ComRef &cref) const
Connector ** | getConnectors ()
BusConnector * | getBusConnector (const ComRef &cref)
Connection * | getConnection (const ComRef &crefA, const ComRef &crefB)
Connection ** | getConnections (const ComRef &cref)
oms_status_enu_t | addConnection (const ComRef &crefA, const ComRef &crefB, bool suppressUnitConversion=false)
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 | setConnectorNumericType (const ComRef &cref, const oms_signal_numeric_type_enu_t numericType)
oms_status_enu_t | setConnectionLinearTransformation (const oms::ComRef &crefA, const oms::ComRef &crefB, double factor, double offset)
oms_status_enu_t | addBus (const ComRef &cref)
oms_status_enu_t | newResources (const ComRef &cref, const std::string &ssvFilename, const std::string &ssmFilename="", bool externalresources=false)
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 | delete_ (const ComRef &cref)
oms_status_enu_t | deleteAllConectionsTo (const ComRef &cref)
oms_status_enu_t | deleteReferencesInSSD (const ComRef &cref, const std::string &filename)
oms_status_enu_t | deleteResourcesInSSP (const std::string &filename)
bool | isConnected (const ComRef &cref) const
Model & | getModel ()
System * | getParentSystem () const
bool | copyResources ()
void | getAllResources (std::vector< std::string > &resources) const
std::map< ComRef, System * > & | getSubSystems ()
std::map< ComRef, Component * > & | getComponents ()
std::vector< Connection * > & | getConnections ()
oms_status_enu_t | updateDependencyGraphs ()
const DirectedGraph & | getInitialUnknownsGraph ()
const DirectedGraph & | getOutputsGraph ()
oms_status_enu_t | exportDependencyGraphs (const std::string &pathInitialization, const std::string &pathEvent, const std::string &pathSimulation)
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 | getString (const ComRef &cref, std::string &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 | setString (const ComRef &cref, const std::string &value)
oms_status_enu_t | setUnit (const ComRef &cref, const std::string &value)
oms_status_enu_t | getVariableType (const ComRef &cref, oms_signal_type_enu_t &type)
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)
oms_status_enu_t | getDirectionalDerivative (const ComRef &unknownCref, const ComRef &knownCref, double &value)
oms_status_enu_t | getState (const ComRef &cref)
oms_status_enu_t | setState (const ComRef &cref)
oms_status_enu_t | freeState (const ComRef &cref)
oms_status_enu_t | rename (const ComRef &newCref)
| rename the system itself
oms_status_enu_t | rename (const ComRef &cref, const ComRef &newCref)
| rename any component within the system
oms_status_enu_t | renameConnections (const ComRef &cref, const ComRef &newCref)
oms_status_enu_t | renameConnectors ()
bool | isTopLevelSystem () const
oms_status_enu_t | addSignalsToResults (const char *regex)
oms_status_enu_t | removeSignalsFromResults (const char *regex)
void | getTolerance (double *relativeTolerance) const
void | getStepSize (double *initialStepSize, double *minimumStepSize, double *maximumStepSize) const
oms_status_enu_t | setTolerance (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 ()
AlgLoop * | getAlgLoop (const int systemNumber)
oms_status_enu_t | addAlgLoop (scc_t SCC, const int algLoopNum, DirectedGraph &graph, bool supportsDirectionalDerivatives)
oms_status_enu_t | updateAlgebraicLoops (const std::vector< scc_t > &sortedConnections, DirectedGraph &graph)
oms_status_enu_t | solveAlgLoop (DirectedGraph &graph, int loopNumber)
bool | useThreadPool ()
ctpl::thread_pool & | getThreadPool ()
std::string | getUniqueID () const
void | forceLoopsToBeUpdated ()
void | getFilteredSignals (std::vector< Connector > &filteredSignals) const
bool | supportsDirectionalDerivatives (int i, DirectedGraph &graph)
| returns true if all FMUs support providesDirectionalDerivative
Values & | getValues ()

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

## Protected Member Functions
| SystemSC (const ComRef &cref, Model *parentModel, System *parentSystem)
| SystemSC (SystemSC const &copy)
| not implemented
SystemSC & | operator= (SystemSC const &copy)
| not implemented
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
System & | operator= (System const &copy)
| not implemented

## Private Member Functions
oms_status_enu_t | doStepEuler ()
oms_status_enu_t | doStepCVODE ()

## Private Attributes
std::vector< Component * > | fmus
std::unique_ptr< bool[]> | callEventUpdate
std::unique_ptr< bool[]> | terminateSimulation
std::vector< size_t > | nStates
std::vector< size_t > | nEventIndicators
std::vector< double * > | states
std::vector< double * > | states_der
std::vector< double * > | states_nominal
std::vector< double * > | event_indicators
std::vector< double * > | event_indicators_prev
bool | algebraic = false
union oms::SystemSC::SolverData_t | solverData

## Friends
int | oms::cvode_rhs (sunrealtype t, N_Vector y, N_Vector ydot, void *user_data)
int | oms::cvode_rhs_algebraic (sunrealtype t, N_Vector y, N_Vector ydot, void *user_data)
int | oms::cvode_roots (sunrealtype t, N_Vector y, sunrealtype *gout, void *user_data)

## Additional Inherited Members
Public Attributes inherited from oms::System
std::map< std::string, filesystem::path > | fmuGuid
Protected Attributes inherited from oms::System
double | time
DirectedGraph | initializationGraph
| dependency graph, with all connections, solved at initialization
DirectedGraph | eventGraph
| filtered dependency graph, without parameters, solved at event mode
DirectedGraph | simulationGraph
| filtered dependency graph, with connections of type Real, solved at continuous time mode;
Clock | clock
unsigned int | clock_id
oms_solver_enu_t | solverMethod = oms_solver_none
double | relativeTolerance = 1e-4
double | minimumStepSize
double | maximumStepSize
double | initialStepSize
std::unordered_map< unsigned int, unsigned int > | resultFileMapping
std::unordered_map< ComRef, bool > | exportConnectors

## Constructor & Destructor Documentation

## ◆ ~SystemSC()

oms::SystemSC::~SystemSC | ( |  | ) |

## ◆ SystemSC() [1/2]

oms::SystemSC::SystemSC | ( | const ComRef & | cref,
|  | Model * | parentModel,
|  | System * | parentSystem
| ) |  |
| protected

## ◆ SystemSC() [2/2]

oms::SystemSC::SystemSC | ( | SystemSC const & | copy | ) |
| protected

not implemented

## Member Function Documentation

## ◆ doStep()

oms_status_enu_t oms::SystemSC::doStep | ( |  | ) |
| virtual

Implements oms::System.

## ◆ doStepCVODE()

oms_status_enu_t oms::SystemSC::doStepCVODE | ( |  | ) |
| private

## ◆ doStepEuler()

oms_status_enu_t oms::SystemSC::doStepEuler | ( |  | ) |
| private

## ◆ exportToSSD_SimulationInformation()

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

Implements oms::System.

## ◆ getSolverName()

std::string oms::SystemSC::getSolverName | ( |  | ) | const

## ◆ importFromSSD_SimulationInformation()

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

Implements oms::System.

## ◆ initialize()

oms_status_enu_t oms::SystemSC::initialize | ( |  | ) |
| virtual

Implements oms::System.

Here is the call graph for this function:

## ◆ instantiate()

oms_status_enu_t oms::SystemSC::instantiate | ( |  | ) |
| virtual

Implements oms::System.

## ◆ NewSystem()

oms::System * oms::SystemSC::NewSystem | ( | const oms::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=()

SystemSC & oms::SystemSC::operator= | ( | SystemSC const & | copy | ) |
| protected

not implemented

## ◆ reset()

oms_status_enu_t oms::SystemSC::reset | ( |  | ) |
| virtual

Implements oms::System.

## ◆ setSolver()

oms_status_enu_t oms::SystemSC::setSolver | ( | oms_solver_enu_t | solver | ) |
| inline virtual

Reimplemented from oms::System.

## ◆ setSolverMethod()

oms_status_enu_t oms::SystemSC::setSolverMethod | ( | std::string | solver | ) |

## ◆ stepUntil()

oms_status_enu_t oms::SystemSC::stepUntil | ( | double | stopTime | ) |
| virtual

Implements oms::System.

Here is the call graph for this function:

## ◆ terminate()

oms_status_enu_t oms::SystemSC::terminate | ( |  | ) |
| virtual

Implements oms::System.

## ◆ updateInputs()

oms_status_enu_t oms::SystemSC::updateInputs | ( | DirectedGraph & | graph | ) |

Here is the call graph for this function:

## Friends And Related Symbol Documentation

## ◆ oms::cvode_rhs

int oms::cvode_rhs | ( | sunrealtype | t,
|  | N_Vector | y,
|  | N_Vector | ydot,
|  | void * | user_data
| ) |  |
| friend

## ◆ oms::cvode_rhs_algebraic

int oms::cvode_rhs_algebraic | ( | sunrealtype | t,
|  | N_Vector | y,
|  | N_Vector | ydot,
|  | void * | user_data
| ) |  |
| friend

## ◆ oms::cvode_roots

int oms::cvode_roots | ( | sunrealtype | t,
|  | N_Vector | y,
|  | sunrealtype * | gout,
|  | void * | user_data
| ) |  |
| friend

## Member Data Documentation

## ◆ algebraic

bool oms::SystemSC::algebraic = false
| private

## ◆ callEventUpdate

std::unique_ptr<bool[]> oms::SystemSC::callEventUpdate
| private

## ◆ event_indicators

std::vector<double*> oms::SystemSC::event_indicators
| private

## ◆ event_indicators_prev

std::vector<double*> oms::SystemSC::event_indicators_prev
| private

## ◆ fmus

std::vector<Component*> oms::SystemSC::fmus
| private

## ◆ nEventIndicators

std::vector<size_t> oms::SystemSC::nEventIndicators
| private

## ◆ nStates

std::vector<size_t> oms::SystemSC::nStates
| private

## ◆ solverData

union oms::SystemSC::SolverData_t oms::SystemSC::solverData
| private

## ◆ states

std::vector<double*> oms::SystemSC::states
| private

## ◆ states_der

std::vector<double*> oms::SystemSC::states_der
| private

## ◆ states_nominal

std::vector<double*> oms::SystemSC::states_nominal
| private

## ◆ terminateSimulation

std::unique_ptr<bool[]> oms::SystemSC::terminateSimulation
| private

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

- /var/lib/jenkins1/ws/OMSimulator_PR-1619/src/OMSimulatorLib/SystemSC.h
- /var/lib/jenkins1/ws/OMSimulator_PR-1619/src/OMSimulatorLib/SystemSC.cpp