From 265a5c936d05e36f6b296fbc1c5ec59173d208db Mon Sep 17 00:00:00 2001 From: Christian Bertsch Date: Mon, 19 Jun 2023 22:00:19 +0200 Subject: [PATCH] attempt to put serialization info at one place --- docs/2_2_common_mechanisms.adoc | 10 ++++++---- docs/4_1_co-simulation_math.adoc | 4 +--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/2_2_common_mechanisms.adoc b/docs/2_2_common_mechanisms.adoc index fe28a25f5..cdb1384ce 100644 --- a/docs/2_2_common_mechanisms.adoc +++ b/docs/2_2_common_mechanisms.adoc @@ -333,6 +333,8 @@ _]_ For this serialization of array variables the sparsity pattern of the array is not taken into account. All elements of the array, including structural zeros, are serialized. +In case of API-functions takeing multiple value references, the serialization of the corresponding values consists of the concatenation of the serialized array varibles. + ===== Getting and Setting Variable Values [[get-and-set-variable-values]] Restrictions for setting and getting of variables with certain types, causalities and variabilities are defined in the state machine and state descriptions (see <> for common states, <> for Model Exchange, <> for Co-Simulation, and <> for Scheduled Execution). @@ -354,7 +356,7 @@ include::../headers/fmi3FunctionTypes.h[tags=GetClock] * `valueReferences` is a vector of `nValueReferences` handles that reference the variables that shall be inquired. -* `values` is a vector consisting of the concatenation of the (serialized in the case of arrays) values of these variables. +* `values` is a vector consisting of the <> values of these variables. * `valueSizes` is a vector with the actual sizes of the values for binary variables. @@ -376,7 +378,7 @@ include::../headers/fmi3FunctionTypes.h[tags=SetClock] * `valueReferences` is a vector of `nValueReferences` handles that reference the variables that shall be set. -* `values` is a vector consisting of the concatenation of the (serialized in the case of arrays) values of these variables. +* `values` is a vector consisting of the <> values of these variables. * `valueSizes` is a vector with the actual sizes of the values of binary variables. @@ -1166,9 +1168,9 @@ Both functions have the same arguments: * `nUnknowns` contains the length of argument `unknowns`. * `knowns` contains value references of the knowns. * `nKnowns` contains the length of argument `knowns`. -* `seed` contains the components of the seed vector. +* `seed` contains the <> components of the seed vector. * `nSeed` contains the length of `seed`. -* `sensitivity` contains the components of the sensitivity vector. +* `sensitivity` contains the <> components of the sensitivity vector. * `nSensitivity` contains the length of `sensitivity`. _[Note that array variables will be serialized, so `nSeed` is only equal to `nKnowns` in the case of directional derivatives (resp., equal to `nUnknowns` in the case of adjoint derivatives) if all value references of `knowns` (resp., `unknowns`) point to scalar variables._ diff --git a/docs/4_1_co-simulation_math.adoc b/docs/4_1_co-simulation_math.adoc index e406f785b..e11bdcb37 100644 --- a/docs/4_1_co-simulation_math.adoc +++ b/docs/4_1_co-simulation_math.adoc @@ -40,9 +40,7 @@ If multiple derivatives of a variable shall be retrieved, list the value referen * `orders` contains the orders of the respective <> (1 means the first <>, 2 means the second <>, ..., 0 is not allowed). If multiple derivatives of a variable shall be retrieved, its value reference must occur multiple times in `valueReferences` aligned with the corresponding `orders` array. -* `values` is a vector with the values of the <>. -The order of the `values` elements is derived from a twofold serialization: the outer level corresponds to the combination of a value reference (e.g., `valueReferences[k]`) and order (e.g., `orders[k]`), and the inner level to the serialization of variables as defined in <>. -The inner level does not exist for scalar variables. +* `values` is a vector consisting of the <> values of these <. * `nValues` is the size of the argument `values`. `nValues` only equals `nValueReferences` if all corresponding output variables are scalar variables.