GeMA
The GeMA main application
State Variables

State variables represent model degrees of freedom, corresponding to values that are calculated by the simulation. They are global entities that can be associated with several meshes. When a state variable is associated with a mesh, space is reserved for storing a value for that state variable, per mesh node. There can be several state variable objects on the simulation file, created by the StateVar keyword.

Example

StateVar{ id = 'T', description = 'Temperature', unit = 'degC' }

Fields

Field Description Type Required
id The state variable name. String Yes
description A description of the state variable purpose. String No
dim State variables can be scalar or vector values. If this field is absent, a scalar state variable will be used. If present, it should contain the vector dimension. Integer No
type The data type in which the values should be stored. This is handled by GeMA as a request. It can be ignored depending on the values of other options like functions, allocMode and/or allocStrategy. If that is the case, values will be stored as doubles, the default if this option is missing. Accepted values are "double", "float", "int32", "int16", "byte", "uint32", "uint16" and "ubyte". String No
unit The unit in which the value data will be stored. See also the documentation on Working with units. String No
defVal The default value used for initializing the state variable. When specifying a default value for a vector, a table syntax should be used to provide values for all of the vector dimensions. Supposing that the vector has a dimension equal to 3, defVal = {0.0, 1.0, 0.0} will initialize it with a normalized vector pointing in the y direction. If a scalar value is given, it will be used to fill all of the vector dimensions. If this field is not filled, the default value will be equal to zero. Number or Table No
format This field controls how a value will be formatted when printed or saved to a text file format. It uses a subset of the C printf() syntax, allowing the user to specify the field width, precision and format type. A format = "8.2f" statement means that the formatted value will have at least 8 characters and 2 decimal values. Allowed format specifiers are 'f' (for decimal floating point format), 'e' (for scientific notation format) and 'g' (corresponding to 'f' or 'e', whichever is shortest). String No
affectedNodes This field controls the affected nodes, or storage pattern, for this state variable when ghost nodes are present. A value of "geometry" means that this state variable stores values only for geometry nodes. A value of "ghost" means that this state variable has values only for ghost nodes and a value of "both" means that it stores values for all node types. When absent, a "geometry" storage is used. String No
history This field defines if this state variable should store or not a set of past values. This is useful when the calculation method depends not only on the actual value of the state variable but also on past ones. If this field has a value of true, an unlimited number os past values will be enabled. A positive number greater than 1 defines the exact number of saved states that will be used in a rolling history pattern. A value of 2, for example, means that the current value and the last one are saved. When a new value is calculated, the current one becomes the last one and the last one is discarded. Boolean or Integer No