English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Launcher: URANIE::Launcher::TCodeFMU Class Reference
Uranie / Launcher v4.9.0
/* @license-end */
URANIE::Launcher::TCodeFMU Class Reference

A virtual class for the FMI/FMU encapsulation. More...

#include <TCodeFMU.h>

Inheritance diagram for URANIE::Launcher::TCodeFMU:
Collaboration diagram for URANIE::Launcher::TCodeFMU:

Public Types

enum  ELogLevel_t {
  log_level_nothing = 0 , log_level_fatal , log_level_error , log_level_warning ,
  log_level_info , log_level_verbose , log_level_debug , log_level_all
}
 The list of log level. More...
 

Public Member Functions

 TCodeFMU ()
 Default constructor.
 
 TCodeFMU (const TString &name, const TString &title)
 constructor with a name and a title
 
 TCodeFMU (URANIE::DataServer::TDataServer *tds, TString sFMUfile, Option_t *option="")
 Constructor from TDataServer and Command as string.
 
 TCodeFMU (URANIE::Launcher::TCode &mycode)
 Copy constructor.
 
virtual ~TCodeFMU ()
 
Encapsulates a code
virtual void init (Option_t *option="")
 Init phase of the code.
 
virtual void run (Option_t *option="")
 Run the code.
 
virtual void terminate (Option_t *option="")
 Terminate phase of the code.
 
void initIFirst (Option_t *option="")
 
Setting and Getting attributs
void setFMUFile (TString new_var, Option_t *option="")
 Set the value of _sFMUFile.
 
TString getFMUFile ()
 Get the value of the _sFMUFile attribute.
 
Double_t getStartSimulation ()
 
void setStartSimulation (Double_t dval)
 
Double_t getStoptSimulation ()
 
void setStopSimulation (Double_t dval)
 
Double_t getStepSimulation ()
 
void setStepSimulation (Double_t dval)
 
Double_t getToleranceSimulation ()
 
void setToleranceSimulation (Double_t dval)
 
void setStartStopSimulation (Double_t dstart, Double_t dstop)
 
methods associated to the FMI Library
void do_exit (int code)
 do_exit
 
Printing Log
void setLog ()
 Force the log.
 
void unsetLog ()
 Force to desable the log.
 
void changeLog ()
 Swith the status of the log.
 
Bool_t getLog ()
 Get the status of the log.
 
void setLogLevel (ELogLevel_t theLogLevel=log_level_info)
 Set the Log Level for the FMI Library.
 
ELogLevel_t getLogLevel ()
 Get the Log Level in the FMI Library.
 
virtual void printLog (Option_t *option="")
 Print the log of the object/class.
 
- Public Member Functions inherited from URANIE::Launcher::TCode
 TCode ()
 Default constructor.
 
 TCode (const TString &name, const TString &title)
 constructor with a name and a title
 
 TCode (URANIE::DataServer::TDataServer *tds, TString scmd)
 Constructor from TDataServer and Command as string.
 
 TCode (URANIE::Launcher::TCode &mycode)
 Copy constructor.
 
virtual ~TCode ()
 Default destructor.
 
TInputFilegetInputFile (TString sfile)
 Get the input file file from his name.
 
TInputFilegetInputFile (Int_t nfile)
 Get the input file from his index.
 
TInputFilegetLastInputFile ()
 Get the last input file.
 
TOutputFilegetOutputFile (Int_t nfile)
 Get the output file from his index.
 
TOutputFilegetOutputFile (TString sfile)
 getOutputFile
 
void setWorkingDirectory (TString sPathName="")
 Set the working directory.
 
TString getWorkingDirectory ()
 Get the working directory.
 
void setReferenceDirectory (TString str)
 Set the reference directory where inputs no change are located.
 
TString getReferenceDirectory ()
 Get the reference directory where inputs no change are located.
 
void setCommand (TString str)
 Set the code command.
 
TString getCommand ()
 Get the code command.
 
Int_t getNOutputFiles ()
 Get the number of output files.
 
Int_t getNOutputAttributes ()
 Get the number of output attributes.
 
Int_t getNOutputAttributes (Int_t nfile)
 Get the number of output attributes in the output file given by his index.
 
Int_t getNInputFiles ()
 Get the number of input files.
 
Int_t getNInputAttributes ()
 Get the number of input attributes.
 
Int_t getNInputAttributes (Int_t nfile)
 Get the number of input attributes in the input file given by his index.
 
URANIE::DataServer::TAttribute * getInputAttribute (Int_t nfile, Int_t natt)
 Get an attribute of an input file.
 
URANIE::DataServer::TAttribute * getAttribute (Int_t nfile, Int_t natt)
 Get an attribute of an output file.
 
TString getInputVarNames ()
 Get the names of the input variables separated by ":".
 
TString getOutputVarNames ()
 Get the names of the output variables separated by ":".
 
URANIE::DataServer::TDataServer * getTDataServer ()
 Get the pointer to the TDS.
 
void setTDataServer (URANIE::DataServer::TDataServer *atds)
 Set the pointer to the TDS.
 
virtual void runTest (Option_t *option="")
 Run a test for the code.
 
virtual void initFileType (Option_t *option="")
 Init file typing.
 
virtual void preTraitment (Int_t n, Double_t *val, Int_t *index=NULL, Option_t *option="")
 Pre-traitment phase of the code.
 
virtual void preTraitment (Int_t n, vector< URANIE::DataServer::UEntry * > *input, Option_t *option="")
 Pre-traitment phase of the code that deals with vectors/strings.
 
virtual Bool_t postTraitment (Int_t &nout, Double_t *dvalout, Option_t *option="", TList *lstOut=NULL)
 Post-traitment phase of the code.
 
virtual Bool_t postTraitment (vector< URANIE::DataServer::UEntry * > *out, Option_t *option)
 Post-traitment phase of the code that deals with vectors/strings.
 
void createDirectory (TString sPathName, TString sDirectoryName="")
 create the directory sPathName+"/"+sDirectoryName
 
virtual void copyFiles (Option_t *option="")
 copyFiles
 
void resetCurrentSimulation ()
 resetCurrentSimulation
 
virtual void cleanOutputFiles (Option_t *option="")
 Cleans the output files.
 
void addInputFile (TInputFile *ifile)
 Add a TInputFile file.
 
void addInputFile (TString str)
 Add an input file as a TString This input file does not contain input attributes. It is a mandatory input file for the code evaluation.
 
void addOutputFile (TOutputFile *ifile)
 Add a TOutputFile file The TOutputFile file contains the output attributes of teh study.
 
void setLog ()
 Force the log.
 
void unsetLog ()
 Force to desable the log.
 
void changeLog ()
 Swith the status of the log.
 
Bool_t getLog ()
 Get the status of the log.
 

protected attributes

TString _sFMUFile
 The FMU filename.
 
TString _sFMUWorkingDirectory
 the FMU import directory
 
ELogLevel_t _logLevel
 The log Level for FMI Library.
 
Double_t _dStart
 The start time for the simulation.
 
Double_t _dStop
 The stop time for the simulation.
 
Double_t _dStep
 The step time for the simulation.
 
Double_t _dTolerance
 The tolerance for the simulation.
 
Bool_t _bStart
 boolean to known if _dstart is defined by user
 
Bool_t _bStop
 boolean to known if _dstop is defined by user
 
Bool_t _bStep
 boolean to known if _dstep is defined by user
 
Bool_t _bTolerance
 boolean to known if _dTolerance is defined by user
 
Bool_t _binitIFirst
 boolean to known if passed into the initIFirst step
 
fmi_version_enu_t _sVersion
 The FMU version.
 
fmi_import_context_t * _context_FMI
 The FMU context.
 
fmi1_import_t * _fmi1Import
 The FMU 1.0 Object.
 
fmi2_import_t * _fmi2Import
 The FMU 2.0 Object.
 
TString _sGenerationTool
 The FMU generation tool.
 
TString _sGenerationDateTime
 The FMU generation date and time.
 
Double_t _dFMUStart
 The start time for default experiment as specified in the XML file.
 
Double_t _dFMUStop
 The stop time for default experiment as specified in the XML file.
 
Double_t _dFMUStep
 The step time for default experiment as specified in the XML file.
 
Double_t _dFMUTolerance
 The tolerance for default experiment as specified in the XML file.
 
void treatOption (TString soption)
 treat the soption for the class
 

Additional Inherited Members

- Public Attributes inherited from URANIE::Launcher::TCode
protected TList * _listOfInputFiles
 < vector of output files
 
TString _sWorkingDirectory
 The Working directory.
 
TString _sReferenceDirectory
 The Working directory.
 
TString _sCommand
 The Command of the code.
 
Int_t _nCurrentSimulation
 The Current number of simulation.
 
Int_t _nOfInput
 The size of the vector listOfInput scanning input files.
 
Int_t _nOfInputToSubstitute
 The size of the vector _nIndexOfInputToSubstitute.
 
Int_t * _nIndexOfInputToSubstitute
 The vector of Index to Substitute.
 
Bool_t _blog
 Boolean for edit the log.
 
URANIE::DataServer::TDataServer * _tds
 

Detailed Description

A virtual class for the FMI/FMU encapsulation.

  • step init (
    See also
    test_simulate_fmi2_cs ) :
    • Create the callback
    • Create the FMU pointer
    • Search the ReferenceValue in the FMU object for each input
    • Case of Log :
      • Print all the input start values
  • step preTraitment :
    • Set the input current values into the FMU object via setFMUReal() ..
  • step run :
    • Simulate the FMU Object via the loop (time_begin, time_step, _time_end) AND fmi2_import_do_step function
  • step postTraitment :
    • Catch the output values via the fmi2_import_get_real() function
  • step terminate :
    • Delete all the pointer (callbacks, FMU, ...)
See also
https://fmi-standard.org/

Member Enumeration Documentation

◆ ELogLevel_t

The list of log level.

Enumerator
log_level_nothing 
log_level_fatal 

Must be first in this enum. May be usefull in application relying solely on jm_get_last_error()

log_level_error 

Unrecoverable errors.

log_level_warning 

Errors that may be not critical for some FMUs.

log_level_info 

Non-critical issues.

log_level_verbose 

Informative messages.

log_level_debug 

Verbose messages.

log_level_all 

Debug messages. Only enabled if library is configured with FMILIB_ENABLE_LOG_LEVEL_DEBUG.

Must be last in this enum.

Constructor & Destructor Documentation

◆ TCodeFMU() [1/4]

URANIE::Launcher::TCodeFMU::TCodeFMU ( )

Default constructor.

Referenced by ClassImp().

◆ TCodeFMU() [2/4]

URANIE::Launcher::TCodeFMU::TCodeFMU ( const TString &  name,
const TString &  title 
)

constructor with a name and a title

Parameters
name
title

◆ TCodeFMU() [3/4]

URANIE::Launcher::TCodeFMU::TCodeFMU ( URANIE::DataServer::TDataServer *  tds,
TString  sFMUfile,
Option_t *  option = "" 
)

Constructor from TDataServer and Command as string.

Parameters
tds
sFMUfile

◆ TCodeFMU() [4/4]

URANIE::Launcher::TCodeFMU::TCodeFMU ( URANIE::Launcher::TCode mycode)

Copy constructor.

Parameters
mycode

◆ ~TCodeFMU()

virtual URANIE::Launcher::TCodeFMU::~TCodeFMU ( )
virtual

Empty Destructor

Referenced by ClassImp().

Member Function Documentation

◆ changeLog()

void URANIE::Launcher::TCodeFMU::changeLog ( )
inline

Swith the status of the log.

References URANIE::Launcher::TCode::_blog.

◆ do_exit()

void URANIE::Launcher::TCodeFMU::do_exit ( int  code)
inline

do_exit

Parameters
code

◆ getFMUFile()

TString URANIE::Launcher::TCodeFMU::getFMUFile ( )
inline

Get the value of the _sFMUFile attribute.

The FMU filename which contains the XML File and the library.

Returns
the value of _sFMUFile

References _sFMUFile.

◆ getLog()

Bool_t URANIE::Launcher::TCodeFMU::getLog ( )
inline

Get the status of the log.

Returns

References URANIE::Launcher::TCode::_blog.

◆ getLogLevel()

ELogLevel_t URANIE::Launcher::TCodeFMU::getLogLevel ( )
inline

Get the Log Level in the FMI Library.

Returns

References _logLevel.

◆ getStartSimulation()

Double_t URANIE::Launcher::TCodeFMU::getStartSimulation ( )
inline

References _dStart.

◆ getStepSimulation()

Double_t URANIE::Launcher::TCodeFMU::getStepSimulation ( )
inline

References _dStep.

◆ getStoptSimulation()

Double_t URANIE::Launcher::TCodeFMU::getStoptSimulation ( )
inline

References _dStop.

◆ getToleranceSimulation()

Double_t URANIE::Launcher::TCodeFMU::getToleranceSimulation ( )
inline

References _dTolerance.

◆ init()

virtual void URANIE::Launcher::TCodeFMU::init ( Option_t *  option = "")
virtual

Init phase of the code.

Parameters
option

Reimplemented from URANIE::Launcher::TCode.

Referenced by ClassImp().

◆ initIFirst()

void URANIE::Launcher::TCodeFMU::initIFirst ( Option_t *  option = "")

Referenced by ClassImp().

◆ printLog()

virtual void URANIE::Launcher::TCodeFMU::printLog ( Option_t *  option = "")
virtual

Print the log of the object/class.

Parameters
option

Reimplemented from URANIE::Launcher::TCode.

Referenced by ClassImp().

◆ run()

virtual void URANIE::Launcher::TCodeFMU::run ( Option_t *  option = "")
virtual

Run the code.

Parameters
option

Reimplemented from URANIE::Launcher::TCode.

Referenced by ClassImp().

◆ setFMUFile()

void URANIE::Launcher::TCodeFMU::setFMUFile ( TString  new_var,
Option_t *  option = "" 
)

Set the value of _sFMUFile.

The FMU filename which contains the XML File and the library.

Parameters
new_varthe new value of _sFMUFile

Referenced by ClassImp().

◆ setLog()

void URANIE::Launcher::TCodeFMU::setLog ( )
inline

Force the log.

References URANIE::Launcher::TCode::_blog.

◆ setLogLevel()

void URANIE::Launcher::TCodeFMU::setLogLevel ( ELogLevel_t  theLogLevel = log_level_info)
inline

Set the Log Level for the FMI Library.

See also
ELogLevel_t
Parameters
theLogLevel

References _logLevel.

◆ setStartSimulation()

void URANIE::Launcher::TCodeFMU::setStartSimulation ( Double_t  dval)
inline

References _bStart, and _dStart.

Referenced by setStartStopSimulation().

◆ setStartStopSimulation()

void URANIE::Launcher::TCodeFMU::setStartStopSimulation ( Double_t  dstart,
Double_t  dstop 
)
inline

◆ setStepSimulation()

void URANIE::Launcher::TCodeFMU::setStepSimulation ( Double_t  dval)
inline

References _bStep, and _dStep.

◆ setStopSimulation()

void URANIE::Launcher::TCodeFMU::setStopSimulation ( Double_t  dval)
inline

References _bStop, and _dStop.

Referenced by setStartStopSimulation().

◆ setToleranceSimulation()

void URANIE::Launcher::TCodeFMU::setToleranceSimulation ( Double_t  dval)
inline

References _bTolerance, and _dTolerance.

◆ terminate()

virtual void URANIE::Launcher::TCodeFMU::terminate ( Option_t *  option = "")
virtual

Terminate phase of the code.

Parameters
option

Reimplemented from URANIE::Launcher::TCode.

Referenced by ClassImp().

◆ treatOption()

void URANIE::Launcher::TCodeFMU::treatOption ( TString  soption)
private

treat the soption for the class

Parameters
soption

Referenced by ClassImp().

◆ unsetLog()

void URANIE::Launcher::TCodeFMU::unsetLog ( )
inline

Force to desable the log.

References URANIE::Launcher::TCode::_blog.

Member Data Documentation

◆ _binitIFirst

Bool_t URANIE::Launcher::TCodeFMU::_binitIFirst
protected

boolean to known if passed into the initIFirst step

Referenced by ClassImp().

◆ _bStart

Bool_t URANIE::Launcher::TCodeFMU::_bStart
protected

boolean to known if _dstart is defined by user

Referenced by ClassImp(), and setStartSimulation().

◆ _bStep

Bool_t URANIE::Launcher::TCodeFMU::_bStep
protected

boolean to known if _dstep is defined by user

Referenced by ClassImp(), and setStepSimulation().

◆ _bStop

Bool_t URANIE::Launcher::TCodeFMU::_bStop
protected

boolean to known if _dstop is defined by user

Referenced by ClassImp(), and setStopSimulation().

◆ _bTolerance

Bool_t URANIE::Launcher::TCodeFMU::_bTolerance
protected

boolean to known if _dTolerance is defined by user

Referenced by ClassImp(), and setToleranceSimulation().

◆ _context_FMI

fmi_import_context_t* URANIE::Launcher::TCodeFMU::_context_FMI
protected

The FMU context.

◆ _dFMUStart

Double_t URANIE::Launcher::TCodeFMU::_dFMUStart
protected

The start time for default experiment as specified in the XML file.

Referenced by ClassImp().

◆ _dFMUStep

Double_t URANIE::Launcher::TCodeFMU::_dFMUStep
protected

The step time for default experiment as specified in the XML file.

Referenced by ClassImp().

◆ _dFMUStop

Double_t URANIE::Launcher::TCodeFMU::_dFMUStop
protected

The stop time for default experiment as specified in the XML file.

Referenced by ClassImp().

◆ _dFMUTolerance

Double_t URANIE::Launcher::TCodeFMU::_dFMUTolerance
protected

The tolerance for default experiment as specified in the XML file.

Referenced by ClassImp().

◆ _dStart

Double_t URANIE::Launcher::TCodeFMU::_dStart
protected

The start time for the simulation.

Referenced by ClassImp(), getStartSimulation(), and setStartSimulation().

◆ _dStep

Double_t URANIE::Launcher::TCodeFMU::_dStep
protected

The step time for the simulation.

Referenced by ClassImp(), getStepSimulation(), and setStepSimulation().

◆ _dStop

Double_t URANIE::Launcher::TCodeFMU::_dStop
protected

The stop time for the simulation.

Referenced by ClassImp(), getStoptSimulation(), and setStopSimulation().

◆ _dTolerance

Double_t URANIE::Launcher::TCodeFMU::_dTolerance
protected

The tolerance for the simulation.

Referenced by ClassImp(), getToleranceSimulation(), and setToleranceSimulation().

◆ _fmi1Import

fmi1_import_t* URANIE::Launcher::TCodeFMU::_fmi1Import
protected

The FMU 1.0 Object.

Referenced by ClassImp().

◆ _fmi2Import

fmi2_import_t* URANIE::Launcher::TCodeFMU::_fmi2Import
protected

The FMU 2.0 Object.

Referenced by ClassImp().

◆ _logLevel

ELogLevel_t URANIE::Launcher::TCodeFMU::_logLevel
protected

The log Level for FMI Library.

Referenced by ClassImp(), getLogLevel(), and setLogLevel().

◆ _sFMUFile

TString URANIE::Launcher::TCodeFMU::_sFMUFile
protected

The FMU filename.

Referenced by ClassImp(), and getFMUFile().

◆ _sFMUWorkingDirectory

TString URANIE::Launcher::TCodeFMU::_sFMUWorkingDirectory
protected

the FMU import directory

Referenced by ClassImp().

◆ _sGenerationDateTime

TString URANIE::Launcher::TCodeFMU::_sGenerationDateTime
protected

The FMU generation date and time.

Referenced by ClassImp().

◆ _sGenerationTool

TString URANIE::Launcher::TCodeFMU::_sGenerationTool
protected

The FMU generation tool.

Referenced by ClassImp().

◆ _sVersion

fmi_version_enu_t URANIE::Launcher::TCodeFMU::_sVersion
protected

The FMU version.

Referenced by ClassImp().