... | ... | @@ -24,11 +24,11 @@ Function{ |
|
|
|
|
|
## Run-time variables
|
|
|
|
|
|
Run-time variables are created at run-time during pre-processing, processing or post-processing, through the run-time evaluation of expressions (like functions). Such variables can be used to handle dynamic cases that can not be predicted at parse time. Run-time variables begin with a dollar sign `$`. Their value can be set or retrieved in any expression, e.g. when a function is called in a `Formulation` term, or in the `Evaluate`, `While`, `Test`, etc., operations in a `Resolution`. They can be set in expression either with a simple affectation (`=`) or with the `SetVariable` function; their value can be retrieved either directly or using the `GetVariable` function. Both `SetVariable` and `GetVariable` allow to construct dynamic variable names, by appending suffixes dynamically depending on their extra arguments.
|
|
|
Run-time variables are created at run-time during pre-processing, processing or post-processing, through the run-time evaluation of expressions (like functions). Such variables can be used to handle dynamic cases that can not be predicted at parse time. Run-time variables begin with a dollar sign `$`. Their value can be set or retrieved in any expression, e.g. when a function is called in a `Formulation` term, or in the `Evaluate`, `While`, `Test`, etc., operations in a `Resolution`. They can be set in expressions either with a simple affectation (`=`) or with the `SetVariable` function; their value can be retrieved either directly or using the `GetVariable` function. Both `SetVariable` and `GetVariable` allow to construct dynamic variable names, by appending suffixes dynamically depending on their extra arguments.
|
|
|
|
|
|
Some run-time variables are read-only and are only modified by built-in GetDP algorithms or functions, like `$Time` or `$TimeStep`.
|
|
|
Some run-time variables (“current values”) are read-only and are only modified by built-in GetDP algorithms or functions, like `$Time` or `$TimeStep`.
|
|
|
|
|
|
In the following example the run-time variable `$a` is set to the value 2 in different ways; the run-time variables `$b_1`, `$b_2`, ... are dynamically created and used depending on the index of the quadrature point in a formulation term; and the run-time variable `$c` is set to `0.3`, `0.4` ... `1` using the `Evaluate` operation in a `Resolution`:
|
|
|
In the following example the run-time variable `$a` is set to the value 2 in two different ways; the run-time variables `$b_1`, `$b_2`, ... are dynamically created and used depending on the index of the quadrature point in a formulation term; and the run-time variable `$c` is set to `0.3`, `0.4` ... `1` using the `Evaluate` operation in a `Resolution`, or by storing the result of a `PostOperation`:
|
|
|
|
|
|
```cpp
|
|
|
Function{
|
... | ... | |