Working with the FMI model description
The FMI model description provides all human readable information on the model. The following functions can be used to obtain all information provided by the model description, which in turn can be extracted from the fmu.
Loading/Parsing
Model descriptions are loaded through loadFMU as part of FMU setup.
general information about the FMU
Use the version-independent model-description helpers for generation metadata.
technical information about the FMU
FMICore.fmi2GetVersion — Function
fmi2GetVersion(fmu::FMU2)Returns the version of the “fmi2Functions.h” header file which was used to compile the functions of the FMU.
Arguments
fmu::FMU2: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.
Returns
- Returns a string from the address of a C-style (NUL-terminated) string. The string represents the version of the “fmi2Functions.h” header file which was used to compile the functions of the FMU. The function returns “fmiVersion” which is defined in this header file. The standard header file as documented in this specification has version “2.0”
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.22]: 2.1.4 Inquire Platform and Version Number of Header Files
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
Source: FMISpec2.0.2[p.22]: 2.1.4 Inquire Platform and Version Number of Header Files
Returns the version of the “fmi2Functions.h” header file which was used to compile the functions of the FMU. The function returns “fmiVersion” which is defined in this header file. The standard header file as documented in this specification has version “2.0”
FMICore.fmi2GetTypesPlatform — Function
fmi2GetTypesPlatform(fmu::FMU2)Returns the string to uniquely identify the “fmi2TypesPlatform.h” header file used for compilation of the functions of the FMU. The standard header file, as documented in this specification, has fmi2TypesPlatform set to “default” (so this function usually returns “default”).
Arguments
fmu::FMU2: Mutable struct representing a FMU and all it instantiated instances in the FMI 2.0.2 Standard.
Returns
- Returns the string to uniquely identify the “fmi2TypesPlatform.h” header file used for compilation of the functions of the FMU.
Source
- FMISpec2.0.2 Link: https://fmi-standard.org/
- FMISpec2.0.2[p.22]: 2.1.4 Inquire Platform and Version Number of Header Files
- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions
Source: FMISpec2.0.2[p.22]: 2.1.4 Inquire Platform and Version Number of Header Files
Returns the string to uniquely identify the “fmi2TypesPlatform.h” header file used for compilation of the functions of the FMU. The standard header file, as documented in this specification, has fmi2TypesPlatform set to “default” (so this function usually returns “default”).
FMU capabilities
FMIImport.isModelStructureAvailable — Function
isModelStructureAvailable(md::fmi2ModelDescription)Returns true if the FMU model description contains dependency information.
Arguments
md::fmi2ModelDescription: Struct which provides the static information of ModelVariables.
Returns
::Bool: Returns true, if the FMU model description containsdependencyinformation.
FMIImport.isModelStructureDerivativesAvailable — Function
isModelStructureDerivativesAvailable(md::fmi2ModelDescription)Returns if the FMU model description contains dependency information for derivatives.
Arguments
md::fmi2ModelDescription: Struct which provides the static information of ModelVariables.
Returns
::Bool: Returns true, if the FMU model description containsdependencyinformation forderivatives.
value references
FMIBase.getModelVariableIndices — Function
getModelVariableIndices(md::fmi2ModelDescription; vrs=md.valueReferences)Returns a array of indices corresponding to value references vrs
Arguments
md::fmi2ModelDescription: Struct which provides the static information of ModelVariables.
Keywords
vrs=md.valueReferences: Additional attributevalueReferences::Array{fmi2ValueReference}of the Model Description that is a handle to a (base type) variable value. Handle and base type uniquely identify the value of a variable. (default =md.valueReferences::Array{fmi2ValueReference})
Returns
names::Array{Integer}: Returns a array of indices corresponding to value referencesvrs
In-/Outputs
Use the version-independent input and output helper functions for FMI2 model variables.