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.fmi2GetVersionFunction

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”

source
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
FMICore.fmi2GetTypesPlatformFunction

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”).

source
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

FMU capabilities

FMIBase.canGetSetFMUStateFunction
canGetSetFMUState(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.
source
FMIImport.isModelStructureAvailableFunction
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 contains dependency information.
source
FMIImport.isModelStructureDerivativesAvailableFunction
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 contains dependency information for derivatives.
source

fmi2DependenciesSupported fmi2DerivativeDependenciesSupported fmi2CanSerializeFMUstate fmi2ProvidesDirectionalDerivative

value references

FMIBase.getModelVariableIndicesFunction
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 attribute valueReferences::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 references vrs
source

fmi2GetValueReferencesAndNames fmi2GetNames

In-/Outputs

fmi2GetOutputValueReferencesAndNames