English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Launcher: TInputFileFMU.h Source File
Uranie / Launcher v4.9.0
/* @license-end */
TInputFileFMU.h
Go to the documentation of this file.
1
2// Copyright (C) 2013-2024 CEA/DES
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Lesser General Public License as published
6// by the Free Software Foundation, either version 3 of the License, or any
7// later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
17
33#ifndef TInputFileFMU_H
34#define TInputFileFMU_H
35
36// ROOT
37#include "Rtypes.h"
38#include "TString.h"
39
40// URANIE
41#include "TAttribute.h"
42#include "TInputFile.h"
43
44// FMI
45#ifdef WIN32
46#include <Windows4Root.h>
47#endif
48#include "fmilib.h"
49
50namespace URANIE {
51namespace Launcher {
52
54{
55public:
56 //---------------------------------------------
60
61 TInputFileFMU(TString str);
63 virtual ~TInputFileFMU();
65
66 // Public attribute accessor methods
67 //
68 //---------------------------------------------
76 void setWorkingDirectory(TString sPathName = "");
77
84 };
85
86 Double_t getStartTime() {
87 return _dFMUStart;
88 }
89 void setStartTime(Double_t dval) {
90 _dFMUStart = dval;
91 }
92
93 Double_t getStopTime() {
94 return _dFMUStop;
95 }
96 void setStopTime(Double_t dval) {
97 _dFMUStop = dval;
98 }
99
100 Double_t getStepTime() {
101 return _dFMUStep;
102 }
103 void setStepTime(Double_t dval) {
104 _dFMUStep = dval;
105 }
106
107 Double_t getTolerance() {
108 return _dFMUTolerance;
109 }
110 void setTolerance(Double_t dval) {
111 _dFMUTolerance = dval;
112 }
113
114
115
117
118
119 //---------------------------------------------
123
127 virtual void init();
128
130
133 virtual void terminate();
135
136
137 //---------------------------------------------
146 {
147 return kFALSE;
148 }
150
153 TString getAttributeInKey(TString skey);
154
158 virtual void addAttribute(URANIE::DataServer::TAttribute*);
159
160
162
163 //---------------------------------------------
167
171 virtual void searchIndexeAttribute(URANIE::DataServer::TAttribute* att);
172
173 void substitue(Int_t &n, Double_t *val, Int_t *index = NULL);
174
176
183 void substitue(Int_t &n, vector<URANIE::DataServer::UEntry*> *ent, Int_t *index = NULL);
185
186 // Public FMI functions
187 //
188 //---------------------------------------------
192 void setContext(fmi_import_context_t* fmi_ctxt)
193 {
194 _context_FMI = fmi_ctxt;
195 }
196
197 fmi_import_context_t* getContext()
198 {
199 return _context_FMI;
200 }
201
202 jm_callbacks* getCallbackFMI()
203 {
204 return _callbacks_FMI;
205 }
206
207 fmi1_import_t* getFMU1Import()
208 {
209 return _fmi1Import;
210 }
211
212 fmi2_import_t* getFMU2Import()
213 {
214 return _fmi2Import;
215 }
216
217
218 void setVersion(fmi_version_enu_t fmi_version)
219 {
220 _sVersion = fmi_version;
221 }
222
223 fmi_version_enu_t getFMUVersion()
224 {
225 return _sVersion;
226 }
227 const char* getFMUVersionString();
228
229 void runFMI(Option_t *option="");
230
236 Int_t simulate_fmi1_cs(Option_t *option="");
237
243 Int_t simulate_fmi2_cs(Option_t *option="");
244
245 void initFMI(Option_t *option="");
246
247 void do_exit(int code)
248 {
249 printf("Press 'Enter' to exit\n");
250 /* getchar(); */
251 exit(code);
252 }
253
254
259 void init_fmi2_0(Option_t *option = "");
260
265 void init_fmi1(Option_t *option = "");
266
267 vector<vector<double>> getVectorValues()
268 {
269 return _vecOutputs;
270 }
271
272 void setListOutputVector(TArrayI *arr);
274
275 //---------------------------------------------
279 virtual void printLog(Option_t *option = "");
281
282 //---------------------------------------------
287protected:
289 // FMI structures
290 jm_callbacks *_callbacks_FMI;
291 fmi_import_context_t* _context_FMI;
292 fmi_version_enu_t _sVersion;
293 fmi1_import_t* _fmi1Import;
294 fmi2_import_t* _fmi2Import;
295
296 // FMI General informations
299
301 TString _sModelName;
303 TString _sGUID;
304
305
306 Double_t _dFMUStart;
307 Double_t _dFMUStop;
308 Double_t _dFMUTolerance;
309 Double_t _dFMUStep;
310 vector<vector<double>> _vecOutputs;
311 vector<int> _vecVROutputs;
312 UInt_t _no;
313
315
316
317
318 ClassDef(URANIE::Launcher::TInputFileFMU, ID_LAUNCHER)
319};
320
321} // End of namespace Launcher
322} // End of namespace URANIE
323
324#endif // TInputFileFMU_H
325// End of File
Interface of the class URANIE::Launcher::TInputFile.
Description of the class TInputFileFMU.
Definition TInputFileFMU.h:54
void do_exit(int code)
Definition TInputFileFMU.h:247
Int_t simulate_fmi2_cs(Option_t *option="")
test_simulate_fmi2_cs
void initFMI(Option_t *option="")
fmi_import_context_t * getContext()
Definition TInputFileFMU.h:197
void setContext(fmi_import_context_t *fmi_ctxt)
Definition TInputFileFMU.h:192
void setListOutputVector(TArrayI *arr)
void runFMI(Option_t *option="")
void init_fmi2_0(Option_t *option="")
init_fmi_v2_0
fmi2_import_t * getFMU2Import()
Definition TInputFileFMU.h:212
TString _sModelName
The.
Definition TInputFileFMU.h:301
jm_callbacks * getCallbackFMI()
Definition TInputFileFMU.h:202
void setVersion(fmi_version_enu_t fmi_version)
Definition TInputFileFMU.h:218
TString getAttributeInKey(TString skey)
Return the name of the attribute for the key.
TString _sFMUWorkingDirectory
the FMU import directory
Definition TInputFileFMU.h:288
void substitue(Int_t &n, vector< URANIE::DataServer::UEntry * > *ent, Int_t *index=NULL)
Substitute the values of the attributes linked in the input file and write it.
fmi1_import_t * getFMU1Import()
Definition TInputFileFMU.h:207
Int_t simulate_fmi1_cs(Option_t *option="")
simulate_fmi1_cs
Double_t _dFMUStart
The start time for default experiment as specified in the XML file.
Definition TInputFileFMU.h:306
void setTolerance(Double_t dval)
Definition TInputFileFMU.h:110
TString _sGenerationTool
The FMU generation tool.
Definition TInputFileFMU.h:297
TString _sModelVersion
The.
Definition TInputFileFMU.h:302
Bool_t isFileToCopy()
Gets the type of the file. This method is used to find InputFile of type 'Recreate'.
Definition TInputFileFMU.h:145
jm_callbacks * _callbacks_FMI
Definition TInputFileFMU.h:290
virtual void init()
The init step.
fmi1_import_t * _fmi1Import
The FMU 1.0 Object.
Definition TInputFileFMU.h:293
TString _sPlatformName
The.
Definition TInputFileFMU.h:300
virtual void printLog(Option_t *option="")
void setStopTime(Double_t dval)
Definition TInputFileFMU.h:96
void setStepTime(Double_t dval)
Definition TInputFileFMU.h:103
TString getWorkingDirectory()
Get the working directory.
Definition TInputFileFMU.h:82
void setStartTime(Double_t dval)
Definition TInputFileFMU.h:89
TString _sGUID
The.
Definition TInputFileFMU.h:303
virtual void addAttribute(URANIE::DataServer::TAttribute *)
addAttribute
virtual ~TInputFileFMU()
Default destructor.
TInputFileFMU(TString str)
Default constructor.
void substitue(Int_t &n, Double_t *val, Int_t *index=NULL)
Substitute the values of the attributes linked in the input file and write it.
Double_t _dFMUTolerance
The tolerance for default experiment as specified in the XML file (not used)
Definition TInputFileFMU.h:308
virtual void terminate()
The terminate step.
fmi_version_enu_t _sVersion
The FMU version.
Definition TInputFileFMU.h:292
void init_fmi1(Option_t *option="")
init_fmi1
vector< vector< double > > _vecOutputs
the vector of stored kVector attributes
Definition TInputFileFMU.h:310
Double_t getStopTime()
Definition TInputFileFMU.h:93
fmi_import_context_t * _context_FMI
The FMU context.
Definition TInputFileFMU.h:291
TString _sGenerationDateTime
The FMU generation date and time.
Definition TInputFileFMU.h:298
void setWorkingDirectory(TString sPathName="")
Set the working directory.
fmi_version_enu_t getFMUVersion()
Definition TInputFileFMU.h:223
fmi2_import_t * _fmi2Import
The FMU 2.0 Object.
Definition TInputFileFMU.h:294
Double_t _dFMUStep
The step for default experiment as specified in the XML file.
Definition TInputFileFMU.h:309
virtual void searchIndexeAttribute(URANIE::DataServer::TAttribute *att)
search the indexes of the attribute in the input file
Double_t _dFMUStop
The stop time for default experiment as specified in the XML file.
Definition TInputFileFMU.h:307
Double_t getStepTime()
Definition TInputFileFMU.h:100
Double_t getStartTime()
Definition TInputFileFMU.h:86
vector< int > _vecVROutputs
The vector of VR of the kVector Output attributes.
Definition TInputFileFMU.h:311
UInt_t _no
The number of kVector Output attributes.
Definition TInputFileFMU.h:312
Double_t getTolerance()
Definition TInputFileFMU.h:107
vector< vector< double > > getVectorValues()
Definition TInputFileFMU.h:267
Abstract class for an input file of a code.
Definition TInputFile.h:53
Definition TCluster.h:67