Skip to content

Commit

Permalink
attempt to put serialization info at one place
Browse files Browse the repository at this point in the history
  • Loading branch information
chrbertsch committed Jun 19, 2023
1 parent d1188c4 commit 265a5c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 6 additions & 4 deletions docs/2_2_common_mechanisms.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<common-state-machine>> for common states, <<state-machine-model-exchange>> for Model Exchange, <<state-machine-co-simulation>> for Co-Simulation, and <<state-machine-scheduled-execution>> for Scheduled Execution).
Expand All @@ -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 <<serialization-of_variables,serialized>> values of these variables.

* `valueSizes` is a vector with the actual sizes of the values for binary variables.

Expand All @@ -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 <<serialization-of_variables,serialized>> values of these variables.

* `valueSizes` is a vector with the actual sizes of the values of binary variables.

Expand Down Expand Up @@ -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 <<serialization-of_variables,serialized>> components of the seed vector.
* `nSeed` contains the length of `seed`.
* `sensitivity` contains the components of the sensitivity vector.
* `sensitivity` contains the <<serialization-of_variables,serialized>> 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._
Expand Down
4 changes: 1 addition & 3 deletions docs/4_1_co-simulation_math.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ If multiple derivatives of a variable shall be retrieved, list the value referen
* `orders` contains the orders of the respective <<derivative>> (1 means the first <<derivative>>, 2 means the second <<derivative>>, ..., 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 <<derivative,`derivatives`>>.
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 <<serialization-of_variables>>.
The inner level does not exist for scalar variables.
* `values` is a vector consisting of the <<serialization-of_variables,serialized>> values of these <<derivative,`derivatives`>.

* `nValues` is the size of the argument `values`.
`nValues` only equals `nValueReferences` if all corresponding output variables are scalar variables.
Expand Down

0 comments on commit 265a5c9

Please sign in to comment.