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

Loading...
Searching...
No Matches
System.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenModelica.
3 *
4 * Copyright (c) 1998-2026, Open Source Modelica Consortium (OSMC),
5 * c/o Linköpings universitet, Department of Computer and Information Science,
6 * SE-58183 Linköping, Sweden.
7 *
8 * All rights reserved.
9 *
10 * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF AGPL VERSION 3 LICENSE OR
11 * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.8.
12 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
13 * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GNU AGPL
14 * VERSION 3, ACCORDING TO RECIPIENTS CHOICE.
15 *
16 * The OpenModelica software and the OSMC (Open Source Modelica Consortium)
17 * Public License (OSMC-PL) are obtained from OSMC, either from the above
18 * address, from the URLs:
19 * http://www.openmodelica.org or
20 * https://github.com/OpenModelica/ or
21 * http://www.ida.liu.se/projects/OpenModelica,
22 * and in the OpenModelica distribution.
23 *
24 * GNU AGPL version 3 is obtained from:
25 * https://www.gnu.org/licenses/licenses.html#GPL
26 *
27 * This program is distributed WITHOUT ANY WARRANTY; without
28 * even the implied warranty of MERCHANTABILITY or FITNESS
29 * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
30 * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
31 *
32 * See the full OSMC Public License conditions for more details.
33 *
34 */
35
36#ifndef _OMS_SYSTEM_H_
37#define _OMS_SYSTEM_H_
38
39#include "AlgLoop.h"
40#include "BusConnector.h"
41#include "Clock.h"
42#include "ComRef.h"
43#include "Connection.h"
44#include "DirectedGraph.h"
45#include "Element.h"
46#include "ResultWriter.h"
47#include "Snapshot.h"
48#include "ssd/ConnectorGeometry.h"
49#include "OMSimulator/Types.h"
50#include "Values.h"
51
52#include <map>
53#include <pugixml.hpp>
54#include <unordered_map>
55
56#include <ctpl_stl.h>
57
58 namespace oms
59{
60 class AlgLoop;
61 class Component;
62 class Model;
63 class Variable;
64
65 class System
66 {
67 public: // methods
68 virtual ~System();
69
70 virtual oms_status_enu_t exportToSSD_SimulationInformation(pugi::xml_node& node) const = 0;
71 virtual oms_status_enu_t importFromSSD_SimulationInformation(const pugi::xml_node& node, const std::string& sspVersion) = 0;
72 virtual oms_status_enu_t registerSignalsForResultFile(ResultWriter& resultFile);
73 virtual oms_status_enu_t updateSignals(ResultWriter& resultFile);
74 virtual oms_status_enu_t setSolver(oms_solver_enu_t solver) {return oms_status_error;}
75 virtual oms_status_enu_t instantiate() = 0;
76 virtual oms_status_enu_t initialize() = 0;
77 virtual oms_status_enu_t terminate() = 0;
78 virtual oms_status_enu_t reset() = 0;
79 virtual oms_status_enu_t doStep() = 0;
80 virtual oms_status_enu_t stepUntil(double stopTime) = 0;
81
82 static System* NewSystem(const ComRef& cref, oms_system_enu_t type, Model* parentModel, System* parentSystem);
83
84 const ComRef& getCref() const {return cref;}
85 ComRef getFullCref() const;
86 System* getSystem(const ComRef& cref);
87 Component* getComponent(const ComRef& cref);
88 Variable* getVariable(const ComRef& cref);
89 Element* getElement() {return &element;}
90 oms_status_enu_t listUnconnectedConnectors(char** contents) const;
91 oms_system_enu_t getType() const {return type;}
92 oms_status_enu_t addSubSystem(const ComRef& cref, oms_system_enu_t type);
93 oms_status_enu_t addSubModel(const ComRef& cref, const std::string& fmuPath);
94 oms_status_enu_t setExportName(const ComRef& cref, const std::string& exportName);
95 oms_status_enu_t setAliasName(const ComRef& cref, const std::string& aliasName);
96 oms_status_enu_t replaceSubModel(const ComRef& cref, const std::string& fmuPath, bool dryRun, int& warningCount);
97 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);
98 bool validCref(const ComRef& cref);
99 oms_status_enu_t exportToSSD(pugi::xml_node& node, Snapshot& snapshot, std::string variantName) const;
100 oms_status_enu_t exportToSSV(Snapshot& snapshot) const;
101 oms_status_enu_t importFromSnapshot(const pugi::xml_node& node, const std::string& sspVersion, const Snapshot& snapshot, std::string variantName);
102 void setGeometry(const ssd::ElementGeometry& geometry) {element.setGeometry(&geometry);}
103 oms_status_enu_t addConnector(const ComRef& cref, oms_causality_enu_t causality, oms_signal_type_enu_t type);
104 Connector* getConnector(const ComRef& cref);
105 std::string getConnectorOwner(const ComRef& cref) const;
106 Connector** getConnectors() {return &connectors[0];}
107 BusConnector* getBusConnector(const ComRef& cref);
108 Connection* getConnection(const ComRef& crefA, const ComRef& crefB);
109 Connection** getConnections(const ComRef &cref);
110 oms_status_enu_t addConnection(const ComRef& crefA, const ComRef& crefB, bool suppressUnitConversion = false);
111 oms_status_enu_t deleteConnection(const ComRef& crefA, const ComRef& crefB);
112 oms_status_enu_t setConnectorGeometry(const ComRef& cref, const oms::ssd::ConnectorGeometry* geometry);
113 oms_status_enu_t setConnectionGeometry(const ComRef &crefA, const ComRef &crefB, const oms::ssd::ConnectionGeometry* geometry);
114 oms_status_enu_t setConnectorNumericType(const ComRef& cref, const oms_signal_numeric_type_enu_t numericType);
115 oms_status_enu_t setConnectionLinearTransformation(const oms::ComRef& crefA, const oms::ComRef& crefB, double factor, double offset);
116 oms_status_enu_t addBus(const ComRef& cref);
117 oms_status_enu_t newResources(const ComRef& cref, const std::string& ssvFilename, const std::string& ssmFilename = "", bool externalresources = false);
118 oms_status_enu_t addConnectorToBus(const ComRef& busCref, const ComRef& connectorCref);
119 oms_status_enu_t deleteConnectorFromBus(const ComRef& busCref, const ComRef& connectorCref);
120 oms_status_enu_t setBusGeometry(const ComRef& cref, const oms::ssd::ConnectorGeometry* geometry);
121 oms_status_enu_t delete_(const ComRef& cref);
122 oms_status_enu_t deleteAllConectionsTo(const ComRef& cref);
123 oms_status_enu_t deleteReferencesInSSD(const ComRef& cref, const std::string& filename);
124 oms_status_enu_t deleteResourcesInSSP(const std::string& filename);
125
126 bool isConnected(const ComRef& cref) const;
127 Model& getModel();
128 System* getParentSystem() const {return parentSystem;}
129 bool copyResources();
130 void getAllResources(std::vector<std::string>& resources) const;
131 std::map<ComRef, System*>& getSubSystems() {return subsystems;}
132 std::map<ComRef, Component*>& getComponents() {return components;}
133 std::vector<Connection*>& getConnections() {return connections;}
134 oms_status_enu_t updateDependencyGraphs();
135 const DirectedGraph& getInitialUnknownsGraph() {return initializationGraph;}
136 const DirectedGraph& getOutputsGraph() {return eventGraph;}
137 oms_status_enu_t exportDependencyGraphs(const std::string& pathInitialization, const std::string& pathEvent, const std::string& pathSimulation);
138
139 double getTime() const {return time;}
140
141 oms_status_enu_t getBoolean(const ComRef& cref, bool& value);
142 oms_status_enu_t getInteger(const ComRef& cref, int& value);
143 oms_status_enu_t getReal(const ComRef& cref, double& value);
144 oms_status_enu_t getString(const ComRef& cref, std::string& value);
145 oms_status_enu_t setBoolean(const ComRef& cref, bool value);
146 oms_status_enu_t setInteger(const ComRef& cref, int value);
147 oms_status_enu_t setReal(const ComRef& cref, double value);
148 oms_status_enu_t setString(const ComRef& cref, const std::string& value);
149 oms_status_enu_t setUnit(const ComRef& cref, const std::string& value);
150 oms_status_enu_t getVariableType(const ComRef& cref, oms_signal_type_enu_t& type);
151
152 oms_status_enu_t getReals(const std::vector<ComRef> &crefs, std::vector<double> &values);
153 oms_status_enu_t setReals(const std::vector<ComRef> &crefs, std::vector<double> values);
154 oms_status_enu_t setRealInputDerivatives(const ComRef &cref, int order, double value);
155
156 oms_status_enu_t getDirectionalDerivative(const ComRef& unknownCref, const ComRef& knownCref, double& value);
157
158 oms_status_enu_t getState(const ComRef& cref);
159 oms_status_enu_t setState(const ComRef& cref);
160 oms_status_enu_t freeState(const ComRef& cref);
161
162 oms_status_enu_t rename(const ComRef& newCref);
163 oms_status_enu_t rename(const ComRef& cref, const ComRef& newCref);
164 oms_status_enu_t renameConnections(const ComRef& cref, const ComRef& newCref);
165 oms_status_enu_t renameConnectors();
166
167 bool isTopLevelSystem() const {return (parentSystem == NULL);}
168
169 oms_status_enu_t addSignalsToResults(const char* regex);
170 oms_status_enu_t removeSignalsFromResults(const char* regex);
171
172 void getTolerance(double* relativeTolerance) const {if (relativeTolerance) *relativeTolerance=this->relativeTolerance;}
173 void getStepSize(double* initialStepSize, double* minimumStepSize, double* maximumStepSize) const {if (initialStepSize) *initialStepSize=this->initialStepSize; if (minimumStepSize) *minimumStepSize=this->minimumStepSize; if (maximumStepSize) *maximumStepSize=this->maximumStepSize;}
174 oms_status_enu_t setTolerance(double relativeTolerance) {this->relativeTolerance=relativeTolerance; return oms_status_ok;}
175 oms_status_enu_t setFixedStepSize(double stepSize) {this->minimumStepSize=this->maximumStepSize=this->initialStepSize=stepSize; return oms_status_ok;}
176 oms_status_enu_t setVariableStepSize(double initialStepSize, double minimumStepSize, double maximumStepSize) {this->minimumStepSize=minimumStepSize; this->maximumStepSize=maximumStepSize; this->initialStepSize=initialStepSize; return oms_status_ok;}
177 double getMaximumStepSize() {return maximumStepSize;}
178 oms_solver_enu_t getSolver() {return solverMethod;}
179
180 AlgLoop* getAlgLoop(const int systemNumber);
181 oms_status_enu_t addAlgLoop(scc_t SCC, const int algLoopNum, DirectedGraph& graph, bool supportsDirectionalDerivatives);
182 oms_status_enu_t updateAlgebraicLoops(const std::vector< scc_t >& sortedConnections, DirectedGraph& graph);
183 oms_status_enu_t solveAlgLoop(DirectedGraph& graph, int loopNumber);
184
185 bool useThreadPool();
186 ctpl::thread_pool& getThreadPool();
187
188 std::string getUniqueID() const;
189
190 void forceLoopsToBeUpdated() {loopsNeedUpdate = true;}
191
192 void getFilteredSignals(std::vector<Connector>& filteredSignals) const;
193
194 bool supportsDirectionalDerivatives(int i, DirectedGraph& graph);
195
196 Values& getValues() { return values; }
197 std::map<std::string, filesystem::path> fmuGuid;
198
199 protected: // methods
200 System(const ComRef& cref, oms_system_enu_t type, Model* parentModel, System* parentSystem, oms_solver_enu_t solverMethod);
201
202 // stop the compiler generating methods copying the object
203 System(System const& copy);
204 System& operator=(System const& copy);
205
206 private: // methods
207 oms_status_enu_t importFromSSD_ConnectionGeometry(const pugi::xml_node& node, const ComRef& crefA, const ComRef& crefB);
208 oms_status_enu_t importBusConnectorSignals(const pugi::xml_node& node);
209 oms_status_enu_t importBusConnectorGeometry(const pugi::xml_node& node);
210
211 protected: // attributes
212 double time;
213
214 DirectedGraph initializationGraph;
215 DirectedGraph eventGraph;
216 DirectedGraph simulationGraph;
217
218 Clock clock;
219 unsigned int clock_id;
220
221 oms_solver_enu_t solverMethod = oms_solver_none;
222
223 double relativeTolerance = 1e-4;
224 double minimumStepSize;
225 double maximumStepSize;
226 double initialStepSize;
227
228 std::unordered_map<unsigned int /*result file var ID*/, unsigned int /*allVariables ID*/> resultFileMapping;
229 std::unordered_map<ComRef, bool> exportConnectors;
230
231 private: // attributes
232 ComRef cref;
233 oms_system_enu_t type;
234 Model* parentModel;
235 System* parentSystem;
236 std::map<ComRef, System*> subsystems;
237 std::map<ComRef, Component*> components;
238 std::string exportName;
239
240 Values values;
241
242 Element element;
243 std::vector<Connector*> connectors;
244 std::vector<oms_element_t*> subelements;
245 std::vector<BusConnector*> busconnectors;
246 std::vector<Connection*> connections;
247
248 bool loopsNeedUpdate = true;
249 std::vector<AlgLoop> algLoops;
250 std::string getFmiVersion(const std::string& path);
251 };
252}
253
254#endif
AlgLoop.h
BusConnector.h
Clock.h
ComRef.h
Connection.h
ConnectorGeometry.h
DirectedGraph.h
Element.h
ResultWriter.h
Snapshot.h
Values.h
Clock
Definition Clock.h:43
oms::AlgLoop
Definition AlgLoop.h:95
oms::BusConnector
BusConnector.
Definition BusConnector.h:56
oms::ComRef
ComRef - component reference.
Definition ComRef.h:51
oms::Component
Definition Component.h:65
oms::Connection
**
Definition Connection.h:52
oms::Connector
Connector.
Definition Connector.h:54
oms::DirectedGraph
Definition DirectedGraph.h:71
oms::Element
Element.
Definition Element.h:51
oms::Element::setGeometry
void setGeometry(const oms::ssd::ElementGeometry *newGeometry)
Definition Element.cpp:70
oms::Model
Definition Model.h:57
oms::ResultWriter
Definition ResultWriter.h:73
oms::Snapshot
Definition Snapshot.h:51
oms::System
Definition System.h:66
oms::System::getConnection
Connection * getConnection(const ComRef &crefA, const ComRef &crefB)
Definition System.cpp:1474
oms::System::setFixedStepSize
oms_status_enu_t setFixedStepSize(double stepSize)
Definition System.h:175
oms::System::algLoops
std::vector< AlgLoop > algLoops
vector of algebraic loop objects
Definition System.h:249
oms::System::solveAlgLoop
oms_status_enu_t solveAlgLoop(DirectedGraph &graph, int loopNumber)
Definition System.cpp:2686
oms::System::getModel
Model & getModel()
Definition System.cpp:1482
oms::System::setExportName
oms_status_enu_t setExportName(const ComRef &cref, const std::string &exportName)
Definition System.cpp:349
oms::System::setTolerance
oms_status_enu_t setTolerance(double relativeTolerance)
Definition System.h:174
oms::System::initialStepSize
double initialStepSize
Definition System.h:226
oms::System::fmuGuid
std::map< std::string, filesystem::path > fmuGuid
Definition System.h:197
oms::System::initializationGraph
DirectedGraph initializationGraph
dependency graph, with all connections, solved at initialization
Definition System.h:214
oms::System::addSubModel
oms_status_enu_t addSubModel(const ComRef &cref, const std::string &fmuPath)
Definition System.cpp:293
oms::System::setSolver
virtual oms_status_enu_t setSolver(oms_solver_enu_t solver)
Definition System.h:74
oms::System::getFilteredSignals
void getFilteredSignals(std::vector< Connector > &filteredSignals) const
Definition System.cpp:1660
oms::System::setConnectorGeometry
oms_status_enu_t setConnectorGeometry(const ComRef &cref, const oms::ssd::ConnectorGeometry *geometry)
Definition System.cpp:1341
oms::System::updateAlgebraicLoops
oms_status_enu_t updateAlgebraicLoops(const std::vector< scc_t > &sortedConnections, DirectedGraph &graph)
Definition System.cpp:2665
oms::System::getReals
oms_status_enu_t getReals(const std::vector< ComRef > &crefs, std::vector< double > &values)
Definition System.cpp:2351
oms::System::reset
virtual oms_status_enu_t reset()=0
oms::System::delete_
oms_status_enu_t delete_(const ComRef &cref)
Definition System.cpp:1515
oms::System::cref
ComRef cref
Definition System.h:232
oms::System::System
System(System const &copy)
not implemented
oms::System::deleteAllConectionsTo
oms_status_enu_t deleteAllConectionsTo(const ComRef &cref)
Definition System.cpp:1489
oms::System::getVariable
Variable * getVariable(const ComRef &cref)
Definition System.cpp:220
oms::System::setRealInputDerivatives
oms_status_enu_t setRealInputDerivatives(const ComRef &cref, int order, double value)
Definition System.cpp:2373
oms::System::freeState
oms_status_enu_t freeState(const ComRef &cref)
Definition System.cpp:2099
oms::System::getBusConnector
BusConnector * getBusConnector(const ComRef &cref)
Definition System.cpp:1117
oms::System::getSystem
System * getSystem(const ComRef &cref)
Definition System.cpp:164
oms::System::resultFileMapping
std::unordered_map< unsigned int, unsigned int > resultFileMapping
Definition System.h:228
oms::System::renameConnectors
oms_status_enu_t renameConnectors()
Definition System.cpp:2766
oms::System::setBusGeometry
oms_status_enu_t setBusGeometry(const ComRef &cref, const oms::ssd::ConnectorGeometry *geometry)
Definition System.cpp:1457
oms::System::renameConnections
oms_status_enu_t renameConnections(const ComRef &cref, const ComRef &newCref)
Definition System.cpp:2756
oms::System::addSignalsToResults
oms_status_enu_t addSignalsToResults(const char *regex)
Definition System.cpp:2496
oms::System::connections
std::vector< Connection * > connections
last element is always NULL
Definition System.h:246
oms::System::getAllResources
void getAllResources(std::vector< std::string > &resources) const
Definition System.cpp:1651
oms::System::getFmiVersion
std::string getFmiVersion(const std::string &path)
Definition System.cpp:377
oms::System::registerSignalsForResultFile
virtual oms_status_enu_t registerSignalsForResultFile(ResultWriter &resultFile)
Definition System.cpp:2398
oms::System::getReal
oms_status_enu_t getReal(const ComRef &cref, double &value)
Definition System.cpp:1903
oms::System::removeSignalsFromResults
oms_status_enu_t removeSignalsFromResults(const char *regex)
Definition System.cpp:2529
oms::System::getTolerance
void getTolerance(double *relativeTolerance) const
Definition System.h:172
oms::System::solverMethod
oms_solver_enu_t solverMethod
Definition System.h:221
oms::System::setBoolean
oms_status_enu_t setBoolean(const ComRef &cref, bool value)
Definition System.cpp:2123
oms::System::importFromSSD_ConnectionGeometry
oms_status_enu_t importFromSSD_ConnectionGeometry(const pugi::xml_node &node, const ComRef &crefA, const ComRef &crefB)
Definition System.cpp:2378
oms::System::getUniqueID
std::string getUniqueID() const
Definition System.cpp:2572
oms::System::values
Values values
system level connectors, parameters and their start values defined before instantiating the FMU and e...
Definition System.h:240
oms::System::setInteger
oms_status_enu_t setInteger(const ComRef &cref, int value)
Definition System.cpp:2170
oms::System::importBusConnectorGeometry
oms_status_enu_t importBusConnectorGeometry(const pugi::xml_node &node)
Definition System.cpp:2605
oms::System::setConnectorNumericType
oms_status_enu_t setConnectorNumericType(const ComRef &cref, const oms_signal_numeric_type_enu_t numericType)
Definition System.cpp:1372
oms::System::getOutputsGraph
const DirectedGraph & getOutputsGraph()
Definition System.h:136
oms::System::rename
oms_status_enu_t rename(const ComRef &newCref)
rename the system itself
Definition System.cpp:2691
oms::System::exportToSSD
oms_status_enu_t exportToSSD(pugi::xml_node &node, Snapshot &snapshot, std::string variantName) const
Definition System.cpp:724
oms::System::clock_id
unsigned int clock_id
Definition System.h:219
oms::System::getString
oms_status_enu_t getString(const ComRef &cref, std::string &value)
Definition System.cpp:1980
oms::System::deleteConnection
oms_status_enu_t deleteConnection(const ComRef &crefA, const ComRef &crefB)
Definition System.cpp:1235
oms::System::simulationGraph
DirectedGraph simulationGraph
filtered dependency graph, with connections of type Real, solved at continuous time mode;
Definition System.h:216
oms::System::maximumStepSize
double maximumStepSize
Definition System.h:225
oms::System::addConnection
oms_status_enu_t addConnection(const ComRef &crefA, const ComRef &crefB, bool suppressUnitConversion=false)
Definition System.cpp:1152
oms::System::isConnected
bool isConnected(const ComRef &cref) const
Definition System.cpp:1506
oms::System::supportsDirectionalDerivatives
bool supportsDirectionalDerivatives(int i, DirectedGraph &graph)
returns true if all FMUs support providesDirectionalDerivative
Definition System.cpp:2651
oms::System::exportName
std::string exportName
export name for top system and subsystem-level connector, used in the result file
Definition System.h:238
oms::System::setState
oms_status_enu_t setState(const ComRef &cref)
Definition System.cpp:2075
oms::System::getCref
const ComRef & getCref() const
Definition System.h:84
oms::System::components
std::map< ComRef, Component * > components
Definition System.h:237
oms::System::getAlgLoop
AlgLoop * getAlgLoop(const int systemNumber)
Definition System.cpp:2623
oms::System::setReals
oms_status_enu_t setReals(const std::vector< ComRef > &crefs, std::vector< double > values)
Definition System.cpp:2362
oms::System::instantiate
virtual oms_status_enu_t instantiate()=0
oms::System::getDirectionalDerivative
oms_status_enu_t getDirectionalDerivative(const ComRef &unknownCref, const ComRef &knownCref, double &value)
Definition System.cpp:2032
oms::System::subsystems
std::map< ComRef, System * > subsystems
Definition System.h:236
oms::System::updateDependencyGraphs
oms_status_enu_t updateDependencyGraphs()
Definition System.cpp:1685
oms::System::importFromSnapshot
oms_status_enu_t importFromSnapshot(const pugi::xml_node &node, const std::string &sspVersion, const Snapshot &snapshot, std::string variantName)
Definition System.cpp:834
oms::System::useThreadPool
bool useThreadPool()
Definition System.cpp:2562
oms::System::setAliasName
oms_status_enu_t setAliasName(const ComRef &cref, const std::string &aliasName)
Definition System.cpp:363
oms::System::setString
oms_status_enu_t setString(const ComRef &cref, const std::string &value)
Definition System.cpp:2267
oms::System::addBus
oms_status_enu_t addBus(const ComRef &cref)
Definition System.cpp:1268
oms::System::isValidScalarVariable
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)
Definition System.cpp:500
oms::System::getComponents
std::map< ComRef, Component * > & getComponents()
Definition System.h:132
oms::System::getVariableType
oms_status_enu_t getVariableType(const ComRef &cref, oms_signal_type_enu_t &type)
Definition System.cpp:196
oms::System::updateSignals
virtual oms_status_enu_t updateSignals(ResultWriter &resultFile)
Definition System.cpp:2451
oms::System::getTime
double getTime() const
Definition System.h:139
oms::System::getParentSystem
System * getParentSystem() const
Definition System.h:128
oms::System::doStep
virtual oms_status_enu_t doStep()=0
oms::System::isTopLevelSystem
bool isTopLevelSystem() const
Definition System.h:167
oms::System::time
double time
Definition System.h:212
oms::System::getConnectors
Connector ** getConnectors()
Definition System.h:106
oms::System::NewSystem
static System * NewSystem(const ComRef &cref, oms_system_enu_t type, Model *parentModel, System *parentSystem)
Definition System.cpp:97
oms::System::setUnit
oms_status_enu_t setUnit(const ComRef &cref, const std::string &value)
Definition System.cpp:2313
oms::System::parentSystem
System * parentSystem
Definition System.h:235
oms::System::relativeTolerance
double relativeTolerance
Definition System.h:223
oms::System::parentModel
Model * parentModel
Definition System.h:234
oms::System::listUnconnectedConnectors
oms_status_enu_t listUnconnectedConnectors(char **contents) const
Definition System.cpp:654
oms::System::getState
oms_status_enu_t getState(const ComRef &cref)
Definition System.cpp:2051
oms::System::type
oms_system_enu_t type
Definition System.h:233
oms::System::getConnector
Connector * getConnector(const ComRef &cref)
Definition System.cpp:1092
oms::System::getSolver
oms_solver_enu_t getSolver()
Definition System.h:178
oms::System::minimumStepSize
double minimumStepSize
Definition System.h:224
oms::System::getInteger
oms_status_enu_t getInteger(const ComRef &cref, int &value)
Definition System.cpp:1833
oms::System::setReal
oms_status_enu_t setReal(const ComRef &cref, double value)
Definition System.cpp:2217
oms::System::clock
Clock clock
Definition System.h:218
oms::System::getInitialUnknownsGraph
const DirectedGraph & getInitialUnknownsGraph()
Definition System.h:135
oms::System::initialize
virtual oms_status_enu_t initialize()=0
oms::System::getThreadPool
ctpl::thread_pool & getThreadPool()
Definition System.cpp:2567
oms::System::getBoolean
oms_status_enu_t getBoolean(const ComRef &cref, bool &value)
Definition System.cpp:1763
oms::System::getConnectorOwner
std::string getConnectorOwner(const ComRef &cref) const
Definition System.cpp:1112
oms::System::getStepSize
void getStepSize(double *initialStepSize, double *minimumStepSize, double *maximumStepSize) const
Definition System.h:173
oms::System::validCref
bool validCref(const ComRef &cref)
Definition System.cpp:241
oms::System::setConnectionLinearTransformation
oms_status_enu_t setConnectionLinearTransformation(const oms::ComRef &crefA, const oms::ComRef &crefB, double factor, double offset)
Definition System.cpp:1430
oms::System::getMaximumStepSize
double getMaximumStepSize()
Definition System.h:177
oms::System::addConnectorToBus
oms_status_enu_t addConnectorToBus(const ComRef &busCref, const ComRef &connectorCref)
Definition System.cpp:1293
oms::System::deleteReferencesInSSD
oms_status_enu_t deleteReferencesInSSD(const ComRef &cref, const std::string &filename)
Definition System.cpp:602
oms::System::terminate
virtual oms_status_enu_t terminate()=0
oms::System::connectors
std::vector< Connector * > connectors
last element is always NULL
Definition System.h:243
oms::System::getElement
Element * getElement()
Definition System.h:89
oms::System::exportToSSV
oms_status_enu_t exportToSSV(Snapshot &snapshot) const
Definition System.cpp:819
oms::System::addSubSystem
oms_status_enu_t addSubSystem(const ComRef &cref, oms_system_enu_t type)
Definition System.cpp:261
oms::System::newResources
oms_status_enu_t newResources(const ComRef &cref, const std::string &ssvFilename, const std::string &ssmFilename="", bool externalresources=false)
Definition System.cpp:532
oms::System::replaceSubModel
oms_status_enu_t replaceSubModel(const ComRef &cref, const std::string &fmuPath, bool dryRun, int &warningCount)
Definition System.cpp:391
oms::System::subelements
std::vector< oms_element_t * > subelements
last element is always NULL; don't free it
Definition System.h:244
oms::System::exportConnectors
std::unordered_map< ComRef, bool > exportConnectors
Definition System.h:229
oms::System::getComponent
Component * getComponent(const ComRef &cref)
Definition System.cpp:179
oms::System::setGeometry
void setGeometry(const ssd::ElementGeometry &geometry)
Definition System.h:102
oms::System::~System
virtual ~System()
Definition System.cpp:76
oms::System::busconnectors
std::vector< BusConnector * > busconnectors
Definition System.h:245
oms::System::eventGraph
DirectedGraph eventGraph
filtered dependency graph, without parameters, solved at event mode
Definition System.h:215
oms::System::element
Element element
Definition System.h:242
oms::System::setVariableStepSize
oms_status_enu_t setVariableStepSize(double initialStepSize, double minimumStepSize, double maximumStepSize)
Definition System.h:176
oms::System::stepUntil
virtual oms_status_enu_t stepUntil(double stopTime)=0
oms::System::copyResources
bool copyResources()
Definition System.cpp:1644
oms::System::deleteConnectorFromBus
oms_status_enu_t deleteConnectorFromBus(const ComRef &busCref, const ComRef &connectorCref)
Definition System.cpp:1317
oms::System::addConnector
oms_status_enu_t addConnector(const ComRef &cref, oms_causality_enu_t causality, oms_signal_type_enu_t type)
Definition System.cpp:1071
oms::System::operator=
System & operator=(System const &copy)
not implemented
oms::System::importBusConnectorSignals
oms_status_enu_t importBusConnectorSignals(const pugi::xml_node &node)
Definition System.cpp:2583
oms::System::forceLoopsToBeUpdated
void forceLoopsToBeUpdated()
Definition System.h:190
oms::System::deleteResourcesInSSP
oms_status_enu_t deleteResourcesInSSP(const std::string &filename)
Definition System.cpp:626
oms::System::loopsNeedUpdate
bool loopsNeedUpdate
Definition System.h:248
oms::System::exportToSSD_SimulationInformation
virtual oms_status_enu_t exportToSSD_SimulationInformation(pugi::xml_node &node) const =0
oms::System::setConnectionGeometry
oms_status_enu_t setConnectionGeometry(const ComRef &crefA, const ComRef &crefB, const oms::ssd::ConnectionGeometry *geometry)
Definition System.cpp:1403
oms::System::getType
oms_system_enu_t getType() const
Definition System.h:91
oms::System::exportDependencyGraphs
oms_status_enu_t exportDependencyGraphs(const std::string &pathInitialization, const std::string &pathEvent, const std::string &pathSimulation)
Definition System.cpp:1675
oms::System::getConnections
std::vector< Connection * > & getConnections()
Definition System.h:133
oms::System::importFromSSD_SimulationInformation
virtual oms_status_enu_t importFromSSD_SimulationInformation(const pugi::xml_node &node, const std::string &sspVersion)=0
oms::System::getSubSystems
std::map< ComRef, System * > & getSubSystems()
Definition System.h:131
oms::System::getFullCref
ComRef getFullCref() const
Definition System.cpp:153
oms::System::getValues
Values & getValues()
Definition System.h:196
oms::System::addAlgLoop
oms_status_enu_t addAlgLoop(scc_t SCC, const int algLoopNum, DirectedGraph &graph, bool supportsDirectionalDerivatives)
Definition System.cpp:2634
oms::Values
Definition Values.h:50
oms::Variable
Definition Variable.h:50
oms::ssd::ConnectionGeometry
Definition ConnectionGeometry.h:50
oms::ssd::ConnectorGeometry
Definition ConnectorGeometry.h:50
oms::ssd::ElementGeometry
Definition ElementGeometry.h:50
oms
Definition AlgLoop.h:49
oms::scc_t
Strong connected components data type.
Definition DirectedGraph.h:59