diff --git a/docs/make.jl b/docs/make.jl index ed3a875c..f00ca742 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -12,7 +12,8 @@ makedocs(sitename="FMI.jl", collapselevel = 1, sidebar_sitename = false, edit_link = nothing, - size_threshold_ignore = ["library.md","deprecated.md","fmi2_lowlevel_librarys.md","fmi3_lowlevel_librarys.md"] + size_threshold = 512000, + size_threshold_ignore = ["deprecated.md"] ), modules = [FMI, FMIImport, FMICore], checkdocs=:exports, @@ -39,8 +40,27 @@ makedocs(sitename="FMI.jl", "fmi_lowlevel_library_constants.md", "fmi_lowlevel_library_functions.md" ], - "FMI2 specific content" => "fmi2_lowlevel_librarys.md", - "FMI3 specific content" => "fmi3_lowlevel_librarys.md" + "FMI2 specific content" => Any[ + "fmi2_lowlevel_library_types.md", + "fmi2_lowlevel_library_constants.md", + "FMI2 Functions in FMI Import/Core .jl" => Any[ + "fmi2_lowlevel_modeldescription_functions.md", + "fmi2_lowlevel_library_functions.md", + "fmi2_lowlevel_ME_functions.md", + "fmi2_lowlevel_CS_functions.md", + ] + ], + "FMI3 specific content" => Any[ + "fmi3_lowlevel_library_types.md", + "fmi3_lowlevel_library_constants.md", + "FMI3 Functions in FMI Import/Core .jl" => Any[ + "fmi3_lowlevel_modeldescription_functions.md", + "fmi3_lowlevel_library_functions.md", + "fmi3_lowlevel_ME_functions.md", + "fmi3_lowlevel_CS_functions.md", + "fmi3_lowlevel_SE_functions.md", + ] + ], ] "API Index" => "index_library.md" "FMI Tool Information" => "fmi-tool-info.md" diff --git a/docs/src/fmi2_lowlevel_CS_functions.md b/docs/src/fmi2_lowlevel_CS_functions.md new file mode 100644 index 00000000..2523672b --- /dev/null +++ b/docs/src/fmi2_lowlevel_CS_functions.md @@ -0,0 +1,34 @@ +# FMI for Co-Simulation +This chapter defines the Functional Mock-up Interface (FMI) for the coupling of two or more simulation +models in a Co-Simulation environment (FMI for Co-Simulation). Co-Simulation is a rather general +approach to the simulation of coupled technical systems and coupled physical phenomena in +engineering with focus on instationary (time-dependent) problems. + + +## Transfer of Input / Output Values and Parameters +In order to enable the slave to interpolate the continuous real inputs between communication steps, the +derivatives of the inputs with respect to time can be provided. Also, higher derivatives can be set to allow +higher order interpolation. + +```@docs +fmi2GetRealOutputDerivatives +``` + +## Computation +The computation of time steps is controlled by the following function. + +```@docs +fmi2DoStep +fmi2CancelStep +``` + +## Retrieving Status Information from the Slave +Status information is retrieved from the slave by the following functions: + +```@docs +fmi2GetStatus! +fmi2GetRealStatus! +fmi2GetIntegerStatus! +fmi2GetBooleanStatus! +fmi2GetStringStatus! +``` diff --git a/docs/src/fmi2_lowlevel_ME_functions.md b/docs/src/fmi2_lowlevel_ME_functions.md new file mode 100644 index 00000000..c6d862af --- /dev/null +++ b/docs/src/fmi2_lowlevel_ME_functions.md @@ -0,0 +1,30 @@ +# FMI for Model Exchange +This chapter contains the interface description to access the equations of a dynamic system from a C +program. + +## Providing Independent Variables and Re-initialization of Caching +Depending on the situation, different variables need to be computed. In order to be efficient, it is important that the interface requires only the computation of variables that are needed in the present context. The state derivatives shall be reused from the previous call. This feature is called “caching of variables” in the sequel. Caching requires that the model evaluation can detect when the input arguments, like time or states, have changed. + +```@docs +fmi2SetTime +fmi2SetContinuousStates +``` + +## Evaluation of Model Equations + +```@docs +fmi2EnterEventMode +fmi2NewDiscreteStates +fmi2NewDiscreteStates! +fmi2EnterContinuousTimeMode +fmi2CompletedIntegratorStep +fmi2CompletedIntegratorStep! +fmi2GetDerivatives +fmi2GetDerivatives! +fmi2GetEventIndicators +fmi2GetEventIndicators! +fmi2GetContinuousStates +fmi2GetContinuousStates! +fmi2GetNominalsOfContinuousStates +fmi2GetNominalsOfContinuousStates! +``` diff --git a/docs/src/fmi2_lowlevel_library_constants.md b/docs/src/fmi2_lowlevel_library_constants.md new file mode 100644 index 00000000..c1a79d37 --- /dev/null +++ b/docs/src/fmi2_lowlevel_library_constants.md @@ -0,0 +1,12 @@ +# FMI2 Constants in FMI Import/Core .jl + +```@docs +fmi2True +fmi2False +fmi2StatusOK +fmi2StatusWarning +fmi2StatusPending +fmi2StatusError +fmi2StatusDiscard +fmi2StatusFatal +``` \ No newline at end of file diff --git a/docs/src/fmi2_lowlevel_library_functions.md b/docs/src/fmi2_lowlevel_library_functions.md new file mode 100644 index 00000000..d3feb5dc --- /dev/null +++ b/docs/src/fmi2_lowlevel_library_functions.md @@ -0,0 +1,126 @@ +# FMI Common Concepts for Model Exchange and Co-Simulation +In both cases, FMI defines an input/output block of a dynamic model where the distribution of the block, the +platform dependent header file, several access functions, as well as the schema files are identical. + +## Opening and closing FMUs + +```@docs +fmi2Unzip +fmi2Load +fmi2Reload +fmi2Unload +``` + +## Creation, Destruction and Logging of FMU Instances + +```@docs +fmi2Instantiate! +fmi2Instantiate +fmi2FreeInstance! +fmi2SetDebugLogging +``` + +## Initialization, Termination, and Resetting an FMU + +```@docs +fmi2SetupExperiment +fmi2EnterInitializationMode +fmi2ExitInitializationMode +fmi2Terminate +fmi2Reset +``` + +## Getting and Setting Variable Values +All variable values of an FMU are identified with a variable handle called “value reference”. The handle is +defined in the modelDescription.xml file (as attribute “valueReference” in element +“ScalarVariable”). Element “valueReference” might not be unique for all variables. If two or more +variables of the same base data type (such as fmi2Real) have the same valueReference, then they +have identical values but other parts of the variable definition might be different (for example, min/max +attributes). + +```@docs +fmi2Get +fmi2Get! +fmi2Set +fmi2GetReal +fmi2GetReal! +fmi2GetInteger +fmi2GetInteger! +fmi2GetBoolean +fmi2GetBoolean! +fmi2GetString +fmi2GetString! +fmi2SetReal +fmi2SetInteger +fmi2SetBoolean +fmi2SetString +``` + +## Getting and Setting the Complete FMU State +The FMU has an internal state consisting of all values that are needed to continue a simulation. This internal state consists especially of the values of the continuous-time states, iteration variables, parameter values, input values, delay buffers, file identifiers, and FMU internal status information. With the functions of this section, the internal FMU state can be copied and the pointer to this copy is returned to the environment. The FMU state copy can be set as actual FMU state, in order to continue the simulation from it. + +```@docs +fmi2GetFMUstate +fmi2GetFMUstate! +fmi2SetFMUstate +fmi2FreeFMUstate! +fmi2SerializedFMUstateSize +fmi2SerializedFMUstateSize! +fmi2SerializeFMUstate +fmi2SerializeFMUstate! +fmi2DeSerializeFMUstate +fmi2DeSerializeFMUstate! +``` + +## Getting Partial Dervatives +It is optionally possible to provide evaluation of partial derivatives for an FMU. For Model Exchange, this +means computing the partial derivatives at a particular time instant. For Co-Simulation, this means to +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 +fmi2GetDirectionalDerivative! +fmi2SetRealInputDerivatives +fmi2GetRealOutputDerivatives! +fmi2SampleJacobian +fmi2SampleJacobian! +``` + +## Conversion functions + +```@docs +fmi2StringToValueReference +fmi2ValueReferenceToString +fmi2StringToCausality +fmi2CausalityToString +fmi2StringToVariability +fmi2VariabilityToString + +fmi2StatusToString +fmi2StringToDependencyKind +fmi2DependencyKindToString +fmi2StringToInitial +fmi2InitialToString +``` + +## External/Additional functions + +```@docs +fmi2GetSolutionDerivative +fmi2GetSolutionState +fmi2GetSolutionValue +fmi2GetSolutionTime +fmi2ModelVariablesForValueReference +getCurrentComponent +hasCurrentComponent +fmi2GetJacobian +fmi2GetJacobian! +fmi2GetFullJacobian +fmi2GetFullJacobian! +fmi2GetStartValue +fmi2GetUnit +fmi2GetDeclaredType +fmi2GetInitial +fmi2GetSimpleTypeAttributeStruct +``` diff --git a/docs/src/fmi2_lowlevel_library_types.md b/docs/src/fmi2_lowlevel_library_types.md new file mode 100644 index 00000000..b4cbc963 --- /dev/null +++ b/docs/src/fmi2_lowlevel_library_types.md @@ -0,0 +1,30 @@ +# FMI2 Types in FMI Import/Core .jl + +```@docs +FMU2 +FMU2Component +FMU2ComponentEnvironment +FMU2InputFunction +fmi2Struct +fmi2StructMD +fmi2Initial +FMU2Solution +fmi2ScalarVariable +fmi2SimpleType +fmi2Type +fmi2Unit +fmi2Char +FMIImport.fmi2ValueReferenceFormat +fmi2Variability +fmi2VariableDependency +fmi2DependencyKind +fmi2EventInfo +FMU2Event +FMU2ExecutionConfiguration +fmi2Status +fmi2Annotation +fmi2ModelDescription +fmi2FMUstate +fmi2StatusKind +fmi2Causality +``` \ No newline at end of file diff --git a/docs/src/fmi2_lowlevel_librarys.md b/docs/src/fmi2_lowlevel_librarys.md deleted file mode 100644 index c582028a..00000000 --- a/docs/src/fmi2_lowlevel_librarys.md +++ /dev/null @@ -1,295 +0,0 @@ - -# [FMI Import/Core .jl Library Functions/Types for FMI2](@id fmi2importlibrary) -```@docs -FMU2 -FMU2Component -FMU2ComponentEnvironment -FMU2InputFunction -fmi2Struct -fmi2StructMD -fmi2Initial -FMU2Solution -fmi2ScalarVariable -fmi2SimpleType -fmi2Type -fmi2Unit -fmi2Char -fmi2True -fmi2False -FMIImport.fmi2ValueReferenceFormat -fmi2Variability -fmi2VariableDependency -fmi2DependencyKind -fmi2EventInfo -FMU2Event -FMU2ExecutionConfiguration -fmi2Status -fmi2StatusOK -fmi2StatusWarning -fmi2StatusPending -fmi2StatusError -fmi2StatusDiscard -fmi2StatusFatal -fmi2Annotation -``` - -## FMI Common Concepts for Model Exchange and Co-Simulation -In both cases, FMI defines an input/output block of a dynamic model where the distribution of the block, the -platform dependent header file, several access functions, as well as the schema files are identical. - -### [Reading the model description](@id fmi2importlibraryreadingthemodeldescription) -This section documents functions to inquire information about the model description of an FMU. - -#### Load/Parse the FMI model description -```@docs -fmi2ModelDescription -fmi2LoadModelDescription -``` - -#### Get value functions -```@docs -fmi2GetDefaultStartTime -fmi2GetDefaultStopTime -fmi2GetDefaultTolerance -fmi2GetDefaultStepSize -fmi2GetModelName -fmi2GetGUID -fmi2GetGenerationTool -fmi2GetGenerationDateAndTime -fmi2GetVariableNamingConvention -fmi2GetNumberOfEventIndicators -fmi2GetNumberOfStates -fmi2IsCoSimulation -fmi2IsModelExchange -``` - -#### Information functions - -```@docs -fmi2DependenciesSupported -fmi2DerivativeDependenciesSupported -fmi2GetModelIdentifier -fmi2CanGetSetState -fmi2CanSerializeFMUstate -fmi2ProvidesDirectionalDerivative -fmi2GetValueReferencesAndNames -fmi2GetNames -fmi2GetModelVariableIndices -fmi2GetInputValueReferencesAndNames -fmi2GetInputNames -fmi2GetOutputValueReferencesAndNames -fmi2GetOutputNames -fmi2GetParameterValueReferencesAndNames -fmi2GetParameterNames -fmi2GetStateValueReferencesAndNames -fmi2GetStateNames -fmi2GetDerivateValueReferencesAndNames -fmi2GetDerivativeNames -fmi2GetNamesAndDescriptions -fmi2GetNamesAndUnits -fmi2GetNamesAndInitials -fmi2GetInputNamesAndStarts -fmi2GetVersion -fmi2GetTypesPlatform -fmi2GetSolutionDerivative -fmi2StringToVariability -fmi2VariabilityToString -fmi2StatusToString -fmi2DataTypeForValueReference -fmi2DependencyKindToString -fmi2StringToDependencyKind -``` - -### Creation, Destruction and Logging of FMU Instances -This section documents functions that deal with instantiation, destruction and logging of FMUs. - -```@docs -fmi2Instantiate! -fmi2Instantiate -fmi2FreeInstance! -fmi2SetDebugLogging -``` - -### Initialization, Termination, and Resetting an FMU -This section documents functions that deal with initialization, termination, resetting of an FMU. - -```@docs -fmi2SetupExperiment -fmi2EnterInitializationMode -fmi2ExitInitializationMode -fmi2Terminate -fmi2Reset -``` -### Getting and Setting Variable Values -All variable values of an FMU are identified with a variable handle called “value reference”. The handle is -defined in the modelDescription.xml file (as attribute “valueReference” in element -“ScalarVariable”). Element “valueReference” might not be unique for all variables. If two or more -variables of the same base data type (such as fmi2Real) have the same valueReference, then they -have identical values but other parts of the variable definition might be different [(for example, min/max -attributes)]. - -```@docs -fmi2Get -fmi2Get! -fmi2Set -fmi2GetReal -fmi2GetReal! -fmi2GetInteger -fmi2GetInteger! -fmi2GetBoolean -fmi2GetBoolean! -fmi2GetString -fmi2GetString! -fmi2SetReal -fmi2SetInteger -fmi2SetBoolean -fmi2SetString -``` - - -### Getting and Setting the Complete FMU State -The FMU has an internal state consisting of all values that are needed to continue a simulation. This internal state consists especially of the values of the continuous-time states, iteration variables, parameter values, input values, delay buffers, file identifiers, and FMU internal status information. With the functions of this section, the internal FMU state can be copied and the pointer to this copy is returned to the environment. The FMU state copy can be set as actual FMU state, in order to continue the simulation from it. - -```@docs -fmi2FMUstate -fmi2GetFMUstate -fmi2GetFMUstate! -fmi2SetFMUstate -fmi2FreeFMUstate! -fmi2SerializedFMUstateSize -fmi2SerializedFMUstateSize! -fmi2SerializeFMUstate -fmi2SerializeFMUstate! -fmi2DeSerializeFMUstate -fmi2DeSerializeFMUstate! -``` - -### Getting Partial Dervatives -It is optionally possible to provide evaluation of partial derivatives for an FMU. For Model Exchange, this -means computing the partial derivatives at a particular time instant. For Co-Simulation, this means to -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 -fmi2GetDirectionalDerivative! -fmi2SetRealInputDerivatives -fmi2GetRealOutputDerivatives! -fmi2SampleJacobian -fmi2SampleJacobian! -``` - -## FMI for Model Exchange - -This chapter contains the interface description to access the equations of a dynamic system from a C -program. - -### Providing Independent Variables and Re-initialization of Caching -Depending on the situation, different variables need to be computed. In order to be efficient, it is important that the interface requires only the computation of variables that are needed in the present context. The state derivatives shall be reused from the previous call. This feature is called “caching of variables” in the sequel. Caching requires that the model evaluation can detect when the input arguments, like time or states, have changed. - -```@docs -fmi2SetTime -fmi2SetContinuousStates -``` - -### Evaluation of Model Equations -This section contains the core functions to evaluate the model equations. - - -```@docs -fmi2EnterEventMode -fmi2NewDiscreteStates -fmi2NewDiscreteStates! -fmi2EnterContinuousTimeMode -fmi2CompletedIntegratorStep -fmi2CompletedIntegratorStep! -fmi2GetDerivatives -fmi2GetDerivatives! -fmi2GetEventIndicators -fmi2GetEventIndicators! -fmi2GetContinuousStates -fmi2GetContinuousStates! -fmi2GetNominalsOfContinuousStates -fmi2GetNominalsOfContinuousStates! -``` - -## FMI for Co-Simulation -This chapter defines the Functional Mock-up Interface (FMI) for the coupling of two or more simulation -models in a Co-Simulation environment (FMI for Co-Simulation). Co-Simulation is a rather general -approach to the simulation of coupled technical systems and coupled physical phenomena in -engineering with focus on instationary (time-dependent) problems. - - -### Transfer of Input / Output Values and Parameters -In order to enable the slave to interpolate the continuous real inputs between communication steps, the -derivatives of the inputs with respect to time can be provided. Also, higher derivatives can be set to allow -higher order interpolation. - -```@docs -fmi2GetRealOutputDerivatives -``` - -### Computation -The computation of time steps is controlled by the following function. - -```@docs -fmi2StatusKind -fmi2DoStep -fmi2CancelStep -``` - -### Retrieving Status Information from the Slave -Status information is retrieved from the slave by the following functions: - -```@docs -fmi2GetStatus! -fmi2GetRealStatus! -fmi2GetIntegerStatus! -fmi2GetBooleanStatus! -fmi2GetStringStatus! -``` - -## non FMI-spec functions -These new functions, that are useful, but not part of the FMI-spec. (example: `fmi2Load`, `fmi2SampleJacobian`) - -### Opening and closing FMUs -```@docs -fmi2Unzip -fmi2Unload -fmi2Load -fmi2Reload -``` - -### Conversion functions - -```@docs -fmi2StringToValueReference -fmi2ModelVariablesForValueReference -fmi2ValueReferenceToString -fmi2Causality -fmi2StringToCausality -fmi2CausalityToString -fmi2InitialToString -fmi2StringToInitial -fmi2GetSolutionState -fmi2GetSolutionValue -fmi2GetSolutionTime -``` - -### External/Additional functions - -```@docs -getCurrentComponent -hasCurrentComponent -fmi2GetJacobian -fmi2GetJacobian! -fmi2GetFullJacobian -fmi2GetFullJacobian! -fmi2GetStartValue -fmi2GetUnit -fmi2GetDeclaredType -fmi2GetInitial -fmi2GetSimpleTypeAttributeStruct -``` - diff --git a/docs/src/fmi2_lowlevel_modeldescription_functions.md b/docs/src/fmi2_lowlevel_modeldescription_functions.md new file mode 100644 index 00000000..7267bffa --- /dev/null +++ b/docs/src/fmi2_lowlevel_modeldescription_functions.md @@ -0,0 +1,99 @@ +# Working with the FMI model description + +The FMI model description provides all human readable information on the model. The following fuctions can be used to obtain all information provided by the model descripton, wich in turn can be extrated from the fmu. + +## Loading/Parsing + +```@docs +fmi2LoadModelDescription +``` + +## general information about the FMU + +```@docs +fmi2GetModelName +fmi2GetGUID +fmi2IsCoSimulation +fmi2IsModelExchange +fmi2GetGenerationTool +fmi2GetGenerationDateAndTime +``` + +## tecnical information about the FMU + +```@docs +fmi2GetModelIdentifier +fmi2GetVariableNamingConvention +fmi2GetVersion +fmi2GetTypesPlatform + +fmi2GetNumberOfEventIndicators +``` + +## default experiment settings + +```@docs +fmi2GetDefaultStartTime +fmi2GetDefaultStopTime +fmi2GetDefaultTolerance +fmi2GetDefaultStepSize +``` + +## FMU capabilities + +```@docs +fmi2DependenciesSupported +fmi2DerivativeDependenciesSupported +fmi2CanGetSetState +fmi2CanSerializeFMUstate +fmi2ProvidesDirectionalDerivative +``` + +## value references + +```@docs +fmi2GetValueReferencesAndNames +fmi2GetNames +fmi2GetModelVariableIndices +fmi2DataTypeForValueReference +``` + +## In-/Outputs + +```@docs +fmi2GetInputValueReferencesAndNames +fmi2GetInputNames +fmi2GetOutputValueReferencesAndNames +fmi2GetOutputNames +``` + +## Parameters + +```@docs +fmi2GetParameterValueReferencesAndNames +fmi2GetParameterNames +``` + +## States + +```@docs +fmi2GetNumberOfStates +fmi2GetStateValueReferencesAndNames +fmi2GetStateNames +``` + +## Derivatives + +```@docs +fmi2GetDerivateValueReferencesAndNames +fmi2GetDerivativeNames +``` + +## Variables + +```@docs +fmi2GetNamesAndDescriptions +fmi2GetNamesAndUnits +fmi2GetNamesAndInitials +fmi2GetInputNamesAndStarts +``` diff --git a/docs/src/fmi3_lowlevel_CS_functions.md b/docs/src/fmi3_lowlevel_CS_functions.md new file mode 100644 index 00000000..731073f3 --- /dev/null +++ b/docs/src/fmi3_lowlevel_CS_functions.md @@ -0,0 +1,29 @@ +# FMI for Co-Simulation +This chapter defines the Functional Mock-up Interface (FMI) for the coupling of two or more simulation +models in a Co-Simulation environment (FMI for Co-Simulation). Co-Simulation is a rather general +approach to the simulation of coupled technical systems and coupled physical phenomena in +engineering with focus on instationary (time-dependent) problems. + + +## Transfer of Input / Output Values and Parameters +In order to enable the slave to interpolate the continuous real inputs between communication steps, the +derivatives of the inputs with respect to time can be provided. Also, higher derivatives can be set to allow +higher order interpolation. + +```@docs +fmi3CallbackIntermediateUpdate +``` + +## Computation +The computation of time steps is controlled by the following function. + +```@docs +fmi3EnterStepMode +fmi3DoStep! +``` + +## Retrieving Status Information from the Slave +Status information is retrieved from the slave by the following functions: + +```@docs +``` diff --git a/docs/src/fmi3_lowlevel_ME_functions.md b/docs/src/fmi3_lowlevel_ME_functions.md new file mode 100644 index 00000000..f28ef4a2 --- /dev/null +++ b/docs/src/fmi3_lowlevel_ME_functions.md @@ -0,0 +1,26 @@ +# FMI for Model Exchange + +This chapter contains the interface description to access the equations of a dynamic system from a C +program. + +## Providing Independent Variables and Re-initialization of Caching +Depending on the situation, different variables need to be computed. In order to be efficient, it is important that the interface requires only the computation of variables that are needed in the present context. The state derivatives shall be reused from the previous call. This feature is called “caching of variables” in the sequel. Caching requires that the model evaluation can detect when the input arguments, like time or states, have changed. + +```@docs +fmi3SetTime +fmi3SetContinuousStates +``` + +## Evaluation of Model Equations + +```@docs +fmi3EnterEventMode +fmi3EnterContinuousTimeMode +fmi3CompletedIntegratorStep +fmi3CompletedIntegratorStep! +fmi3GetEventIndicators! +fmi3GetContinuousStates! +fmi3GetNominalsOfContinuousStates! +fmi3GetNumberOfContinuousStates +fmi3GetNumberOfContinuousStates! +``` diff --git a/docs/src/fmi3_lowlevel_SE_functions.md b/docs/src/fmi3_lowlevel_SE_functions.md new file mode 100644 index 00000000..32253d25 --- /dev/null +++ b/docs/src/fmi3_lowlevel_SE_functions.md @@ -0,0 +1 @@ +# FMI for Scheduled Execution \ No newline at end of file diff --git a/docs/src/fmi3_lowlevel_library_constants.md b/docs/src/fmi3_lowlevel_library_constants.md new file mode 100644 index 00000000..cb1ea073 --- /dev/null +++ b/docs/src/fmi3_lowlevel_library_constants.md @@ -0,0 +1,13 @@ +# FMI3 Constants in FMI Import/Core .jl + +```@docs +fmi3True +fmi3False +fmi3StatusOK +fmi3StatusWarning +fmi3StatusDiscard +fmi3StatusError +fmi3StatusFatal +fmi3VariableNamingConventionFlat +fmi3VariableNamingConventionStructured +``` diff --git a/docs/src/fmi3_lowlevel_library_functions.md b/docs/src/fmi3_lowlevel_library_functions.md new file mode 100644 index 00000000..f3d166a7 --- /dev/null +++ b/docs/src/fmi3_lowlevel_library_functions.md @@ -0,0 +1,179 @@ +# FMI Common Concepts for Model Exchange and Co-Simulation +In both cases, FMI defines an input/output block of a dynamic model where the distribution of the block, the +platform dependent header file, several access functions, as well as the schema files are identical. + +## Opening and closing FMUs + +```@docs +fmi3Unzip +fmi3Load +fmi3Reload +fmi3Unload +``` + +## Creation, Destruction and Logging of FMU Instances + +```@docs +fmi3InstantiateCoSimulation +fmi3InstantiateCoSimulation! +fmi3InstantiateModelExchange +fmi3InstantiateModelExchange! +fmi3InstantiateScheduledExecution +fmi3InstantiateScheduledExecution! +fmi3FreeInstance! +fmi3SetDebugLogging +``` + +## Initialization, Termination, and Resetting an FMU +This section documents functions that deal with initialization, termination, resetting of an FMU. + +```@docs +fmi3EnterInitializationMode +fmi3ExitInitializationMode +fmi3EnterConfigurationMode +fmi3ExitConfigurationMode +fmi3Terminate +fmi3Reset +``` + +## Getting and Setting Variable Values +All variable values of an FMU are identified with a variable handle called “value reference”. The handle is +defined in the modelDescription.xml file (as attribute “valueReference” in element +“ScalarVariable”). Element “valueReference” might not be unique for all variables. If two or more +variables of the same base data type (such as fmi3Float64) have the same valueReference, then they +have identical values but other parts of the variable definition might be different (for example, min/max +attributes). + +```@docs +fmi3Get +fmi3Get! +fmi3GetFloat32 +fmi3GetFloat32! +fmi3GetFloat64 +fmi3GetFloat64! +fmi3GetInt8 +fmi3GetInt8! +fmi3GetInt16 +fmi3GetInt16! +fmi3GetInt32 +fmi3GetInt32! +fmi3GetInt64 +fmi3GetInt64! +fmi3GetUInt8 +fmi3GetUInt8! +fmi3GetUInt16 +fmi3GetUInt16! +fmi3GetUInt32 +fmi3GetUInt32! +fmi3GetUInt64 +fmi3GetUInt64! +fmi3GetBoolean +fmi3GetBoolean! +fmi3GetString +fmi3GetString! +fmi3GetBinary +fmi3GetBinary! +fmi3Set +fmi3SetFloat32 +fmi3SetFloat64 +fmi3SetInt8 +fmi3SetInt16 +fmi3SetInt32 +fmi3SetInt64 +fmi3SetUInt8 +fmi3SetUInt16 +fmi3SetUInt32 +fmi3SetUInt64 +fmi3SetBoolean +fmi3SetString +fmi3SetBinary +``` + +## Getting and Setting the Complete FMU State +The FMU has an internal state consisting of all values that are needed to continue a simulation. This internal state consists especially of the values of the continuous-time states, iteration variables, parameter values, input values, delay buffers, file identifiers, and FMU internal status information. With the functions of this section, the internal FMU state can be copied and the pointer to this copy is returned to the environment. The FMU state copy can be set as actual FMU state, in order to continue the simulation from it. + +```@docs +fmi3GetFMUState +fmi3GetFMUState! +fmi3SetFMUState +fmi3FreeFMUState! +fmi3SerializeFMUState +fmi3SerializeFMUState! +fmi3SerializedFMUStateSize +fmi3SerializedFMUStateSize! +fmi3DeSerializeFMUState +fmi3DeSerializeFMUState! +fmi3UpdateDiscreteStates +fmi3EvaluateDiscreteStates +``` + +## Getting Partial Dervatives +It is optionally possible to provide evaluation of partial derivatives for an FMU. For Model Exchange, this +means computing the partial derivatives at a particular time instant. For Co-Simulation, this means to +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 +fmi3GetDirectionalDerivative +fmi3GetDirectionalDerivative! +fmi3SampleDirectionalDerivative +fmi3SampleDirectionalDerivative! +fmi3GetContinuousStateDerivatives +fmi3GetContinuousStateDerivatives! +fmi3GetAdjointDerivative! +fmi3GetOutputDerivatives +fmi3GetOutputDerivatives! +fmi3GetJacobian +fmi3GetJacobian! +fmi3GetFullJacobian +fmi3GetFullJacobian! +``` + +## TODO: Clockstuff + +```@docs +fmi3GetIntervalDecimal! +fmi3SetIntervalDecimal +fmi3GetIntervalFraction! +fmi3SetIntervalFraction +fmi3GetShiftDecimal! +fmi3GetShiftFraction! +fmi3GetClock +fmi3GetClock! +fmi3SetClock +fmi3ActivateModelPartition +fmi3CallbackClockUpdate +``` + +## Conversion functions + +```@docs +fmi3StringToValueReference +fmi3ValueReferenceToString +fmi3StringToCausality +fmi3CausalityToString +fmi3StringToVariability +fmi3VariabilityToString +fmi3StringToStatus +fmi3StatusToString +fmi3StringToDependencyKind +fmi3DependencyKindToString +fmi3StringToInitial +fmi3InitialToString +fmi3IntervalQualifierToString +fmi3StringToIntervalQualifier +fmi3StringToType +fmi3TypeToString +fmi3VariableNamingConventionToString +fmi3StringToVariableNamingConvention +``` + +## External/Additional functions + +```@docs +fmi3ModelVariablesForValueReference +fmi3GetStartValue + +fmi3GetNumberOfVariableDependencies! +fmi3GetVariableDependencies! +``` \ No newline at end of file diff --git a/docs/src/fmi3_lowlevel_library_types.md b/docs/src/fmi3_lowlevel_library_types.md new file mode 100644 index 00000000..6c74452e --- /dev/null +++ b/docs/src/fmi3_lowlevel_library_types.md @@ -0,0 +1,37 @@ +# FMI3 Types in FMI Import/Core .jl + +```@docs +FMU3 +FMU3Instance +FMU3InstanceEnvironment +fmi3Struct +fmi3StructMD +fmi3Initial +FMU3Solution +fmi3Variable +fmi3VariableDependency +fmi3SimpleType +fmi3Type +fmi3Unit +fmi3Float32 +fmi3Float64 +fmi3Int8 +fmi3Int16 +fmi3Int32 +fmi3Int64 +fmi3UInt8 +fmi3UInt16 +fmi3UInt32 +fmi3UInt64 +FMIImport.fmi3ValueReferenceFormat +fmi3IntervalQualifier +fmi3Variability +fmi3DependencyKind +FMU3Event +FMU3ExecutionConfiguration +fmi3Status +fmi3Annotation +fmi3ModelDescription +fmi3VariableNamingConvention +fmi3Causality +``` \ No newline at end of file diff --git a/docs/src/fmi3_lowlevel_librarys.md b/docs/src/fmi3_lowlevel_librarys.md deleted file mode 100644 index 9950a957..00000000 --- a/docs/src/fmi3_lowlevel_librarys.md +++ /dev/null @@ -1,328 +0,0 @@ - -# [FMI Import/Core .jl Library Functions/Types for FMI3](@id library) -```@docs -FMU3 -FMU3Instance -FMU3InstanceEnvironment -fmi3Struct -fmi3StructMD -fmi3Initial -FMU3Solution -fmi3Variable -fmi3VariableDependency -fmi3SimpleType -fmi3Type -fmi3Unit -fmi3Float32 -fmi3Float64 -fmi3Int8 -fmi3Int16 -fmi3Int32 -fmi3Int64 -fmi3UInt8 -fmi3UInt16 -fmi3UInt32 -fmi3UInt64 -fmi3True -fmi3False -FMIImport.fmi3ValueReferenceFormat -fmi3IntervalQualifier -fmi3Variability -fmi3DependencyKind -FMU3Event -FMU3ExecutionConfiguration -fmi3Status -fmi3StatusOK -fmi3StatusWarning -fmi3StatusDiscard -fmi3StatusError -fmi3StatusFatal -fmi3Annotation -``` - -## FMI Common Concepts for Model Exchange and Co-Simulation -In both cases, FMI defines an input/output block of a dynamic model where the distribution of the block, the -platform dependent header file, several access functions, as well as the schema files are identical. - -### Reading the model description -This section documents functions to inquire information about the model description of an FMU. - -#### Load/Parse the FMI model description -```@docs -fmi3ModelDescription -fmi3LoadModelDescription -``` -#### Get value functions -```@docs -fmi3GetDefaultStartTime -fmi3GetDefaultStopTime -fmi3GetDefaultTolerance -fmi3GetDefaultStepSize -fmi3GetModelName -fmi3GetInstantiationToken -fmi3GetGenerationTool -fmi3GetGenerationDateAndTime -fmi3GetVariableNamingConvention -fmi3GetNumberOfEventIndicators -fmi3GetNumberOfEventIndicators! -fmi3IsCoSimulation -fmi3IsModelExchange -fmi3IsScheduledExecution -``` - -#### Information functions - - -```@docs -fmi3GetModelIdentifier -fmi3ProvidesAdjointDerivatives -fmi3CanGetSetState -fmi3CanSerializeFMUState -fmi3ProvidesDirectionalDerivatives -fmi3GetVersion -fmi3VariableNamingConvention -fmi3VariableNamingConventionFlat -fmi3VariableNamingConventionStructured -fmi3VariableNamingConventionToString -fmi3StringToVariableNamingConvention -fmi3StringToVariability -fmi3VariabilityToString -fmi3StatusToString -fmi3StringToStatus -fmi3DependencyKindToString -fmi3StringToDependencyKind -``` - -### Creation, Destruction and Logging of FMU Instances -This section documents functions that deal with instantiation, destruction and logging of FMUs. - -```@docs -fmi3InstantiateCoSimulation -fmi3InstantiateCoSimulation! -fmi3InstantiateModelExchange -fmi3InstantiateModelExchange! -fmi3InstantiateScheduledExecution -fmi3InstantiateScheduledExecution! -fmi3FreeInstance! -fmi3SetDebugLogging - -``` - -### Initialization, Termination, and Resetting an FMU -This section documents functions that deal with initialization, termination, resetting of an FMU. - -```@docs -fmi3EnterInitializationMode -fmi3ExitInitializationMode -fmi3EnterConfigurationMode -fmi3ExitConfigurationMode -fmi3Terminate -fmi3Reset -``` -### Getting and Setting Variable Values -All variable values of an FMU are identified with a variable handle called “value reference”. The handle is -defined in the modelDescription.xml file (as attribute “valueReference” in element -“ScalarVariable”). Element “valueReference” might not be unique for all variables. If two or more -variables of the same base data type (such as fmi3Real) have the same valueReference, then they -have identical values but other parts of the variable definition might be different [(for example, min/max -attributes)]. - -```@docs -fmi3Get -fmi3Get! -fmi3GetFloat32 -fmi3GetFloat32! -fmi3GetFloat64 -fmi3GetFloat64! -fmi3GetInt8 -fmi3GetInt8! -fmi3GetInt16 -fmi3GetInt16! -fmi3GetInt32 -fmi3GetInt32! -fmi3GetInt64 -fmi3GetInt64! -fmi3GetUInt8 -fmi3GetUInt8! -fmi3GetUInt16 -fmi3GetUInt16! -fmi3GetUInt32 -fmi3GetUInt32! -fmi3GetUInt64 -fmi3GetUInt64! -fmi3GetBoolean -fmi3GetBoolean! -fmi3GetString -fmi3GetString! -fmi3GetBinary -fmi3GetBinary! -fmi3Set -fmi3SetFloat32 -fmi3SetFloat64 -fmi3SetInt8 -fmi3SetInt16 -fmi3SetInt32 -fmi3SetInt64 -fmi3SetUInt8 -fmi3SetUInt16 -fmi3SetUInt32 -fmi3SetUInt64 -fmi3SetBoolean -fmi3SetString -fmi3SetBinary -``` - - -### Getting and Setting the Complete FMU State -The FMU has an internal state consisting of all values that are needed to continue a simulation. This internal state consists especially of the values of the continuous-time states, iteration variables, parameter values, input values, delay buffers, file identifiers, and FMU internal status information. With the functions of this section, the internal FMU state can be copied and the pointer to this copy is returned to the environment. The FMU state copy can be set as actual FMU state, in order to continue the simulation from it. - -```@docs -fmi3GetFMUState -fmi3GetFMUState! -fmi3SetFMUState -fmi3FreeFMUState! -fmi3SerializeFMUState -fmi3SerializeFMUState! -fmi3SerializedFMUStateSize -fmi3SerializedFMUStateSize! -fmi3DeSerializeFMUState -fmi3DeSerializeFMUState! -fmi3UpdateDiscreteStates -fmi3EvaluateDiscreteStates -``` - -TODO: Clockstuff - -```@docs -fmi3GetIntervalDecimal! -fmi3GetIntervalFraction! -fmi3GetShiftDecimal! -fmi3GetShiftFraction! -fmi3GetClock -fmi3GetClock! -fmi3SetIntervalDecimal -fmi3SetIntervalFraction -fmi3SetClock -fmi3ActivateModelPartition -fmi3CallbackClockUpdate -``` - -### Getting Partial Dervatives -It is optionally possible to provide evaluation of partial derivatives for an FMU. For Model Exchange, this -means computing the partial derivatives at a particular time instant. For Co-Simulation, this means to -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 -fmi3GetDirectionalDerivative -fmi3GetDirectionalDerivative! -fmi3GetContinuousStateDerivatives -fmi3GetContinuousStateDerivatives! -fmi3GetAdjointDerivative! -fmi3GetOutputDerivatives -fmi3GetOutputDerivatives! -``` - -## FMI for Model Exchange - -This chapter contains the interface description to access the equations of a dynamic system from a C -program. - -### Providing Independent Variables and Re-initialization of Caching -Depending on the situation, different variables need to be computed. In order to be efficient, it is important that the interface requires only the computation of variables that are needed in the present context. The state derivatives shall be reused from the previous call. This feature is called “caching of variables” in the sequel. Caching requires that the model evaluation can detect when the input arguments, like time or states, have changed. - -```@docs -fmi3SetTime -fmi3SetContinuousStates -``` - -### Evaluation of Model Equations -This section contains the core functions to evaluate the model equations. - - -```@docs -fmi3EnterEventMode -fmi3EnterContinuousTimeMode -fmi3CompletedIntegratorStep -fmi3CompletedIntegratorStep! -fmi3GetEventIndicators! -fmi3GetContinuousStates! -fmi3GetNominalsOfContinuousStates! -fmi3GetNumberOfContinuousStates -fmi3GetNumberOfContinuousStates! -``` - -## FMI for Co-Simulation -This chapter defines the Functional Mock-up Interface (FMI) for the coupling of two or more simulation -models in a Co-Simulation environment (FMI for Co-Simulation). Co-Simulation is a rather general -approach to the simulation of coupled technical systems and coupled physical phenomena in -engineering with focus on instationary (time-dependent) problems. - - -### Transfer of Input / Output Values and Parameters -In order to enable the slave to interpolate the continuous real inputs between communication steps, the -derivatives of the inputs with respect to time can be provided. Also, higher derivatives can be set to allow -higher order interpolation. - -```@docs -fmi3CallbackIntermediateUpdate -``` - -### Computation -The computation of time steps is controlled by the following function. - -```@docs -fmi3EnterStepMode -fmi3DoStep! -``` - -### Retrieving Status Information from the Slave -Status information is retrieved from the slave by the following functions: - -```@docs -``` - -## non FMI-spec functions -These new functions, that are useful, but not part of the FMI-spec. (example: `fmi3Load`, `fmi3SampleJacobian`) - -### Opening and closing FMUs -```@docs -fmi3Unzip -fmi3Unload -fmi3Load -fmi3Reload -``` -### Conversion functions - -```@docs -fmi3StringToValueReference -fmi3ModelVariablesForValueReference -fmi3ValueReferenceToString -fmi3IntervalQualifierToString -fmi3StringToIntervalQualifier -fmi3Causality -fmi3StringToCausality -fmi3CausalityToString -fmi3InitialToString -fmi3StringToInitial -``` - -### External/Additional functions - -```@docs -fmi3GetJacobian -fmi3GetJacobian! -fmi3GetFullJacobian -fmi3GetFullJacobian! -fmi3GetStartValue -fmi3GetNumberOfVariableDependencies! -fmi3GetVariableDependencies! -fmi3SampleDirectionalDerivative -fmi3SampleDirectionalDerivative! -``` - -```@docs -fmi3StringToType -fmi3TypeToString -``` \ No newline at end of file diff --git a/docs/src/fmi3_lowlevel_modeldescription_functions.md b/docs/src/fmi3_lowlevel_modeldescription_functions.md new file mode 100644 index 00000000..808ada17 --- /dev/null +++ b/docs/src/fmi3_lowlevel_modeldescription_functions.md @@ -0,0 +1,50 @@ +# Working with the FMI model description + +The FMI model description provides all human readable information on the model. The following fuctions can be used to obtain all information provided by the model descripton, wich in turn can be extrated from the fmu. + +## Loading/Parsing + +```@docs +fmi3LoadModelDescription +``` + +## general information about the FMU + +```@docs +fmi3GetModelName +fmi3GetInstantiationToken +fmi3IsCoSimulation +fmi3IsModelExchange +fmi3IsScheduledExecution +fmi3GetGenerationTool +fmi3GetGenerationDateAndTime +``` + +## tecnical information about the FMU + +```@docs +fmi3GetModelIdentifier +fmi3GetVariableNamingConvention +fmi3GetVersion + +fmi3GetNumberOfEventIndicators +fmi3GetNumberOfEventIndicators! +``` + +## default experiment settings + +```@docs +fmi3GetDefaultStartTime +fmi3GetDefaultStopTime +fmi3GetDefaultTolerance +fmi3GetDefaultStepSize +``` + +## FMU capabilities + +```@docs +fmi3CanGetSetState +fmi3CanSerializeFMUState +fmi3ProvidesDirectionalDerivatives +fmi3ProvidesAdjointDerivatives +``` \ No newline at end of file