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
fmi2LoadModelDescription
general information about the FMU
fmi2GetGenerationTool fmi2GetGenerationDateAndTime
technical information about the FMU
FMICore.fmi2GetVersion
— FunctionSource: 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”
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
FMICore.fmi2GetTypesPlatform
— FunctionSource: 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”).
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
FMU capabilities
FMIBase.canGetSetFMUState
— FunctioncanGetSetFMUState(md::fmi2ModelDescription)
Returns true, if the FMU supports the getting/setting of states
Arguments
md::fmi2ModelDescription
: Struct which provides the static information of ModelVariables.
Returns
::Bool
: Returns true, if the FMU supports the getting/setting of states.
FMIImport.isModelStructureAvailable
— FunctionisModelStructureAvailable(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 containsdependency
information.
FMIImport.isModelStructureDerivativesAvailable
— FunctionisModelStructureDerivativesAvailable(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 containsdependency
information forderivatives
.
fmi2DependenciesSupported fmi2DerivativeDependenciesSupported fmi2CanSerializeFMUstate fmi2ProvidesDirectionalDerivative
value references
FMIBase.getModelVariableIndices
— FunctiongetModelVariableIndices(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
fmi2GetValueReferencesAndNames fmi2GetNames
In-/Outputs
fmi2GetOutputValueReferencesAndNames