OMSimulatorLib
The OMSimulator project is a FMI-based co-simulation environment that supports ordinary (i.e., non-delayed) and TLM connections.
SystemWC.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenModelica.
3  *
4  * Copyright (c) 1998-CurrentYear, 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 GPL VERSION 3 LICENSE OR
11  * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
12  * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
13  * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
14  * ACCORDING TO RECIPIENTS CHOICE.
15  *
16  * The OpenModelica software and the Open Source Modelica
17  * Consortium (OSMC) Public License (OSMC-PL) are obtained
18  * from OSMC, either from the above address,
19  * from the URLs: http://www.ida.liu.se/projects/OpenModelica or
20  * http://www.openmodelica.org, and in the OpenModelica distribution.
21  * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
22  *
23  * This program is distributed WITHOUT ANY WARRANTY; without
24  * even the implied warranty of MERCHANTABILITY or FITNESS
25  * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
26  * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
27  *
28  * See the full OSMC Public License conditions for more details.
29  *
30  */
31 
32 #ifndef _OMS_SYSTEM_WC_H_
33 #define _OMS_SYSTEM_WC_H_
34 
35 #include "ComRef.h"
36 #include "DirectedGraph.h"
37 #include "System.h"
38 #include "Types.h"
39 
40 namespace oms
41 {
42  class Model;
43 
44  class SystemWC : public System
45  {
46  public:
47  ~SystemWC();
48 
50  oms_status_enu_t exportToSSD_SimulationInformation(pugi::xml_node& node) const;
51  oms_status_enu_t importFromSSD_SimulationInformation(const pugi::xml_node& node);
52 
57  oms_status_enu_t stepUntil(double stopTime, void (*cb)(const char* ident, double time, oms_status_enu_t status));
58 
59  double getTime() const {return time;}
60 
61  std::string getSolverName() const;
62  oms_status_enu_t setSolverMethod(std::string);
64 
66  oms_status_enu_t solveAlgLoop(DirectedGraph& graph, const std::vector< std::pair<int, int> >& SCC);
67 
68  oms_status_enu_t getRealOutputDerivative(const ComRef& cref, double*& value, unsigned int& order);
69  oms_status_enu_t setRealInputDerivative(const ComRef& cref, double* value, unsigned int order);
70  unsigned int getMaxOutputDerivativeOrder();
71 
72  protected:
73  SystemWC(const ComRef& cref, Model* parentModel, System* parentSystem);
74 
75  // stop the compiler generating methods copying the object
76  SystemWC(SystemWC const& copy);
77  SystemWC& operator=(SystemWC const& copy);
78 
79  private:
80  double time;
81 
82  double* derBuffer = NULL;
83  };
84 }
85 
86 #endif
unsigned int getMaxOutputDerivativeOrder()
Definition: SystemWC.cpp:131
oms_solver_enu_t
Definition: Types.h:84
Definition: Types.h:44
oms_solver_enu_t solverMethod
Definition: System.h:166
Definition: Model.h:48
oms_status_enu_t instantiate()
Definition: SystemWC.cpp:116
Definition: SystemWC.h:44
double time
Definition: SystemWC.h:80
~SystemWC()
Definition: SystemWC.cpp:47
oms_status_enu_t reset()
Definition: SystemWC.cpp:186
Definition: Types.h:90
oms_status_enu_t
Definition: Types.h:43
ComRef cref
Definition: System.h:174
Definition: Types.h:47
oms_status_enu_t updateInputs(DirectedGraph &graph)
Definition: SystemWC.cpp:313
oms_status_enu_t setSolver(oms_solver_enu_t solver)
Definition: SystemWC.h:63
ComRef - component reference.
Definition: ComRef.h:43
double getTime() const
Definition: SystemWC.h:59
Definition: Types.h:93
oms_status_enu_t solveAlgLoop(DirectedGraph &graph, const std::vector< std::pair< int, int > > &SCC)
Definition: SystemWC.cpp:367
std::string getSolverName() const
Definition: SystemWC.cpp:71
oms_status_enu_t terminate()
Definition: SystemWC.cpp:173
oms_status_enu_t setSolverMethod(std::string)
Definition: SystemWC.cpp:84
oms_status_enu_t importFromSSD_SimulationInformation(const pugi::xml_node &node)
Definition: SystemWC.cpp:107
double * derBuffer
Definition: SystemWC.h:82
Definition: BusConnector.h:15
SystemWC(const ComRef &cref, Model *parentModel, System *parentSystem)
Definition: SystemWC.cpp:42
static System * NewSystem(const ComRef &cref, Model *parentModel, System *parentSystem)
Definition: SystemWC.cpp:53
oms_status_enu_t initialize()
Definition: SystemWC.cpp:145
oms_status_enu_t setRealInputDerivative(const ComRef &cref, double *value, unsigned int order)
Definition: SystemWC.cpp:292
Model * parentModel
Definition: System.h:176
oms_status_enu_t exportToSSD_SimulationInformation(pugi::xml_node &node) const
Definition: SystemWC.cpp:96
oms_status_enu_t stepUntil(double stopTime, void(*cb)(const char *ident, double time, oms_status_enu_t status))
Definition: SystemWC.cpp:201
Definition: System.h:58
System * parentSystem
Definition: System.h:177
Definition: DirectedGraph.h:48
oms_status_enu_t getRealOutputDerivative(const ComRef &cref, double *&value, unsigned int &order)
Definition: SystemWC.cpp:270
SystemWC & operator=(SystemWC const &copy)
not implemented