From 4be373d9f02d2a610ecb78cee3c1d01b5b06f2d2 Mon Sep 17 00:00:00 2001 From: adribrune <94375638+adribrune@users.noreply.github.com> Date: Thu, 23 Mar 2023 08:38:07 +0100 Subject: [PATCH] Update Documentation (#80) * Update Doc-String | modified: src/FMI2/c.jl modified: src/FMI2/ext.jl modified: src/FMI2/int.jl modified: src/FMI2/md.jl * Update Doc-String | modified: docs/src/fmi2_library.md modified: src/FMI2/convert.jl modified: src/FMI2/ext.jl modified: src/FMI2/int.jl * Update src/ and docs/ * Update src/ * Update docs/src/ and src/FMI2 * Update src/FMI2/int.jl * Update src/FMI2/md.jl * Doc-Update * Doc-Update * Update doc/ * Update docs/ * Update docs/ * Update Doc-String * describe missing parameters in Docstings * Update docs/src/fmi2_library.md --- docs/make.jl | 2 + docs/src/fmi2_library.md | 18 ++--- src/FMI2/c.jl | 135 ++++++++++++++++-------------------- src/FMI2/convert.jl | 15 ---- src/FMI2/ext.jl | 145 ++++++++++++++++++++------------------- src/FMI2/fmu_to_md.jl | 12 ---- src/FMI2/int.jl | 87 ++++++++--------------- src/FMI2/md.jl | 80 +++++---------------- src/FMIImport.jl | 10 +-- 9 files changed, 190 insertions(+), 314 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index f4f10bb..5e634e7 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -11,6 +11,8 @@ makedocs(sitename="FMIImport.jl", sidebar_sitename = false, edit_link = nothing ), + modules = [FMIImport], + checkdocs = :exports, pages= Any[ "Introduction" => "index.md" "Examples" => "overview.md" diff --git a/docs/src/fmi2_library.md b/docs/src/fmi2_library.md index c322c53..1192c46 100644 --- a/docs/src/fmi2_library.md +++ b/docs/src/fmi2_library.md @@ -1,3 +1,4 @@ + # [FMI2 Library Functions](@id library) ## FMI2 Common Concepts for Model Exchange and Co-Simulation @@ -30,6 +31,7 @@ fmi2IsModelExchange #### Information functions + ```@docs fmi2DependenciesSupported fmi2DerivativeDependenciesSupported @@ -89,7 +91,7 @@ attributes)]. ```@docs fmi2Get fmi2Get! -fmiSet +fmi2Set fmi2GetReal fmi2GetReal! fmi2GetInteger @@ -127,6 +129,7 @@ means computing the partial derivatives at a particular time instant. For Co-Sim compute the partial derivatives at a particular communication point. One function is provided to compute directional derivatives. This function can be used to construct the desired partial derivative matrices. + ```@docs fmi2GetDirectionalDerivative! fmi2SetRealInputDerivatives @@ -146,15 +149,12 @@ Depending on the situation, different variables need to be computed. In order to ```@docs fmi2SetTime fmi2SetContinuousStates -fmi2SetReal -fmi2SetInteger -fmi2SetBoolean -fmi2SetString ``` ### Evaluation of Model Equations This section contains the core functions to evaluate the model equations. + ```@docs fmi2EnterEventMode fmi2NewDiscreteStates @@ -185,7 +185,6 @@ derivatives of the inputs with respect to time can be provided. Also, higher der higher order interpolation. ```@docs -fmi2SetRealInputDerivatives fmi2GetRealOutputDerivatives ``` @@ -223,7 +222,6 @@ fmi2Reload ```@docs fmi2StringToValueReference fmi2ModelVariablesForValueReference -fmi2StringToValueReference fmi2ValueReferenceToString fmi2GetSolutionState fmi2GetSolutionValue @@ -233,16 +231,10 @@ fmi2GetSolutionTime ### External/Additional functions ```@docs -fmi2Instantiate! -fmi2SampleJacobian -fmi2SampleJacobian! fmi2GetJacobian fmi2GetJacobian! fmi2GetFullJacobian fmi2GetFullJacobian! -fmi2Get! -fmi2Get -fmi2Set fmi2GetStartValue fmi2GetUnit fmi2GetDeclaredType diff --git a/src/FMI2/c.jl b/src/FMI2/c.jl index 22f3367..72f41cc 100644 --- a/src/FMI2/c.jl +++ b/src/FMI2/c.jl @@ -94,12 +94,24 @@ end # Common function for ModelExchange & CoSimulation """ -Source: FMISpec2.0.2[p.22]: 2.1.5 Creation, Destruction and Logging of FMU Instances + fmi2FreeInstance!(c::FMU2Component; popComponent::Bool = true) Disposes the given instance, unloads the loaded model, and frees all the allocated memory and other resources that have been allocated by the functions of the FMU interface. If a null pointer is provided for “c”, the function call is ignored (does not have an effect). - + Removes the component from the FMUs component list. + +# Arguments +- `c::FMU2Component`: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard. + +# Returns +- nothing + +# Source +- FMISpec2.0.2 Link: [https://fmi-standard.org/](https://fmi-standard.org/) +- FMISpec2.0.2[p.22]: 2.1.5 Creation, Destruction and Logging of FMU Instances +- FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions +See Also [`fmi2FreeInstance!`](@ref). """ function fmi2FreeInstance!(c::FMU2Component; popComponent::Bool = true) @@ -115,7 +127,6 @@ function fmi2FreeInstance!(c::FMU2Component; popComponent::Bool = true) end """ - fmi2GetTypesPlatform(fmu::FMU2) Returns the string to uniquely identify the “fmi2TypesPlatform.h” header file used for compilation of the functions of the FMU. @@ -143,7 +154,6 @@ end """ - fmi2GetTypesPlatform(c::FMU2Component) Returns the string to uniquely identify the “fmi2TypesPlatform.h” header file used for compilation of the functions of the FMU. @@ -160,13 +170,11 @@ The standard header file, as documented in this specification, has fmi2TypesPlat - 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 """ - function fmi2GetTypesPlatform(c::FMU2Component) fmi2GetTypesPlatform(c.fmu) end """ - fmi2GetVersion(fmu::FMU2) Returns the version of the “fmi2Functions.h” header file which was used to compile the functions of the FMU. @@ -191,7 +199,6 @@ function fmi2GetVersion(fmu::FMU2) end # special case """ - fmi2GetVersion(c::FMU2Component) Returns the version of the “fmi2Functions.h” header file which was used to compile the functions of the FMU. @@ -208,7 +215,6 @@ Returns the version of the “fmi2Functions.h” header file which was used to c - 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 """ - function fmi2GetVersion(c::FMU2Component) fmi2GetVersion(c.fmu) end @@ -228,7 +234,6 @@ function checkStatus(c::FMU2Component, status::fmi2Status) end """ - fmi2SetDebugLogging(c::FMU2Component, logginOn::fmi2Boolean, nCategories::Unsigned, categories::Ptr{Nothing}) Control the use of the logging callback function, version independent. @@ -263,7 +268,6 @@ function fmi2SetDebugLogging(c::FMU2Component, logginOn::fmi2Boolean, nCategorie end """ - fmi2SetupExperiment(c::FMU2Component, toleranceDefined::fmi2Boolean, tolerance::fmi2Real, startTime::fmi2Real, stopTimeDefined::fmi2Boolean, stopTime::fmi2Real) Informs the FMU to setup the experiment. This function must be called after `fmi2Instantiate` and before `fmi2EnterInitializationMode` is called. @@ -326,7 +330,6 @@ function fmi2SetupExperiment(c::FMU2Component, end """ - fmi2EnterInitializationMode(c::FMU2Component) Informs the FMU to enter Initialization Mode. Before calling this function, all variables with attribute can be set with the “fmi2SetXXX” functions (the ScalarVariable attributes are defined in the Model Description File, see section 2.2.7). Setting other variables is not allowed. Furthermore, `fmi2SetupExperiment` must be called at least once before calling `fmi2EnterInitializationMode`, in order that `startTime` is defined. @@ -366,7 +369,6 @@ function fmi2EnterInitializationMode(c::FMU2Component) end """ - fmi2ExitInitializationMode(c::FMU2Component) Informs the FMU to exit Initialization Mode. @@ -405,7 +407,6 @@ function fmi2ExitInitializationMode(c::FMU2Component) end """ - fmi2Terminate(c::FMU2Component; soft::Bool=false) Informs the FMU that the simulation run is terminated. @@ -451,7 +452,6 @@ function fmi2Terminate(c::FMU2Component; soft::Bool=false) end """ - fmi2Reset(c::FMU2Component; soft::Bool=false) Is called by the environment to reset the FMU after a simulation run. The FMU goes into the same state as if fmi2Instantiate would have been called.All variables have their default values. Before starting a new run, fmi2SetupExperiment and fmi2EnterInitializationMode have to be called. @@ -513,7 +513,6 @@ function fmi2Reset(c::FMU2Component; soft::Bool=false) end """ - fmi2GetReal!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Real}) Functions to get and set values of variables idetified by their valueReference @@ -538,7 +537,7 @@ More detailed: - FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values - See also [`fmi2GetReal!`](@ref). +See also [`fmi2GetReal!`](@ref). """ function fmi2GetReal!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Real}) @@ -550,7 +549,6 @@ function fmi2GetReal!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, n end """ - fmi2SetReal(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Real}) Functions to get and set values of variables idetified by their valueReference @@ -574,7 +572,7 @@ More detailed: - FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values - See also [`fmi2GetReal`](@ref). +See also [`fmi2GetReal`](@ref). """ function fmi2SetReal(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, @@ -600,7 +598,6 @@ function fmi2SetReal(c::FMU2Component, end """ - fmi2GetInteger!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Integer}) Writes the integer values of an array of variables in the given field @@ -629,7 +626,7 @@ More detailed: - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions - FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions -See also [`fmi2GetInteger!`](@ref),[`fmi2ValueReferenceFormat`](@ref), [`fmi2Struct`](@ref), [`FMU2`](@ref), [`FMU2Component`](@ref). +See also [`fmi2GetInteger!`](@ref). """ function fmi2GetInteger!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Integer}) @@ -641,7 +638,6 @@ function fmi2GetInteger!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference} end """ - fmi2SetInteger(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Integer}) Set the values of an array of integer variables @@ -668,7 +664,7 @@ More detailed: - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions - FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions - See also [`fmi2GetInteger!`](@ref). +See also [`fmi2GetInteger!`](@ref). """ function fmi2SetInteger(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Integer}) @@ -679,7 +675,6 @@ function fmi2SetInteger(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, end """ - fmi2GetBoolean!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Boolean}) Writes the boolean values of an array of variables in the given field @@ -719,7 +714,6 @@ function fmi2GetBoolean!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference} end """ - fmi2SetBoolean(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Boolean}) Functions to get and set values of variables idetified by their valueReference @@ -744,7 +738,7 @@ More detailed: - FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions - FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions -See also [`fmi2GetBoolean`](@ref),[`fmi2ValueReferenceFormat`](@ref), [`fmi2Struct`](@ref), [`FMU2`](@ref), [`FMU2Component`](@ref). +See also [`fmi2GetBoolean`](@ref). """ function fmi2SetBoolean(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::AbstractArray{fmi2Boolean}) @@ -755,7 +749,6 @@ function fmi2SetBoolean(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, end """ - fmi2GetString!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::Union{AbstractArray{Ptr{Cchar}}, AbstractArray{Ptr{UInt8}}}) Functions to get and set values of variables idetified by their valueReference @@ -795,7 +788,6 @@ function fmi2GetString!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, end """ - fmi2SetString(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::Union{AbstractArray{Ptr{Cchar}}, AbstractArray{Ptr{UInt8}}}) Set the values of an array of string variables @@ -823,10 +815,6 @@ More detailed: - FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values See also [`fmi2GetString!`](@ref). - -Source: FMISpec2.0.2[p.24]: 2.1.7 Getting and Setting Variable Values - -Functions to get and set values of variables idetified by their valueReference """ function fmi2SetString(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, value::Union{AbstractArray{Ptr{Cchar}}, AbstractArray{Ptr{UInt8}}}) @@ -837,7 +825,6 @@ function fmi2SetString(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, end """ - fmi2GetFMUstate!(c::FMU2Component, FMUstate::Ref{fmi2FMUstate}) Makes a copy of the internal FMU state and returns a pointer to this copy. @@ -872,7 +859,6 @@ function fmi2GetFMUstate!(c::FMU2Component, FMUstate::Ref{fmi2FMUstate}) end """ - fmi2SetFMUstate(c::FMU2Component, FMUstate::fmi2FMUstate) Copies the content of the previously copied FMUstate back and uses it as actual new FMU state. @@ -901,7 +887,7 @@ More detailed: - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State -See also [`fmi2GetFMUstate`](@ref), [`fmi2Struct`](@ref), [`FMU2`](@ref), [`FMU2Component`](@ref). +See also [`fmi2GetFMUstate`](@ref). """ function fmi2SetFMUstate(c::FMU2Component, FMUstate::fmi2FMUstate) @@ -912,7 +898,6 @@ function fmi2SetFMUstate(c::FMU2Component, FMUstate::fmi2FMUstate) end """ - fmi2FreeFMUstate!(c::FMU2Component, FMUstate::Ref{fmi2FMUstate}) Frees all memory and other resources allocated with the fmi2GetFMUstate call for this FMUstate. @@ -947,7 +932,6 @@ function fmi2FreeFMUstate!(c::FMU2Component, FMUstate::Ref{fmi2FMUstate}) end """ - fmi2SerializedFMUstateSize!(c::FMU2Component, FMUstate::fmi2FMUstate, size::Ref{Csize_t}) Stores the size of the byte vector in the given referenced Address, in order that FMUstate can be stored in it. @@ -982,7 +966,6 @@ function fmi2SerializedFMUstateSize!(c::FMU2Component, FMUstate::fmi2FMUstate, s end """ - fmi2SerializeFMUstate!(c::FMU2Component, FMUstate::fmi2FMUstate, serialzedState::AbstractArray{fmi2Byte}, size::Csize_t) Serializes the data which is referenced by pointer `FMUstate` and copies this data in to the byte vector `serializedState` of length `size`, that must be provided by the environment. @@ -1009,7 +992,7 @@ More detailed: - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State -See also [`fmi2SerializeFMUstate`](@ref),[`fmi2FMUstate`](@ref), [`fmi2Struct`](@ref), [`FMU2`](@ref), [`FMU2Component`](@ref). +See also [`fmi2SerializeFMUstate`](@ref). """ function fmi2SerializeFMUstate!(c::FMU2Component, FMUstate::fmi2FMUstate, serialzedState::AbstractArray{fmi2Byte}, size::Csize_t) @@ -1020,7 +1003,6 @@ function fmi2SerializeFMUstate!(c::FMU2Component, FMUstate::fmi2FMUstate, serial end """ - fmi2DeSerializeFMUstate!(c::FMU2Component, serializedState::AbstractArray{fmi2Byte}, size::Csize_t, FMUstate::Ref{fmi2FMUstate}) Deserializes the byte vector serializedState of length size, constructs a copy of the FMU state and stores the FMU state in the given address of the reference `FMUstate`, the pointer to this copy. @@ -1060,7 +1042,6 @@ function fmi2DeSerializeFMUstate!(c::FMU2Component, serializedState::AbstractArr end """ - fmi2GetDirectionalDerivative!(c::FMU2Component, vUnknown_ref::AbstractArray{fmi2ValueReference}, nUnknown::Csize_t, @@ -1110,7 +1091,7 @@ More detailed: - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.25]: 2.1.9 Getting Partial Derivatives -See also [`fmi2GetDirectionalDerivative`](@ref). +See also [`fmi2GetDirectionalDerivative!`](@ref). """ function fmi2GetDirectionalDerivative!(c::FMU2Component, vUnknown_ref::AbstractArray{fmi2ValueReference}, @@ -1129,8 +1110,11 @@ end # Functions specificly for isCoSimulation """ - - fmi2SetRealInputDerivatives(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, order::AbstractArray{fmi2Integer}, value::AbstractArray{fmi2Real}) + fmi2SetRealInputDerivatives(c::FMU2Component, + vr::AbstractArray{fmi2ValueReference}, + nvr::Csize_t, + order::AbstractArray{fmi2Integer}, + value::AbstractArray{fmi2Real}) Sets the n-th time derivative of real input variables. @@ -1168,8 +1152,10 @@ function fmi2SetRealInputDerivatives(c::FMU2Component, vr::AbstractArray{fmi2Val end """ - - fmi2GetRealOutputDerivatives!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, order::AbstractArray{fmi2Integer}, value::AbstractArray{fmi2Real}) + fmi2GetRealOutputDerivatives!(c::FMU2Component, + vr::AbstractArray{fmi2ValueReference}, + nvr::Csize_t, order::AbstractArray{fmi2Integer}, + value::AbstractArray{fmi2Real}) Sets the n-th time derivative of real input variables. @@ -1195,8 +1181,6 @@ More detailed: - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions - FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.104]: 4.2.1 Transfer of Input / Output Values and Parameters - -See also [`fmi2SetRealInputDerivatives!`](@ref). """ function fmi2GetRealOutputDerivatives!(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, nvr::Csize_t, order::AbstractArray{fmi2Integer}, value::AbstractArray{fmi2Real}) @@ -1207,8 +1191,10 @@ function fmi2GetRealOutputDerivatives!(c::FMU2Component, vr::AbstractArray{fmi2 end """ - - fmi2DoStep(c::FMU2Component, currentCommunicationPoint::fmi2Real, communicationStepSize::fmi2Real, noSetFMUStatePriorToCurrentPoint::fmi2Boolean) + fmi2DoStep(c::FMU2Component, + currentCommunicationPoint::fmi2Real, + communicationStepSize::fmi2Real, + noSetFMUStatePriorToCurrentPoint::fmi2Boolean) The computation of a time step is started. @@ -1245,7 +1231,6 @@ function fmi2DoStep(c::FMU2Component, currentCommunicationPoint::fmi2Real, commu end """ - fmi2CancelStep(c::FMU2Component) Can be called if `fmi2DoStep` returned `fmi2Pending` in order to stop the current asynchronous execution. @@ -1278,8 +1263,9 @@ function fmi2CancelStep(c::FMU2Component) end """ - - fmi2GetStatus!(c::FMU2Component, s::fmi2StatusKind, value::Ref{fmi2Status}) + fmi2GetStatus!(c::FMU2Component, + s::fmi2StatusKind, + value::Ref{fmi2Status}) Informs the master about the actual status of the simulation run. Which status information is to be returned is specified by the argument `fmi2StatusKind`. @@ -1328,8 +1314,9 @@ function fmi2GetStatus!(c::FMU2Component, s::fmi2StatusKind, value) end """ - - fmi2GetRealStatus!(c::FMU2Component, s::fmi2StatusKind, value::Ref{fmi2Real}) + fmi2GetRealStatus!(c::FMU2Component, + s::fmi2StatusKind, + value::Ref{fmi2Real}) Informs the master about the actual status of the simulation run. Which status information is to be returned is specified by the argument `fmi2StatusKind`. @@ -1368,8 +1355,9 @@ function fmi2GetRealStatus!(c::FMU2Component, s::fmi2StatusKind, value::fmi2Real end """ - - fmi2GetIntegerStatus!(c::FMU2Component, s::fmi2StatusKind, value::Ref{fmi2Integer}) + fmi2GetIntegerStatus!(c::FMU2Component, + s::fmi2StatusKind, + value::Ref{fmi2Integer}) Informs the master about the actual status of the simulation run. Which status information is to be returned is specified by the argument `fmi2StatusKind`. @@ -1408,8 +1396,9 @@ function fmi2GetIntegerStatus!(c::FMU2Component, s::fmi2StatusKind, value::fmi2I end """ - - fmi2GetBooleanStatus!(c::FMU2Component, s::fmi2StatusKind, value::Ref{fmi2Boolean}) + fmi2GetBooleanStatus!(c::FMU2Component, + s::fmi2StatusKind, + value::Ref{fmi2Boolean}) Informs the master about the actual status of the simulation run. Which status information is to be returned is specified by the argument `fmi2StatusKind`. @@ -1448,8 +1437,9 @@ function fmi2GetBooleanStatus!(c::FMU2Component, s::fmi2StatusKind, value::fmi2B end """ - - fmi2GetStringStatus!(c::FMU2Component, s::fmi2StatusKind, value::Ref{fmi2String}) + fmi2GetStringStatus!(c::FMU2Component, + s::fmi2StatusKind, + value::Ref{fmi2String}) Informs the master about the actual status of the simulation run. Which status information is to be returned is specified by the argument `fmi2StatusKind`. @@ -1488,10 +1478,14 @@ function fmi2GetStringStatus!(c::FMU2Component, s::fmi2StatusKind, value::fmi2St end # Model Exchange specific Functions - +#TOD0 """ - - fmi2SetTime(c::FMU2Component, time::fmi2Real; soft::Bool=false) + fmi2SetTime(c::FMU2Component, + time::fmi2Real; + soft::Bool=false, + track::Bool=true, + force::Bool=c.fmu.executionConfig.force, + time_shift::Bool=c.fmu.executionConfig.autoTimeShift) Set a new time instant and re-initialize caching of variables that depend on time, provided the newly provided time value is different to the previously set time value (variables that depend solely on constants or parameters need not to be newly computed in the sequel, but the previously computed values can be reused). @@ -1501,6 +1495,8 @@ Set a new time instant and re-initialize caching of variables that depend on tim # Keywords - `soft::Bool=false`: If the Keyword `soft = true` the command is only performed if the FMU is in an allowed state for this command. +-`track::Bool=true`: If the Keyword `track = true` +- `time_shift::Bool=c.fmu.executionConfig.autoTimeShift`: # Returns - `status::fmi2Status`: Return `status` is an enumeration of type `fmi2Status` and indicates the success of the function call. @@ -1559,8 +1555,8 @@ function fmi2SetTime(c::FMU2Component, time::fmi2Real; soft::Bool=false, track:: return status end +#TODO """ - fmi2SetContinuousStates(c::FMU2Component, x::AbstractArray{fmi2Real}, nx::Csize_t) @@ -1590,7 +1586,6 @@ More detailed: See also [`fmi2SetContinuousStates`](@ref). """ -fmi2NewDiscreteStates! function fmi2SetContinuousStates(c::FMU2Component, x::AbstractArray{fmi2Real}, nx::Csize_t; @@ -1619,7 +1614,6 @@ function fmi2SetContinuousStates(c::FMU2Component, end """ - fmi2EnterEventMode(c::FMU2Component; soft::Bool=false) The model enters Event Mode from the Continuous-Time Mode and discrete-time equations may become active (and relations are not “frozen”). @@ -1667,7 +1661,6 @@ function fmi2EnterEventMode(c::FMU2Component; soft::Bool=false) end """ - fmi2NewDiscreteStates!(c::FMU2Component, eventInfo::fmi2EventInfo) The FMU is in Event Mode and the super dense time is incremented by this call. @@ -1720,7 +1713,6 @@ function fmi2NewDiscreteStates!(c::FMU2Component, eventInfo::fmi2EventInfo) end """ - fmi2EnterContinuousTimeMode(c::FMU2Component; soft::Bool=false) The model enters Continuous-Time Mode and all discrete-time equations become inactive and all relations are “frozen”. @@ -1771,7 +1763,6 @@ function fmi2EnterContinuousTimeMode(c::FMU2Component; soft::Bool=false) end """ - fmi2CompletedIntegratorStep!(c::FMU2Component, noSetFMUStatePriorToCurrentPoint::fmi2Boolean, enterEventMode::Ref{fmi2Boolean}, @@ -1798,7 +1789,7 @@ More detailed: - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations -See also [`fmi2CompletedIntegratorStep`](@ref), [`fmi2SetFMUState`](@ref). +See also [`fmi2CompletedIntegratorStep!`](@ref). """ function fmi2CompletedIntegratorStep!(c::FMU2Component, noSetFMUStatePriorToCurrentPoint::fmi2Boolean, @@ -1812,7 +1803,6 @@ function fmi2CompletedIntegratorStep!(c::FMU2Component, end """ - fmi2GetDerivatives!(c::FMU2Component, derivatives::AbstractArray{fmi2Real}, nx::Csize_t) @@ -1853,7 +1843,6 @@ function fmi2GetDerivatives!(c::FMU2Component, end """ - fmi2GetEventIndicators!(c::FMU2Component, eventIndicators::AbstractArray{fmi2Real}, ni::Csize_t) Compute event indicators at the current time instant and for the current states. @@ -1888,7 +1877,6 @@ function fmi2GetEventIndicators!(c::FMU2Component, eventIndicators::AbstractArra end """ - fmi2GetContinuousStates!(c::FMU2Component, x::AbstractArray{fmi2Real}, nx::Csize_t) @@ -1927,7 +1915,6 @@ function fmi2GetContinuousStates!(c::FMU2Component, end """ - fmi2GetNominalsOfContinuousStates!(c::FMU2Component, x_nominal::AbstractArray{fmi2Real}, nx::Csize_t) Stores the nominal values of the continuous states in x_nominal. diff --git a/src/FMI2/convert.jl b/src/FMI2/convert.jl index 8e1572e..fdb3284 100644 --- a/src/FMI2/convert.jl +++ b/src/FMI2/convert.jl @@ -51,7 +51,6 @@ function prepareValueReference(comp::FMU2Component, vr::fmi2ValueReferenceFormat end """ - fmi2StringToValueReference(md::fmi2ModelDescription, names::AbstractArray{String}) Returns an array of ValueReferences coresponding to the variable names. @@ -82,7 +81,6 @@ function fmi2StringToValueReference(md::fmi2ModelDescription, names::AbstractArr end """ - fmi2ModelVariablesForValueReference(md::fmi2ModelDescription, vr::fmi2ValueReference) Returns the model variable(s) fitting the value reference. @@ -110,7 +108,6 @@ function fmi2ModelVariablesForValueReference(md::fmi2ModelDescription, vr::fmi2V end """ - fmi2StringToValueReference(md::fmi2ModelDescription, name::String) Returns the ValueReference or an array of ValueReferences coresponding to the variable names. @@ -139,7 +136,6 @@ function fmi2StringToValueReference(md::fmi2ModelDescription, name::String) end """ - fmi2StringToValueReference(fmu::FMU2, name::Union{String, AbstractArray{String}}) Returns the ValueReference or an array of ValueReferences coresponding to the variable names. @@ -164,7 +160,6 @@ function fmi2StringToValueReference(fmu::FMU2, name::Union{String, AbstractArray end """ - fmi2ValueReferenceToString(md::fmi2ModelDescription, reference::fmi2ValueReference) # Arguments @@ -183,7 +178,6 @@ function fmi2ValueReferenceToString(md::fmi2ModelDescription, reference::fmi2Val end """ - fmi2ValueReferenceToString(md::fmi2ModelDescription, reference::Int64) # Arguments @@ -202,7 +196,6 @@ function fmi2ValueReferenceToString(md::fmi2ModelDescription, reference::Int64) end """ - fmi2ValueReferenceToString(fmu::FMU2, reference::Union{fmi2ValueReference, Int64}) # Arguments @@ -222,7 +215,6 @@ end """ - fmi2GetSolutionState(solution::FMU2Solution, vr::fmi2ValueReferenceFormat; isIndex::Bool=false) Returns the Solution state. @@ -241,9 +233,7 @@ More detailed: `fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1 # Source - FMISpec2.0.2 Link: [https://fmi-standard.org/](https://fmi-standard.org/) - FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - """ - function fmi2GetSolutionState(solution::FMU2Solution, vr::fmi2ValueReferenceFormat; isIndex::Bool=false) indices = [] @@ -285,7 +275,6 @@ function fmi2GetSolutionState(solution::FMU2Solution, vr::fmi2ValueReferenceForm end """ - fmi2GetSolutionDerivative(solution::FMU2Solution, vr::fmi2ValueReferenceFormat; isIndex::Bool=false) Returns the Solution values. @@ -344,7 +333,6 @@ function fmi2GetSolutionDerivative(solution::FMU2Solution, vr::fmi2ValueReferenc end """ - fmi2GetSolutionValue(solution::FMU2Solution, vr::fmi2ValueReferenceFormat; isIndex::Bool=false) Returns the Solution values. @@ -365,7 +353,6 @@ More detailed: `fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1 - FMISpec2.0.2 Link: [https://fmi-standard.org/](https://fmi-standard.org/) - FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) """ - function fmi2GetSolutionValue(solution::FMU2Solution, vr::fmi2ValueReferenceFormat; isIndex::Bool=false) indices = [] @@ -427,7 +414,6 @@ function fmi2GetSolutionValue(solution::FMU2Solution, vr::fmi2ValueReferenceForm end """ - fmi2GetSolutionTime(solution::FMU2Solution) Returns the Solution time. @@ -445,7 +431,6 @@ Returns the Solution time. - FMISpec2.0.2 Link: [https://fmi-standard.org/](https://fmi-standard.org/) - FMISpec2.0.2[p.22]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) """ - function fmi2GetSolutionTime(solution::FMU2Solution) if solution.states !== nothing return solution.states.t diff --git a/src/FMI2/ext.jl b/src/FMI2/ext.jl index 0cc0fa3..5047085 100644 --- a/src/FMI2/ext.jl +++ b/src/FMI2/ext.jl @@ -1,4 +1,4 @@ - # +# # Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher # Licensed under the MIT license. See LICENSE file in the project root for details. # @@ -11,7 +11,6 @@ using ZipFile import Downloads """ - fmi2Unzip(pathToFMU::String; unpackPath=nothing, cleanup=true) Create a copy of the .fmu file as a .zip folder and unzips it. @@ -105,8 +104,10 @@ function dlsym_opt(libHandle, symbol) end """ - - fmi2Load(pathToFMU::String; unpackPath=nothing, type=nothing, cleanup=true) + fmi2Load(pathToFMU::String; + unpackPath=nothing, + type=nothing, + cleanup=true) Sets the properties of the fmu by reading the modelDescription.xml. Retrieves all the pointers of binary functions. @@ -126,7 +127,6 @@ Retrieves all the pointers of binary functions. - FMISpec2.0.2 Link: [https://fmi-standard.org/](https://fmi-standard.org/) - FMISpec2.0.2: 2.2.7 Definition of Model Variables (ModelVariables) -See also . """ function fmi2Load(pathToFMU::String; unpackPath::Union{String, Nothing}=nothing, type::Union{Symbol, fmi2Type, Nothing}=nothing, cleanup::Bool=true, logLevel::FMULogLevel=FMULogLevelWarn) # Create uninitialized FMU @@ -317,9 +317,19 @@ function loadBinary(fmu::FMU2) end """ - - fmi2Instantiate!(fmu::FMU2; instanceName::String=fmu.modelName, type::fmi2Type=fmu.type, pushComponents::Bool = true, visible::Bool = false, loggingOn::Bool = fmu.executionConfig.loggingOn, externalCallbacks::Bool = fmu.executionConfig.externalCallbacks, - logStatusOK::Bool=true, logStatusWarning::Bool=true, logStatusDiscard::Bool=true, logStatusError::Bool=true, logStatusFatal::Bool=true, logStatusPending::Bool=true) + fmi2Instantiate!(fmu::FMU2; + instanceName::String=fmu.modelName, + type::fmi2Type=fmu.type, + pushComponents::Bool = true, + visible::Bool = false, + loggingOn::Bool = fmu.executionConfig.loggingOn, + externalCallbacks::Bool = fmu.executionConfig.externalCallbacks, + logStatusOK::Bool=true, + logStatusWarning::Bool=true, + logStatusDiscard::Bool=true, + logStatusError::Bool=true, + logStatusFatal::Bool=true, + logStatusPending::Bool=true) Create a new instance of the given fmu, adds a logger if logginOn == true. # Arguments @@ -348,8 +358,19 @@ Create a new instance of the given fmu, adds a logger if logginOn == true. See also [`fmi2Instantiate`](#@ref). """ -function fmi2Instantiate!(fmu::FMU2; instanceName::String=fmu.modelName, type::fmi2Type=fmu.type, pushComponents::Bool = true, visible::Bool = false, loggingOn::Bool = fmu.executionConfig.loggingOn, externalCallbacks::Bool = fmu.executionConfig.externalCallbacks, - logStatusOK::Bool=true, logStatusWarning::Bool=true, logStatusDiscard::Bool=true, logStatusError::Bool=true, logStatusFatal::Bool=true, logStatusPending::Bool=true) +function fmi2Instantiate!(fmu::FMU2; + instanceName::String=fmu.modelName, + type::fmi2Type=fmu.type, + pushComponents::Bool = true, + visible::Bool = false, + loggingOn::Bool = fmu.executionConfig.loggingOn, + externalCallbacks::Bool = fmu.executionConfig.externalCallbacks, + logStatusOK::Bool=true, + logStatusWarning::Bool=true, + logStatusDiscard::Bool=true, + logStatusError::Bool=true, + logStatusFatal::Bool=true, + logStatusPending::Bool=true) compEnv = FMU2ComponentEnvironment() compEnv.logStatusOK = logStatusOK @@ -442,7 +463,6 @@ function fmi2Instantiate!(fmu::FMU2; instanceName::String=fmu.modelName, type::f end """ - fmi2Reload(fmu::FMU2) Reloads the FMU-binary. This is useful, if the FMU does not support a clean reset implementation. @@ -460,7 +480,6 @@ function fmi2Reload(fmu::FMU2) end """ - fmi2Unload(fmu::FMU2, cleanUp::Bool = true) Unload a FMU. @@ -492,11 +511,10 @@ function fmi2Unload(fmu::FMU2, cleanUp::Bool = true) end """ - fmi2SampleJacobian(c::FMU2Component, - vUnknown_ref::AbstractArray{fmi2ValueReference}, - vKnown_ref::AbstractArray{fmi2ValueReference}, - steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing) + vUnknown_ref::AbstractArray{fmi2ValueReference}, + vKnown_ref::AbstractArray{fmi2ValueReference}, + steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing) This function samples the directional derivative by manipulating corresponding values (central differences). @@ -528,7 +546,7 @@ Computes a linear combination of the partial derivatives of h with respect to th - FMISpec2.0.2 Link: [https://fmi-standard.org/](https://fmi-standard.org/) - FMISpec2.0.2: 2.2.7 Definition of Model Variables (ModelVariables) -See also [`fmi2GetDirectionalDerivative!`](@ref) ,[`fmi2GetDirectionalDerivative`](@ref). +See also [`fmi2GetDirectionalDerivative!`](@ref). """ function fmi2SampleJacobian(c::FMU2Component, vUnknown_ref::AbstractArray{fmi2ValueReference}, @@ -543,12 +561,11 @@ function fmi2SampleJacobian(c::FMU2Component, end """ - - function fmi2SampleJacobian!(c::FMU2Component, - vUnknown_ref::AbstractArray{fmi2ValueReference}, - vKnown_ref::AbstractArray{fmi2ValueReference}, - dvUnknown::AbstractArray, # ToDo: datatype - steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing) + function fmi2SampleJacobian!(mtx::Matrix{<:Real}, + c::FMU2Component, + vUnknown_ref::AbstractArray{fmi2ValueReference}, + vKnown_ref::AbstractArray{fmi2ValueReference}, + steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing) This function samples the directional derivative by manipulating corresponding values (central differences) and saves in-place. @@ -569,11 +586,12 @@ Computes a linear combination of the partial derivatives of h with respect to th Δv_unknown = (δh / δv_known) Δv_known # Arguments +- `mtx::Matrix{<:Real}`:Output matrix to store the Jacobian. Its dimensions must be compatible with the number of unknown and known value references. - `c::FMU2Component`: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard. - `vUnknown_ref::AbstractArray{fmi2ValueReference}`: Argument `vUnknown_ref` contains values of type`fmi2ValueReference` which are identifiers of a variable value of the model. `vUnknown_ref` can be equated with `v_unknown`(variable described above). - `vKnown_ref::AbstractArray{fmi2ValueReference}`: Argument `vKnown_ref` contains values of type `fmi2ValueReference` which are identifiers of a variable value of the model.`vKnown_ref` can be equated with `v_known`(variable described above). - `dvUnknown::AbstractArray{fmi2Real}`: Stores the directional derivative vector values. -- `steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing)`: If sampling is used, sampling step size can be set (for each direction individually) using optional argument `steps`. +- `steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing)`: Step size to be used for numerical differentiation. If nothing, a default value will be chosen automatically. # Returns - `nothing` @@ -582,13 +600,13 @@ Computes a linear combination of the partial derivatives of h with respect to th - FMISpec2.0.2 Link: [https://fmi-standard.org/](https://fmi-standard.org/) - FMISpec2.0.2: 2.2.7 Definition of Model Variables (ModelVariables) -See also [`fmi2GetDirectionalDerivative!`](@ref) ,[`fmi2GetDirectionalDerivative`](@ref). +See also [`fmi2GetDirectionalDerivative!`](@ref). """ function fmi2SampleJacobian!(mtx::Matrix{<:Real}, - c::FMU2Component, - vUnknown_ref::AbstractArray{fmi2ValueReference}, - vKnown_ref::AbstractArray{fmi2ValueReference}, - steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing) + c::FMU2Component, + vUnknown_ref::AbstractArray{fmi2ValueReference}, + vKnown_ref::AbstractArray{fmi2ValueReference}, + steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing) step = 0.0 @@ -625,11 +643,10 @@ function fmi2SampleJacobian!(mtx::Matrix{<:Real}, end """ - fmi2GetJacobian(comp::FMU2Component, - rdx::AbstractArray{fmi2ValueReference}, - rx::AbstractArray{fmi2ValueReference}; - steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing) + rdx::AbstractArray{fmi2ValueReference}, + rx::AbstractArray{fmi2ValueReference}; + steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing) Builds the jacobian over the FMU `fmu` for FMU value references `rdx` and `rx`, so that the function returns the jacobian ∂rdx / ∂rx. @@ -663,7 +680,6 @@ function fmi2GetJacobian(comp::FMU2Component, end """ - fmi2GetJacobian!(jac::AbstractMatrix{fmi2Real}, comp::FMU2Component, rdx::AbstractArray{fmi2ValueReference}, @@ -677,13 +693,13 @@ As fallback, directional derivatives will be sampled with central differences. For optimization, if the FMU's model description has the optional entry 'dependencies', only dependent variables are sampled/retrieved. This drastically boosts performance for systems with large variable count (like CFD). # Arguments -- `jac::AbstractMatrix{fmi2Real}`: Stores the the jacobian ∂rdx / ∂rx. +- `jac::AbstractMatrix{fmi2Real}`: A matrix that will hold the computed Jacobian matrix. - `comp::FMU2Component`: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard. - `rdx::AbstractArray{fmi2ValueReference}`: Argument `vUnknown_ref` contains values of type`fmi2ValueReference` which are identifiers of a variable value of the model. - `rx::AbstractArray{fmi2ValueReference}`: Argument `vKnown_ref` contains values of type `fmi2ValueReference` which are identifiers of a variable value of the model. # Keywords -- `steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing)`: If sampling is used, sampling step size can be set (for each direction individually) using optional argument `steps`. +- `steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing)`: Step size to be used for numerical differentiation. If nothing, a default value will be chosen automatically. # Returns - `nothing` @@ -740,11 +756,10 @@ function fmi2GetJacobian!(jac::AbstractMatrix{fmi2Real}, end """ - fmi2GetFullJacobian(comp::FMU2Component, - rdx::AbstractArray{fmi2ValueReference}, - rx::AbstractArray{fmi2ValueReference}; - steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing) + rdx::AbstractArray{fmi2ValueReference}, + rx::AbstractArray{fmi2ValueReference}; + steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing) Builds the jacobian over the FMU `fmu` for FMU value references `rdx` and `rx`, so that the function returns the jacobian ∂rdx / ∂rx. @@ -801,7 +816,8 @@ No performance optimization, for an optimized version use `fmi2GetJacobian!`. - `rx::AbstractArray{fmi2ValueReference}`: Argument `vKnown_ref` contains values of type `fmi2ValueReference` which are identifiers of a variable value of the model. # Keywords -- `steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing)`: If sampling is used, sampling step size can be set (for each direction individually) using optional argument `steps`. +- `steps::Union{AbstractArray{fmi2Real}, Nothing} = nothing)`: Step size to be used for numerical differentiation. +If nothing, a default value will be chosen automatically. # Returns - `nothing` @@ -832,7 +848,6 @@ function fmi2GetFullJacobian!(jac::AbstractMatrix{fmi2Real}, end """ - fmi2Get!(comp::FMU2Component, vrs::fmi2ValueReferenceFormat, dstArray::AbstractArray) Stores the specific value of `fmi2ScalarVariable` containing the modelVariables with the identical fmi2ValueReference and returns an array that indicates the Status. @@ -859,7 +874,6 @@ More detailed: - FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions """ - function fmi2Get!(comp::FMU2Component, vrs::fmi2ValueReferenceFormat, dstArray::AbstractArray) vrs = prepareValueReference(comp, vrs) @@ -895,7 +909,6 @@ function fmi2Get!(comp::FMU2Component, vrs::fmi2ValueReferenceFormat, dstArray:: end """ - fmi2Get(comp::FMU2Component, vrs::fmi2ValueReferenceFormat) @@ -914,7 +927,6 @@ More detailed: `fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1 - FMISpec2.0.2[p.23]: 2.1.6 Initialization, Termination, and Resetting an FMU - FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions """ - function fmi2Get(comp::FMU2Component, vrs::fmi2ValueReferenceFormat) vrs = prepareValueReference(comp, vrs) dstArray = Array{Any,1}(undef, length(vrs)) @@ -929,8 +941,10 @@ end """ - - fmi2Set(comp::FMU2Component, vrs::fmi2ValueReferenceFormat, srcArray::AbstractArray; filter=nothing) + fmi2Set(comp::FMU2Component, + vrs::fmi2ValueReferenceFormat, + srcArray::AbstractArray; + filter=nothing) Stores the specific value of `fmi2ScalarVariable` containing the modelVariables with the identical fmi2ValueReference and returns an array that indicates the Status. @@ -941,7 +955,7 @@ More detailed: `fmi2ValueReferenceFormat = Union{Nothing, String, Array{String,1 - `srcArray::AbstractArray`: Stores the specific value of `fmi2ScalarVariable` containing the modelVariables with the identical fmi2ValueReference to the input variable vr (vr = vrs[i]). `srcArray` has the same length as `vrs`. # Keywords -- `filter=nothing`: whether the individual values of "fmi2ScalarVariable" are to be stored +- `filter=nothing`: It is applied to each ModelVariable to determine if it should be updated. # Returns - `retcodes::Array{fmi2Status}`: Returns an array of length length(vrs) with Type `fmi2Status`. Type `fmi2Status` is an enumeration and indicates the success of the function call. @@ -958,7 +972,6 @@ More detailed: - FMISpec2.0.2[p.23]: 2.1.6 Initialization, Termination, and Resetting an FMU - FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions """ - function fmi2Set(comp::FMU2Component, vrs::fmi2ValueReferenceFormat, srcArray::AbstractArray; filter=nothing) vrs = prepareValueReference(comp, vrs) @@ -1002,7 +1015,6 @@ function fmi2Set(comp::FMU2Component, vrs::fmi2ValueReferenceFormat, src; filter end """ - fmi2GetStartValue(md::fmi2ModelDescription, vrs::fmi2ValueReferenceFormat = md.valueReferences) Returns the start/default value for a given value reference. @@ -1043,7 +1055,6 @@ function fmi2GetStartValue(md::fmi2ModelDescription, vrs::fmi2ValueReferenceForm end """ - fmi2GetStartValue(fmu::FMU2, vrs::fmi2ValueReferenceFormat = fmu.modelDescription.valueReferences) Returns the start/default value for a given value reference. @@ -1065,7 +1076,6 @@ function fmi2GetStartValue(fmu::FMU2, vrs::fmi2ValueReferenceFormat = fmu.modelD end """ - fmi2GetStartValue(c::FMU2Component, vrs::fmi2ValueReferenceFormat = c.fmu.modelDescription.valueReferences) Returns the start/default value for a given value reference. @@ -1118,7 +1128,6 @@ function fmi2GetStartValue(c::FMU2Component, vrs::fmi2ValueReferenceFormat = c.f end """ - fmi2GetStartValue(mv::fmi2ScalarVariable) Returns the start/default value for a given value reference. @@ -1138,7 +1147,6 @@ Returns the start/default value for a given value reference. - FMISpec2.0.2 Link: [https://fmi-standard.org/](https://fmi-standard.org/) - FMISpec2.0.2: 2.2.7 Definition of Model Variables (ModelVariables) """ - function fmi2GetStartValue(mv::fmi2ScalarVariable) if mv.Real != nothing return mv.Real.start @@ -1156,7 +1164,6 @@ function fmi2GetStartValue(mv::fmi2ScalarVariable) end """ - fmi2GetUnit(mv::fmi2ScalarVariable) Returns the `unit` entry (a string) of the corresponding model variable. @@ -1179,7 +1186,6 @@ function fmi2GetUnit(mv::fmi2ScalarVariable) end """ - fmi2GetUnit(st::fmi2SimpleType) Returns the `unit` entry (a string) of the corresponding simple type `st` if it has the @@ -1199,8 +1205,7 @@ end # ToDo: update Docu! """ - - fmi2GetUnit(md::fmi2ModelDescription, mv::fmi2ScalarVariable) + fmi2GetUnit(md::fmi2ModelDescription, mv::fmi2ScalarVariable) Returns the `unit` of the corresponding model variable `mv` as a `fmi2Unit` if it is defined in `md.unitDefinitions`. @@ -1225,8 +1230,7 @@ function fmi2GetUnit(md::fmi2ModelDescription, mv::Union{fmi2ScalarVariable, fmi end """ - - fmi2GetDeclaredType(md::fmi2ModelDescription, mv::fmi2ScalarVariable) + fmi2GetDeclaredType(md::fmi2ModelDescription, mv::fmi2ScalarVariable) Returns the `fmi2SimpleType` of the corresponding model variable `mv` as defined in `md.typeDefinitions`. @@ -1258,8 +1262,7 @@ end # TODO with the new `fmi2SimpleType` definition this function is superfluous...remove? """ - - fmi2GetSimpleTypeAttributeStruct(st::fmi2SimpleType) + fmi2GetSimpleTypeAttributeStruct(st::fmi2SimpleType) Returns the attribute structure for the simple type `st`. Depending on definition, this is either `st.Real`, `st.Integer`, `st.String`, @@ -1296,11 +1299,10 @@ function fmi2GetInitial(mv::fmi2ScalarVariable) end """ - fmi2SampleJacobian(c::FMU2Component, - vUnknown_ref::Array{fmi2ValueReference}, - vKnown_ref::Array{fmi2ValueReference}, - steps::Array{fmi2Real} = ones(fmi2Real, length(vKnown_ref)).*1e-5) + vUnknown_ref::Array{fmi2ValueReference}, + vKnown_ref::Array{fmi2ValueReference}, + steps::Array{fmi2Real} = ones(fmi2Real, length(vKnown_ref)).*1e-5) This function samples the directional derivative by manipulating corresponding values (central differences). @@ -1311,7 +1313,7 @@ More detailed: `fmi2Struct = Union{FMU2, FMU2Component}` - `str::FMU2Component`: Mutable struct represents an instantiated instance of an FMU in the FMI 2.0.2 Standard. - `vUnknown_ref::Array{fmi2ValueReference}`: Argument `vUnKnown_ref` contains values of type `fmi2ValueReference` which are identifiers of a variable value of the model.`vKnown_ref` is the Array of the vector values of Real input variables of function h that changes its value in the actual Mode. - `vKnown_ref::Array{fmi2ValueReference}`: Argument `vKnown_ref` contains values of type `fmi2ValueReference` which are identifiers of a variable value of the model.`vKnown_ref` is the Array of the vector values of Real input variables of function h that changes its value in the actual Mode. -- `steps::Array{fmi2Real} = ones(fmi2Real, length(vKnown_ref)).*1e-5`: current time stepssize +- `steps::Array{fmi2Real} = ones(fmi2Real, length(vKnown_ref)).*1e-5`: Predefined step size vector `steps`, where all entries have the value 1e-5. # Returns - `dvUnknown::Arrya{fmi2Real}`: stores the samples of the directional derivative @@ -1333,12 +1335,11 @@ function fmi2SampleJacobian(c::FMU2Component, end """ - fmi2SampleJacobian!(c::FMU2Component, - vUnknown_ref::Array{fmi2ValueReference}, - vKnown_ref::Array{fmi2ValueReference}, - dvUnknown::AbstractArray, - steps::Array{fmi2Real} = ones(fmi2Real, length(vKnown_ref)).*1e-5) + vUnknown_ref::Array{fmi2ValueReference}, + vKnown_ref::Array{fmi2ValueReference}, + dvUnknown::AbstractArray, + steps::Array{fmi2Real} = ones(fmi2Real, length(vKnown_ref)).*1e-5) This function samples the directional derivative by manipulating corresponding values (central differences) and saves in-place. diff --git a/src/FMI2/fmu_to_md.jl b/src/FMI2/fmu_to_md.jl index 7ad863f..39198dd 100644 --- a/src/FMI2/fmu_to_md.jl +++ b/src/FMI2/fmu_to_md.jl @@ -7,7 +7,6 @@ # - wrappers to call the model description functions from a FMU-instance [exported] """ - fmi2GetNumberOfStates(fmu::FMU2) Returns the number of states of the FMU. @@ -23,7 +22,6 @@ function fmi2GetNumberOfStates(fmu::FMU2) end """ - function fmi2GetModelName(fmu::FMU2) Returns the tag 'modelName' from the model description. @@ -40,7 +38,6 @@ function fmi2GetModelName(fmu::FMU2) end """ - fmi2GetGUID(fmu::FMU2) Returns the tag 'guid' from the model description. @@ -57,7 +54,6 @@ function fmi2GetGUID(fmu::FMU2) end """ - fmi2GetGenerationTool(fmu::FMU2) Returns the tag 'generationtool' from the model description. @@ -74,7 +70,6 @@ function fmi2GetGenerationTool(fmu::FMU2) end """ - fmi2GetGenerationDateAndTime(fmu::FMU2) Returns the tag 'generationdateandtime' from the model description. @@ -91,7 +86,6 @@ function fmi2GetGenerationDateAndTime(fmu::FMU2) end """ - fmi2GetVariableNamingConvention(fmu::FMU2) Returns the tag 'varaiblenamingconvention' from the model description. @@ -108,7 +102,6 @@ function fmi2GetVariableNamingConvention(fmu::FMU2) end """ - fmi2GetNumberOfEventIndicators(fmu::FMU2) Returns the tag 'numberOfEventIndicators' from the model description. @@ -125,7 +118,6 @@ function fmi2GetNumberOfEventIndicators(fmu::FMU2) end """ - fmi2CanGetSetState(fmu::FMU2) Returns true, if the FMU supports the getting/setting of states @@ -142,7 +134,6 @@ function fmi2CanGetSetState(fmu::FMU2) end """ - fmi2CanSerializeFMUstate(fmu::FMU2) Returns true, if the FMU state can be serialized @@ -159,7 +150,6 @@ function fmi2CanSerializeFMUstate(fmu::FMU2) end """ - fmi2ProvidesDirectionalDerivative(fmu::FMU2) Returns true, if the FMU provides directional derivatives @@ -176,7 +166,6 @@ function fmi2ProvidesDirectionalDerivative(fmu::FMU2) end """ - fmi2IsCoSimulation(fmu::FMU2) Returns true, if the FMU supports co simulation @@ -193,7 +182,6 @@ function fmi2IsCoSimulation(fmu::FMU2) end """ - fmi2IsModelExchange(fmu::FMU2) Returns true, if the FMU supports model exchange diff --git a/src/FMI2/int.jl b/src/FMI2/int.jl index 6da05e2..a250fa0 100644 --- a/src/FMI2/int.jl +++ b/src/FMI2/int.jl @@ -10,17 +10,12 @@ # - no direct access on C-pointers (`compAddr`), use existing FMICore-functions """ - - fmi2SetDebugLogging(c::FMU2Component, logginOn::fmi2Boolean, nCategories::size_t=Unsigned(0), categories::Ptr{fmiString}=C_NULL) + fmi2SetDebugLogging(c::FMU2Component) Control the use of the logging callback function, version independent. # Arguments - `c::FMU2Component`: Argument `c` is a mutable struct representing an instantiated instance of an FMU in the FMI 2.0.2 Standard. -- `logginOn::fmi2Boolean`: If `loggingOn = fmi2True`, debug logging is enabled for the log categories specified in categories, otherwise it is disabled. Type `fmi2Boolean` is defined as an alias Type for the C-Type Boolean and is to be used with `fmi2True` and `fmi2False`. -- `nCategories::Unsigned`: Argument `nCategories` defines the length of the argument `categories`. -- `categories::Ptr{Nothing}`: This is an unordered set of strings representing the possible values of the log categories of the FMU (for example logEvent). The allowed values of categories are defined by the modeling -environment that generated the FMU. # Returns - `status::fmi2Status`: Return `status` is an enumeration of type `fmi2Status` and indicates the success of the function call. @@ -43,8 +38,10 @@ function fmi2SetDebugLogging(c::FMU2Component) end """ - - fmi2SetupExperiment(c::FMU2Component, startTime::Union{Real, Nothing} = nothing, stopTime::Union{Real, Nothing} = nothing; tolerance::Union{Real, Nothing} = nothing) + fmi2SetupExperiment(c::FMU2Component, + startTime::Union{Real, Nothing} = nothing, + stopTime::Union{Real, Nothing} = nothing; + tolerance::Union{Real, Nothing} = nothing) Setup the simulation but without defining all of the parameters. @@ -77,7 +74,10 @@ More detailed: See also [`fmi2SetupExperiment`](@ref). """ -function fmi2SetupExperiment(c::FMU2Component, startTime::Union{Real, Nothing} = nothing, stopTime::Union{Real, Nothing} = nothing; tolerance::Union{Real, Nothing} = nothing) +function fmi2SetupExperiment(c::FMU2Component, + startTime::Union{Real, Nothing} = nothing, + stopTime::Union{Real, Nothing} = nothing; + tolerance::Union{Real, Nothing} = nothing) if startTime == nothing startTime = fmi2GetDefaultStartTime(c.fmu.modelDescription) @@ -112,8 +112,6 @@ function fmi2SetupExperiment(c::FMU2Component, startTime::Union{Real, Nothing} = end """ - - fmi2GetReal(c::FMU2Component, vr::fmi2ValueReferenceFormat) Get the values of an array of fmi2Real variables. @@ -152,7 +150,6 @@ function fmi2GetReal(c::FMU2Component, vr::fmi2ValueReferenceFormat) end """ - fmi2GetReal!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::AbstractArray{fmi2Real}) @@ -200,10 +197,8 @@ function fmi2GetReal!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::Re end """ - fmi2SetReal(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::Union{AbstractArray{<:Real}, <:Real}) - Set the values of an array of real variables # Arguments @@ -243,7 +238,6 @@ function fmi2SetReal(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::Uni end """ - fmi2GetInteger(c::FMU2Component, vr::fmi2ValueReferenceFormat) Returns the integer values of an array of variables @@ -283,7 +277,6 @@ function fmi2GetInteger(c::FMU2Component, vr::fmi2ValueReferenceFormat) end """ - fmi2GetInteger!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::AbstractArray{fmi2Integer}) Writes the integer values of an array of variables in the given field @@ -334,7 +327,6 @@ function fmi2GetInteger!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values: end """ - fmi2SetInteger(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::Union{AbstractArray{<:Integer}, <:Integer}) Set the values of an array of integer variables @@ -370,7 +362,6 @@ function fmi2SetInteger(c::FMU2Component, vr::fmi2ValueReferenceFormat, values:: end """ - fmi2GetBoolean(c::FMU2Component, vr::fmi2ValueReferenceFormat) Get the values of an array of fmi2Boolean variables. @@ -404,7 +395,6 @@ function fmi2GetBoolean(c::FMU2Component, vr::fmi2ValueReferenceFormat) end """ - fmi2GetBoolean!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::AbstractArray{fmi2Boolean}) Writes the boolean values of an array of variables in the given field @@ -450,7 +440,6 @@ function fmi2GetBoolean!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values: end """ - fmi2SetBoolean(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::Union{AbstractArray{Bool}, Bool}) Set the values of an array of boolean variables @@ -488,7 +477,6 @@ function fmi2SetBoolean(c::FMU2Component, vr::fmi2ValueReferenceFormat, values:: end """ - fmi2GetString(c::FMU2Component, vr::fmi2ValueReferenceFormat) Get the values of an array of fmi2String variables. @@ -526,7 +514,6 @@ function fmi2GetString(c::FMU2Component, vr::fmi2ValueReferenceFormat) end """ - fmi2GetString!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::AbstractArray{fmi2String}) Writes the string values of an array of variables in the given field @@ -568,7 +555,6 @@ function fmi2GetString!(c::FMU2Component, vr::fmi2ValueReferenceFormat, values:: end """ - fmi2SetString(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::Union{AbstractArray{String}, String}) Set the values of an array of string variables @@ -615,7 +601,6 @@ function fmi2SetString(c::FMU2Component, vr::fmi2ValueReferenceFormat, values::U end """ - fmi2GetFMUstate(c::FMU2Component) Makes a copy of the internal FMU state and returns a pointer to this copy. @@ -642,7 +627,6 @@ function fmi2GetFMUstate(c::FMU2Component) end """ - fmi2FreeFMUstate!(c::FMU2Component, state::fmi2FMUstate) Free the memory for the allocated FMU state @@ -660,7 +644,7 @@ Free the memory for the allocated FMU state - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.25]: 2.1.8 Getting and Setting the Complete FMU State -See also [`fmi2FreeFMUstate`](@ref). +See also [`fmi2FreeFMUstate!`](@ref). """ function fmi2FreeFMUstate!(c::FMU2Component, state::fmi2FMUstate) stateRef = Ref(state) @@ -670,7 +654,6 @@ function fmi2FreeFMUstate!(c::FMU2Component, state::fmi2FMUstate) end """ - fmi2SerializedFMUstateSize(c::FMU2Component, state::fmi2FMUstate) Returns the size of the byte vector in which the FMUstate can be stored. @@ -698,7 +681,6 @@ function fmi2SerializedFMUstateSize(c::FMU2Component, state::fmi2FMUstate) end """ - fmi2SerializeFMUstate(c::FMU2Component, state::fmi2FMUstate) Serializes the data referenced by the pointer FMUstate and copies this data into the byte vector serializedState of length size to be provided by the environment. @@ -730,7 +712,6 @@ function fmi2SerializeFMUstate(c::FMU2Component, state::fmi2FMUstate) end """ - fmi2DeSerializeFMUstate(c::FMU2Component, serializedState::AbstractArray{fmi2Byte}) Deserialize the data in the serializedState fmi2Byte field @@ -762,7 +743,6 @@ function fmi2DeSerializeFMUstate(c::FMU2Component, serializedState::AbstractArra end """ - fmi2GetDirectionalDerivative(c::FMU2Component, vUnknown_ref::AbstractArray{fmi2ValueReference}, vKnown_ref::AbstractArray{fmi2ValueReference}, @@ -800,7 +780,7 @@ Computes a linear combination of the partial derivatives of h with respect to th - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.25]: 2.1.9 Getting Partial Derivatives -See also [`fmi2GetDirectionalDerivative`](@ref). +See also [`fmi2GetDirectionalDerivative!`](@ref). """ function fmi2GetDirectionalDerivative(c::FMU2Component, vUnknown_ref::AbstractArray{fmi2ValueReference}, @@ -817,7 +797,6 @@ function fmi2GetDirectionalDerivative(c::FMU2Component, end """ -TODO -> Arguments fmiGetDirectionalDerivative!(c::FMU2Component, vUnknown_ref::AbstractArray{fmi2ValueReference}, vKnown_ref::AbstractArray{fmi2ValueReference}, @@ -865,7 +844,7 @@ More detailed: - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.25]: 2.1.9 Getting Partial Derivatives -See also [`fmi2GetDirectionalDerivative`](@ref). +See also [`fmi2GetDirectionalDerivative!`](@ref). """ function fmi2GetDirectionalDerivative!(c::FMU2Component, vUnknown_ref::AbstractArray{fmi2ValueReference}, @@ -886,7 +865,6 @@ function fmi2GetDirectionalDerivative!(c::FMU2Component, end """ - fmi2GetDirectionalDerivative(c::FMU2Component, vUnknown_ref::fmi2ValueReference, vKnown_ref::fmi2ValueReference, @@ -923,7 +901,7 @@ Computes a linear combination of the partial derivatives of h with respect to th - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.25]: 2.1.9 Getting Partial Derivatives -See also [`fmi2GetDirectionalDerivative`](@ref). +See also [`fmi2GetDirectionalDerivative!`](@ref). """ function fmi2GetDirectionalDerivative(c::FMU2Component, vUnknown_ref::fmi2ValueReference, @@ -935,8 +913,10 @@ end # CoSimulation specific functions """ - - fmi2SetRealInputDerivatives(c::FMU2Component, vr::AbstractArray{fmi2ValueReference}, order::AbstractArray{fmi2Integer}, values::AbstractArray{fmi2Real}) + fmi2SetRealInputDerivatives(c::FMU2Component, + vr::AbstractArray{fmi2ValueReference}, + order::AbstractArray{fmi2Integer}, + values::AbstractArray{fmi2Real}) Sets the n-th time derivative of real input variables. @@ -976,7 +956,6 @@ function fmi2SetRealInputDerivatives(c::FMU2Component, vr::fmi2ValueReferenceFor end """ - fmi2GetRealOutputDerivatives(c::FMU2Component, vr::fmi2ValueReferenceFormat, order::AbstractArray{fmi2Integer}) Sets the n-th time derivative of real input variables. @@ -995,7 +974,6 @@ Sets the n-th time derivative of real input variables. - FMISpec2.0.2[p.18]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.104]: 4.2.1 Transfer of Input / Output Values and Parameters -See also [`fmi2SetRealInputDerivatives!`](@ref). """ function fmi2GetRealOutputDerivatives(c::FMU2Component, vr::fmi2ValueReferenceFormat, order::AbstractArray{fmi2Integer}) @@ -1015,8 +993,10 @@ function fmi2GetRealOutputDerivatives(c::FMU2Component, vr::fmi2ValueReferenceFo end """ - - fmi2DoStep(c::FMU2Component, communicationStepSize::Union{Real, Nothing} = nothing; currentCommunicationPoint::Union{Real, Nothing} = nothing, noSetFMUStatePriorToCurrentPoint::Bool = true) + fmi2DoStep(c::FMU2Component, + communicationStepSize::Union{Real, Nothing} = nothing; + currentCommunicationPoint::Union{Real, Nothing} = nothing, + noSetFMUStatePriorToCurrentPoint::Bool = true) Does one step in the CoSimulation FMU @@ -1044,7 +1024,7 @@ More detailed: - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.104]: 4.2.2 Computation -See also [`fmi2DoStep`](@ref), [`fmi2Struct`](@ref), [`FMU2`](@ref), [`FMU2Component`](@ref). +See also [`fmi2DoStep`](@ref). """ function fmi2DoStep(c::FMU2Component, communicationStepSize::Union{Real, Nothing} = nothing; currentCommunicationPoint::Union{Real, Nothing} = nothing, noSetFMUStatePriorToCurrentPoint::Bool = true) @@ -1075,7 +1055,6 @@ function fmi2DoStep(c::FMU2Component, communicationStepSize::Union{Real, Nothing end """ - fmiSetTime(c::FMU2Component, t::Real) Set a new time instant and re-initialize caching of variables that depend on time. @@ -1113,7 +1092,6 @@ end # Model Exchange specific functions """ - fmiSetContinuousStates(c::FMU2Component, x::Union{AbstractArray{Float32},AbstractArray{Float64}}) @@ -1150,7 +1128,6 @@ function fmi2SetContinuousStates(c::FMU2Component, x::Union{AbstractArray{Float3 end """ - fmi2NewDiscreteStates(c::FMU2Component) Returns the next discrete states @@ -1182,7 +1159,6 @@ function fmi2NewDiscreteStates(c::FMU2Component) end """ - fmiCompletedIntegratorStep(c::FMU2Component, noSetFMUStatePriorToCurrentPoint::fmi2Boolean) This function must be called by the environment after every completed step @@ -1207,10 +1183,10 @@ More detailed: - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations -See also [`fmi2CompletedIntegratorStep`](@ref), [`fmi2SetFMUState`](@ref). +See also [`fmi2CompletedIntegratorStep`](@ref). """ function fmi2CompletedIntegratorStep(c::FMU2Component, - noSetFMUStatePriorToCurrentPoint::fmi2Boolean) + noSetFMUStatePriorToCurrentPoint::fmi2Boolean) enterEventMode = zeros(fmi2Boolean, 1) terminateSimulation = zeros(fmi2Boolean, 1) @@ -1223,7 +1199,6 @@ function fmi2CompletedIntegratorStep(c::FMU2Component, end """ - fmi2GetDerivatives(c::FMU2Component) Compute state derivatives at the current time instant and for the current states. @@ -1239,7 +1214,7 @@ vector. - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations -See also [`fmi2GetDerivatives`](@ref). +See also [`fmi2GetDerivatives!`](@ref). """ function fmi2GetDerivatives(c::FMU2Component) nx = Csize_t(length(c.fmu.modelDescription.stateValueReferences)) @@ -1249,7 +1224,6 @@ function fmi2GetDerivatives(c::FMU2Component) end """ - fmi2GetDerivatives!(c::FMU2Component, derivatives::AbstractArray{fmi2Real}) Compute state derivatives at the current time instant and for the current states. @@ -1272,7 +1246,7 @@ More detailed: - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations -See also [`fmi2GetDerivatives`](@ref). +See also [`fmi2GetDerivatives!`](@ref). """ function fmi2GetDerivatives!(c::FMU2Component, derivatives::AbstractArray{fmi2Real}) status = fmi2GetDerivatives!(c, derivatives, Csize_t(length(derivatives))) @@ -1283,7 +1257,6 @@ function fmi2GetDerivatives!(c::FMU2Component, derivatives::AbstractArray{fmi2Re end """ - fmi2GetEventIndicators(c::FMU2Component) Returns the event indicators of the FMU @@ -1297,7 +1270,7 @@ Returns the event indicators of the FMU - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations -See also [`fmi2GetEventIndicators`](@ref). +See also [`fmi2GetEventIndicators!`](@ref). """ function fmi2GetEventIndicators(c::FMU2Component) ni = Csize_t(c.fmu.modelDescription.numberOfEventIndicators) @@ -1307,7 +1280,6 @@ function fmi2GetEventIndicators(c::FMU2Component) end """ - fmi2GetEventIndicators!(c::FMU2Component, eventIndicators::AbstractArray{fmi2Real}) Returns the event indicators of the FMU. @@ -1321,7 +1293,6 @@ Returns the event indicators of the FMU. - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations -See also [`fmi2GetEventIndicators`](@ref). """ function fmi2GetEventIndicators!(c::FMU2Component, eventIndicators::AbstractArray{fmi2Real}) ni = Csize_t(length(eventIndicators)) @@ -1329,7 +1300,6 @@ function fmi2GetEventIndicators!(c::FMU2Component, eventIndicators::AbstractArra end """ - fmi2GetContinuousStates(c::FMU2Component) Return the new (continuous) state vector x @@ -1342,7 +1312,7 @@ Return the new (continuous) state vector x - FMISpec2.0.2[p.16]: 2.1.2 Platform Dependent Definitions (fmi2TypesPlatform.h) - FMISpec2.0.2[p.16]: 2.1.3 Status Returned by Functions - FMISpec2.0.2[p.83]: 3.2.2 Evaluation of Model Equations -See also [`fmi2GetEventIndicators`](@ref). +See also [`fmi2GetEventIndicators!`](@ref). """ function fmi2GetContinuousStates(c::FMU2Component) nx = Csize_t(length(c.fmu.modelDescription.stateValueReferences)) @@ -1352,7 +1322,6 @@ function fmi2GetContinuousStates(c::FMU2Component) end """ - fmi2GetNominalsOfContinuousStates(c::FMU2Component) Return the new (continuous) state vector x diff --git a/src/FMI2/md.jl b/src/FMI2/md.jl index 814282e..db659aa 100644 --- a/src/FMI2/md.jl +++ b/src/FMI2/md.jl @@ -21,8 +21,12 @@ using FMICore: FMU2 ###################################### """ +<<<<<<< HEAD + fmi2LoadModelDescription(pathToModellDescription::String) +======= fmi2LoadModelDescription(pathToModelDescription::String) +>>>>>>> upstream/main Extract the FMU variables and meta data from the ModelDescription @@ -671,7 +675,6 @@ end ################################ """ - fmi2GetDefaultStartTime(md::fmi2ModelDescription) Returns startTime from DefaultExperiment if defined else defaults to nothing. @@ -690,7 +693,6 @@ function fmi2GetDefaultStartTime(md::fmi2ModelDescription) end """ - fmi2GetDefaultStopTime(md::fmi2ModelDescription) Returns stopTime from DefaultExperiment if defined else defaults to nothing. @@ -710,7 +712,6 @@ function fmi2GetDefaultStopTime(md::fmi2ModelDescription) end """ - fmi2GetDefaultTolerance(md::fmi2ModelDescription) Returns tolerance from DefaultExperiment if defined else defaults to nothing. @@ -730,7 +731,6 @@ function fmi2GetDefaultTolerance(md::fmi2ModelDescription) end """ - fmi2GetDefaultStepSize(md::fmi2ModelDescription) Returns stepSize from DefaultExperiment if defined else defaults to nothing. @@ -750,7 +750,6 @@ function fmi2GetDefaultStepSize(md::fmi2ModelDescription) end """ - fmi2GetModelName(md::fmi2ModelDescription) Returns the tag 'modelName' from the model description. @@ -766,7 +765,6 @@ function fmi2GetModelName(md::fmi2ModelDescription)#, escape::Bool = true) end """ - fmi2GetGUID(md::fmi2ModelDescription) Returns the tag 'guid' from the model description. @@ -783,7 +781,6 @@ function fmi2GetGUID(md::fmi2ModelDescription) end """ - fmi2GetGenerationTool(md::fmi2ModelDescription) Returns the tag 'generationtool' from the model description. @@ -800,7 +797,6 @@ function fmi2GetGenerationTool(md::fmi2ModelDescription) end """ - fmi2GetGenerationDateAndTime(md::fmi2ModelDescription) Returns the tag 'generationdateandtime' from the model description. @@ -817,7 +813,6 @@ function fmi2GetGenerationDateAndTime(md::fmi2ModelDescription) end """ - fmi2GetVariableNamingConvention(md::fmi2ModelDescription) Returns the tag 'varaiblenamingconvention' from the model description. @@ -834,7 +829,6 @@ function fmi2GetVariableNamingConvention(md::fmi2ModelDescription) end """ - fmi2GetNumberOfEventIndicators(md::fmi2ModelDescription) Returns the tag 'numberOfEventIndicators' from the model description. @@ -851,7 +845,6 @@ function fmi2GetNumberOfEventIndicators(md::fmi2ModelDescription) end """ - fmi2GetNumberOfStates(md::fmi2ModelDescription) Returns the number of states of the FMU. @@ -868,7 +861,6 @@ function fmi2GetNumberOfStates(md::fmi2ModelDescription) end """ - fmi2IsCoSimulation(md::fmi2ModelDescription) Returns true, if the FMU supports co simulation @@ -885,7 +877,6 @@ function fmi2IsCoSimulation(md::fmi2ModelDescription) end """ - fmi2IsModelExchange(md::fmi2ModelDescription) Returns true, if the FMU supports model exchange @@ -906,7 +897,6 @@ end ################################## """ - fmi2DependenciesSupported(md::fmi2ModelDescription) Returns true if the FMU model description contains `dependency` information. @@ -927,7 +917,6 @@ function fmi2DependenciesSupported(md::fmi2ModelDescription) end """ - fmi2DerivativeDependenciesSupported(md::fmi2ModelDescription) Returns if the FMU model description contains `dependency` information for `derivatives`. @@ -953,7 +942,6 @@ function fmi2DerivativeDependenciesSupported(md::fmi2ModelDescription) end """ - fmi2GetModelIdentifier(md::fmi2ModelDescription; type=nothing) Returns the tag 'modelIdentifier' from CS or ME section. @@ -986,7 +974,6 @@ function fmi2GetModelIdentifier(md::fmi2ModelDescription; type=nothing) end """ - fmi2CanGetSetState(md::fmi2ModelDescription) Returns true, if the FMU supports the getting/setting of states @@ -1003,7 +990,6 @@ function fmi2CanGetSetState(md::fmi2ModelDescription) end """ - fmi2CanSerializeFMUstate(md::fmi2ModelDescription) Returns true, if the FMU state can be serialized @@ -1020,7 +1006,6 @@ function fmi2CanSerializeFMUstate(md::fmi2ModelDescription) end """ - fmi2ProvidesDirectionalDerivative(md::fmi2ModelDescription) Returns true, if the FMU provides directional derivatives @@ -1037,7 +1022,6 @@ function fmi2ProvidesDirectionalDerivative(md::fmi2ModelDescription) end """ - fmi2GetValueReferencesAndNames(md::fmi2ModelDescription; vrs=md.valueReferences) Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of value references and their corresponding names. @@ -1061,7 +1045,6 @@ function fmi2GetValueReferencesAndNames(md::fmi2ModelDescription; vrs=md.valueRe end """ - fmi2GetValueReferencesAndNames(fmu::FMU2) Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of value references and their corresponding names. @@ -1078,7 +1061,6 @@ function fmi2GetValueReferencesAndNames(fmu::FMU2) end """ - fmi2GetNames(md::fmi2ModelDescription; vrs=md.valueReferences, mode=:first) Returns a array of names corresponding to value references `vrs`. @@ -1114,7 +1096,6 @@ function fmi2GetNames(md::fmi2ModelDescription; vrs=md.valueReferences, mode=:fi end """ - fmi2GetNames(fmu::FMU2; vrs=md.valueReferences, mode=:first) Returns a array of names corresponding to value references `vrs`. @@ -1134,7 +1115,6 @@ function fmi2GetNames(fmu::FMU2; kwargs...) end """ - fmi2GetModelVariableIndices(md::fmi2ModelDescription; vrs=md.valueReferences) Returns a array of indices corresponding to value references `vrs` @@ -1162,7 +1142,6 @@ function fmi2GetModelVariableIndices(md::fmi2ModelDescription; vrs=md.valueRefer end """ - fmi2GetInputValueReferencesAndNames(md::fmi2ModelDescription) Returns a dict with (vrs, names of inputs). @@ -1181,7 +1160,6 @@ function fmi2GetInputValueReferencesAndNames(md::fmi2ModelDescription) end """ - fmi2GetInputValueReferencesAndNames(fmu::FMU2) Returns a dict with (vrs, names of inputs). @@ -1199,7 +1177,6 @@ function fmi2GetInputValueReferencesAndNames(fmu::FMU2) end """ - fmi2GetInputNames(md::fmi2ModelDescription; vrs=md.inputvalueReferences, mode=:first) Returns names of inputs. @@ -1220,7 +1197,6 @@ function fmi2GetInputNames(md::fmi2ModelDescription; kwargs...) end """ - fmi2GetInputNames(fmu::FMU2; vrs=md.inputValueReferences, mode=:first) Returns names of inputs. @@ -1241,7 +1217,6 @@ function fmi2GetInputNames(fmu::FMU2; kwargs...) end """ - fmi2GetOutputValueReferencesAndNames(md::fmi2ModelDescription) Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of value references and their corresponding names. @@ -1261,7 +1236,6 @@ function fmi2GetOutputValueReferencesAndNames(md::fmi2ModelDescription) end """ - fmi2GetOutputValueReferencesAndNames(md::fmi2ModelDescription) Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of value references and their corresponding names. @@ -1278,7 +1252,6 @@ function fmi2GetOutputValueReferencesAndNames(fmu::FMU2) end """ - fmi2GetOutputNames(md::fmi2ModelDescription; vrs=md.outputvalueReferences, mode=:first) Returns names of outputs. @@ -1298,7 +1271,6 @@ function fmi2GetOutputNames(md::fmi2ModelDescription; kwargs...) end """ - fmi2GetOutputNames(fmu::FMU2; vrs=md.outputvalueReferences, mode=:first) Returns names of outputs. @@ -1318,7 +1290,6 @@ function fmi2GetOutputNames(fmu::FMU2; kwargs...) end """ - fmi2GetParameterValueReferencesAndNames(md::fmi2ModelDescription) Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of parameterValueReferences and their corresponding names. @@ -1329,14 +1300,13 @@ Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of parameterValue # Returns - `dict::Dict{fmi2ValueReference, Array{String}}`: Returns a dictionary that constructs a hash table with keys of type fmi2ValueReference and values of type Array{String}. So returns a dict with (vrs, names of parameters). -See also ['fmi2GetValueReferencesAndNames'](@ref). +See also [`fmi2GetValueReferencesAndNames`](@ref). """ function fmi2GetParameterValueReferencesAndNames(md::fmi2ModelDescription) fmi2GetValueReferencesAndNames(md::fmi2ModelDescription; vrs=md.parameterValueReferences) end """ - fmi2GetParameterValueReferencesAndNames(fmu::FMU2) Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of parameterValueReferences and their corresponding names. @@ -1347,14 +1317,13 @@ Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of parameterValue # Returns - `dict::Dict{fmi2ValueReference, Array{String}}`: Returns a dictionary that constructs a hash table with keys of type fmi2ValueReference and values of type Array{String}. So returns a dict with (vrs, names of parameters). -See also ['fmi2GetValueReferencesAndNames'](@ref). +See also [`fmi2GetValueReferencesAndNames`](@ref). """ function fmi2GetParameterValueReferencesAndNames(fmu::FMU2) fmi2GetParameterValueReferencesAndNames(fmu.modelDescription) end """ - fmi2GetParameterNames(md::fmi2ModelDescription; vrs=md.parameterValueReferences, mode=:first) Returns names of parameters. @@ -1368,14 +1337,13 @@ Returns names of parameters. # Returns - `names::Array{String}`: Returns a array of names corresponding to parameter value references `vrs` -See also ['fmi2GetNames'](@ref). + """ function fmi2GetParameterNames(md::fmi2ModelDescription; kwargs...) fmi2GetNames(md; vrs=md.parameterValueReferences, kwargs...) end """ - fmi2GetParameterNames(fmu::FMU2; vrs=md.parameterValueReferences, mode=:first) Returns names of parameters. @@ -1389,14 +1357,13 @@ Returns names of parameters. # Returns - `names::Array{String}`: Returns a array of names corresponding to parameter value references `vrs` -See also ['fmi2GetNames'](@ref). + """ function fmi2GetParameterNames(fmu::FMU2; kwargs...) fmi2GetParameterNames(fmu.modelDescription; kwargs...) end """ - fmi2GetStateValueReferencesAndNames(md::fmi2ModelDescription) Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of state value references and their corresponding names. @@ -1413,7 +1380,6 @@ function fmi2GetStateValueReferencesAndNames(md::fmi2ModelDescription) end """ - fmi2GetStateValueReferencesAndNames(fmu::FMU2) Returns dict(vrs, names of states). @@ -1432,7 +1398,6 @@ function fmi2GetStateValueReferencesAndNames(fmu::FMU2) end """ - fmi2GetStateNames(fmu::FMU2; vrs=md.stateValueReferences, mode=:first) Returns names of states. @@ -1446,14 +1411,13 @@ Returns names of states. # Returns - `names::Array{String}`: Returns a array of names corresponding to parameter value references `vrs` -See also ['fmi2GetNames'](@ref). + """ function fmi2GetStateNames(md::fmi2ModelDescription; kwargs...) fmi2GetNames(md; vrs=md.stateValueReferences, kwargs...) end """ - fmi2GetStateNames(fmu::FMU2; vrs=md.stateValueReferences, mode=:first) Returns names of states. @@ -1467,14 +1431,13 @@ Returns names of states. # Returns - `names::Array{String}`: Returns a array of names corresponding to parameter value references `vrs` -See also ['fmi2GetNames'](@ref). + """ function fmi2GetStateNames(fmu::FMU2; kwargs...) fmi2GetStateNames(fmu.modelDescription; kwargs...) end """ - fmi2GetDerivateValueReferencesAndNames(md::fmi2ModelDescription) Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of derivative value references and their corresponding names. @@ -1484,14 +1447,13 @@ Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of derivative val # Returns - `dict::Dict{fmi2ValueReference, Array{String}}`: Returns a dictionary that constructs a hash table with keys of type fmi2ValueReference and values of type Array{String}. So returns a dict with (vrs, names of derivatives) -See also ['fmi2GetValueReferencesAndNames'](@ref) +See also [fmi2GetValueReferencesAndNames`](@ref) """ function fmi2GetDerivateValueReferencesAndNames(md::fmi2ModelDescription) fmi2GetValueReferencesAndNames(md::fmi2ModelDescription; vrs=md.derivativeValueReferences) end """ - fmi2GetDerivateValueReferencesAndNames(fmu::FMU2) Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of derivative value references and their corresponding names. @@ -1501,14 +1463,13 @@ Returns a dictionary `Dict(fmi2ValueReference, Array{String})` of derivative val # Returns - `dict::Dict{fmi2ValueReference, Array{String}}`: Returns a dictionary that constructs a hash table with keys of type fmi2ValueReference and values of type Array{String}. So returns a dict with (vrs, names of derivatives) -See also ['fmi2GetValueReferencesAndNames'](@ref) +See also [fmi2GetValueReferencesAndNames`](@ref) """ function fmi2GetDerivateValueReferencesAndNames(fmu::FMU2) fmi2GetDerivateValueReferencesAndNames(fmu.modelDescription) end """ - fmi2GetDerivativeNames(md::fmi2ModelDescription; vrs=md.derivativeValueReferences, mode=:first) Returns names of derivatives. @@ -1522,14 +1483,13 @@ Returns names of derivatives. # Returns - `names::Array{String}`: Returns a array of names corresponding to parameter value references `vrs` -See also ['fmi2GetNames'](@ref). + """ function fmi2GetDerivativeNames(md::fmi2ModelDescription; kwargs...) fmi2GetNames(md; vrs=md.derivativeValueReferences, kwargs...) end """ - fmi2GetDerivativeNames(fmu::FMU2; vrs=md.derivativeValueReferences, mode=:first) Returns names of derivatives. @@ -1543,14 +1503,13 @@ Returns names of derivatives. # Returns - `names::Array{String}`: Returns a array of names corresponding to parameter value references `vrs` -See also ['fmi2GetNames'](@ref). + """ function fmi2GetDerivativeNames(fmu::FMU2; kwargs...) fmi2GetDerivativeNames(fmu.modelDescription; kwargs...) end """ - fmi2GetNamesAndDescriptions(md::fmi2ModelDescription) Returns a dictionary of variables with their descriptions. @@ -1566,7 +1525,6 @@ function fmi2GetNamesAndDescriptions(md::fmi2ModelDescription) end """ - fmi2GetNamesAndDescriptions(fmu::FMU2) Returns a dictionary of variables with their descriptions. @@ -1582,7 +1540,6 @@ function fmi2GetNamesAndDescriptions(fmu::FMU2) end """ - fmi2GetNamesAndUnits(md::fmi2ModelDescription) Returns a dictionary of variables with their units. @@ -1599,7 +1556,6 @@ function fmi2GetNamesAndUnits(md::fmi2ModelDescription) end """ - fmi2GetNamesAndUnits(fmu::FMU2) Returns a dictionary of variables with their units. @@ -1616,7 +1572,6 @@ function fmi2GetNamesAndUnits(fmu::FMU2) end """ - fmi2GetNamesAndInitials(md::fmi2ModelDescription) Returns a dictionary of variables with their initials. @@ -1633,7 +1588,6 @@ function fmi2GetNamesAndInitials(md::fmi2ModelDescription) end """ - fmi2GetNamesAndInitials(fmu::FMU2) Returns a dictionary of variables with their initials. @@ -1650,7 +1604,6 @@ function fmi2GetNamesAndInitials(fmu::FMU2) end """ - fmi2GetInputNamesAndStarts(md::fmi2ModelDescription) Returns a dictionary of input variables with their starting values. @@ -1660,7 +1613,7 @@ Returns a dictionary of input variables with their starting values. # Returns - `dict::Dict{String, Array{fmi2ValueReferenceFormat}}`: Returns a dictionary that constructs a hash table with keys of type String and values of type fmi2ValueReferenceFormat. So returns a dict with ( `md.modelVariables[i].name::String`, `starts:: Array{fmi2ValueReferenceFormat}` ). (Creates a tuple (name, starts) for each i in inputIndices) -See also ['fmi2GetStartValue'](@ref). +See also [`fmi2GetStartValue`](@ref). """ function fmi2GetInputNamesAndStarts(md::fmi2ModelDescription) @@ -1669,7 +1622,6 @@ function fmi2GetInputNamesAndStarts(md::fmi2ModelDescription) end """ - fmi2GetInputNamesAndStarts(fmu::FMU2) Returns a dictionary of input variables with their starting values. @@ -1679,7 +1631,7 @@ Returns a dictionary of input variables with their starting values. # Returns - `dict::Dict{String, Array{fmi2ValueReferenceFormat}}`: Returns a dictionary that constructs a hash table with keys of type String and values of type fmi2ValueReferenceFormat. So returns a dict with ( `md.modelVariables[i].name::String`, `starts:: Array{fmi2ValueReferenceFormat}` ). (Creates a tuple (name, starts) for each i in inputIndices) -See also ['fmi2GetStartValue'](@ref). +See also [`fmi2GetStartValue`](@ref). """ function fmi2GetInputNamesAndStarts(fmu::FMU2) fmi2GetInputNamesAndStarts(fmu.modelDescription) diff --git a/src/FMIImport.jl b/src/FMIImport.jl index 8329a26..06b7045 100644 --- a/src/FMIImport.jl +++ b/src/FMIImport.jl @@ -53,7 +53,7 @@ export fmi2GetFMUstate!, fmi2SetFMUstate, fmi2FreeFMUstate!, fmi2SerializedFMUst export fmi2GetDirectionalDerivative!, fmi2SetRealInputDerivatives, fmi2GetRealOutputDerivatives export fmi2DoStep, fmi2CancelStep, fmi2GetStatus!, fmi2GetRealStatus!, fmi2GetIntegerStatus!, fmi2GetBooleanStatus!, fmi2GetStringStatus! export fmi2SetTime, fmi2SetContinuousStates, fmi2EnterEventMode, fmi2NewDiscreteStates!, fmi2EnterContinuousTimeMode, fmi2CompletedIntegratorStep! -export fmi2GetDerivatives!, fmi2GetEventIndicators!, fmi2GetContinuousStates!, fmi2GetNominalsOfContinuousStates! +export fmi2GetDerivatives!, fmi2GetEventIndicators!, fmi2GetContinuousStates!, fmi2GetNominalsOfContinuousStates!, fmi2GetRealOutputDerivatives! # FMI2_convert.jl export fmi2StringToValueReference, fmi2ValueReferenceToString, fmi2ModelVariablesForValueReference @@ -62,8 +62,8 @@ export fmi2GetSolutionState, fmi2GetSolutionTime, fmi2GetSolutionValue, fmi2GetS # FMI2_int.jl # almost everything exported in `FMI2_c.jl` export fmi2GetReal, fmi2GetInteger, fmi2GetString, fmi2GetBoolean -export fmi2GetFMUstate, fmi2SerializedFMUstateSize, fmi2SerializeFMUstate, fmi2DeSerializeFMUstate -export fmi2GetDirectionalDerivative +export fmi2GetFMUstate, fmi2SerializedFMUstateSize, fmi2SerializeFMUstate, fmi2DeSerializeFMUstate, fmi2NewDiscreteStates +export fmi2GetDirectionalDerivative, fmi2GetDerivatives, fmi2GetEventIndicators, fmi2GetNominalsOfContinuousStates export fmi2CompletedIntegratorStep # FMI2_ext.jl @@ -77,11 +77,11 @@ export fmi2GetContinuousStates # FMI2_md.jl export fmi2LoadModelDescription export fmi2GetDefaultStartTime, fmi2GetDefaultStopTime, fmi2GetDefaultTolerance, fmi2GetDefaultStepSize -export fmi2GetModelName, fmi2GetGUID, fmi2GetGenerationTool, fmi2GetGenerationDateAndTime, fmi2GetVariableNamingConvention, fmi2GetNumberOfEventIndicators, fmi2GetNumberOfStates, fmi2IsCoSimulation, fmi2IsModelExchange +export fmi2GetModelName, fmi2GetGUID, fmi2GetGenerationTool, fmi2GetGenerationDateAndTime, fmi2GetVariableNamingConvention, fmi2GetNumberOfEventIndicators, fmi2GetNumberOfStates, fmi2IsCoSimulation, fmi2IsModelExchange, fmi2GetNames, fmi2GetModelVariableIndices export fmi2DependenciesSupported, fmi2DerivativeDependenciesSupported, fmi2GetModelIdentifier, fmi2CanGetSetState, fmi2CanSerializeFMUstate, fmi2ProvidesDirectionalDerivative export fmi2GetInputValueReferencesAndNames, fmi2GetOutputValueReferencesAndNames, fmi2GetParameterValueReferencesAndNames, fmi2GetStateValueReferencesAndNames, fmi2GetDerivativeValueReferencesAndNames export fmi2GetInputNames, fmi2GetOutputNames, fmi2GetParameterNames, fmi2GetStateNames, fmi2GetDerivativeNames -export fmi2GetValueReferencesAndNames, fmi2GetNamesAndDescriptions, fmi2GetNamesAndUnits, fmi2GetNamesAndInitials, fmi2GetInputNamesAndStarts +export fmi2GetValueReferencesAndNames, fmi2GetNamesAndDescriptions, fmi2GetNamesAndUnits, fmi2GetNamesAndInitials, fmi2GetInputNamesAndStarts, fmi2GetDerivateValueReferencesAndNames # FMI2_fmu_to_md.jl # everything exported in `FMI2_md.jl`