... | ... | @@ -14,6 +14,8 @@ In addition, GetDP defines two functions to access ONELAB parameters at run-time |
|
|
|
|
|
* `SetNumberRunTime[ 3.14 ]{"a number"}`
|
|
|
|
|
|
* `SetNumberRunTimeWithChoices[ 3.14 ]{"a number"}`
|
|
|
|
|
|
* `n = GetNumberRunTime[]{"a number"}`
|
|
|
|
|
|
Finally, GetDP also defines a `SendToServer` option in its `PostOperation` object, to send post-processing results directly to the ONELAB database.
|
... | ... | @@ -132,18 +134,19 @@ s = GetString["a string"]; |
|
|
|
|
|
Currently these basic functions do not allow setting optional ONELAB attributes.
|
|
|
|
|
|
## SetNumberRunTime and GetNumberRunTime (GetDP only)
|
|
|
## SetNumberRunTime, SetNumberRunTimeWithChoices and GetNumberRunTime (GetDP only)
|
|
|
|
|
|
All the above commands (`DefineNumber`, `DefineString`, `DefineConstant`, `SetNumber`, `SetString`, `GetNumber` and `GetString`) are executed when the input data files for GetDP and Gmsh are parsed. For GetDP, this means that the queries in the database using these commands are done once, when the `.pro` file is analyzed.
|
|
|
|
|
|
However, in some situations, one might want to exchange information with the ONELAB database while the computation is running, i.e. at ''run-time''. GetDP defines two built-in functions (at the same level as other GetDP functions like `X[]` or `Vector[]`) that allow to exchange numbers at run-time, while evaluating expressions:
|
|
|
However, in some situations, one might want to exchange information with the ONELAB database while the computation is running, i.e. at ''run-time''. GetDP defines three built-in functions (at the same level as other GetDP functions like `X[]` or `Vector[]`) that allow to exchange numbers at run-time, while evaluating expressions:
|
|
|
|
|
|
```cpp
|
|
|
SetNumberRunTime[ 3.14 ]{"a number"}
|
|
|
SetNumberRunTimeWithChoices[ 3.14 ]{"a number"}
|
|
|
GetNumberRunTime[]{"a number"}
|
|
|
```
|
|
|
|
|
|
These functions can be used in all the same places that other GetDP expressions can be used, e.g. in `Function` definitions, `Formulation` terms, inside the `Evaluate` operation in a `Resolution`, etc.
|
|
|
The first two set the value of the given parameter in the database, with the second appending the value to the "choices" list as well. The third gets the value of the given parameter. These three functions can be used in all the same places that other GetDP expressions can be used, e.g. in `Function` definitions, `Formulation` terms, inside the `Evaluate` operation in a `Resolution`, etc.
|
|
|
|
|
|
## SendToServer (GetDP only)
|
|
|
|
... | ... | |