A generic variable definition which can be loaded from a Lua file.
This module provides the means to define new variables via the configuration.
Example: Variable to evaluate space time functions
variable = {
name = 'ref_density',
ncomponents = 1,
vartype = 'st_fun',
st_fun = lua_fun_refDens
}
Example: variable to perform certain operations
variable = {
name = 'density_diff',
ncomponents = 3,
vartype = 'operation',
operation = {
kind='difference',
input_varname = { 'density', 'ref_density'}
}
}
Example: variable to perform operation extract
variable = {
name = 'vel_y',
ncomponents = 1,
vartype = 'operation',
operation = {
kind='extract',
input_varname = {'velocity'},
input_varindex = {2}
}
}
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tem_variable_type), | intent(in) | :: | var | Data to describe the solver specific variable |
||
type(tem_varSys_type), | intent(inout) | :: | varSys | Variable system to append the variable to. |
||
integer, | intent(out), | optional | :: | pos | Position of the appended variable in the varSys. |
|
type(tem_varSys_solverData_evalElem_type), | intent(in), | optional | :: | solverData_evalElem | A setter routine that allows the caller to define a routine for the construction of an element representation. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L | Lua script to load the variable data from. |
|||
integer, | intent(in) | :: | parent | Parent table in the lua script to read the vairable from. |
||
type(c_ptr), | intent(out) | :: | specifics | Data to read for the solver specific variable |
||
procedure(tem_append_solverVar_method), | pointer | :: | appender | Function pointer to use for appending the solver variable. |
||
integer, | intent(out) | :: | iError | Indication whether the attempted reading was successful. |
Load an array of variables from the configuration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(out), | allocatable | :: | me(:) | The variable to read from the Lua script(conf) and fill |
|
type(flu_state) | :: | conf | Lua handle connected to the script to read the table from |
|||
integer, | intent(in), | optional | :: | parent | A parent table handle in which to look the current variable up |
|
character(len=*), | intent(in), | optional | :: | key | key for array of variables |
|
integer, | intent(out), | allocatable | :: | vError(:) | if Error .ne. 0 is variable is not loaded successfully. |
|
integer, | optional | :: | nComp | If the variable is expected to have a certain number of components, this can be provided with this argument. If the definition of the variable does not match this, we will fail loading the variable. |
||
procedure(tem_load_solverVar_method), | optional | :: | load_solvervar | A method to load solver specific variables. |
Reading a single variable from the Lua configuration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(out) | :: | me | The variable to read from the Lua script(conf) and fill |
||
type(flu_state) | :: | conf | Lua handle connected to the script to read the table from |
|||
integer, | intent(in) | :: | parent | A parent table handle in which to look the current variable up |
||
integer, | intent(out) | :: | iError | if Error .ne. 0 is variable is not loaded successfully. |
||
character(len=*), | intent(in), | optional | :: | key | key for a single variable |
|
integer, | optional | :: | nComp | If the variable is expected to have a certain number of components, this can be provided with this argument. If the definition of the variable does not match this, we will fail loading the variable. |
||
logical, | intent(in), | optional | :: | openTable | if variable table is already opened, set openTable = .false. |
|
procedure(tem_load_solverVar_method), | optional | :: | load_solvervar | A method to load solver specific variables. |
Dumps array of variable to given unit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(in) | :: | me(:) | variable to write into the lua file |
||
integer, | intent(in) | :: | outUnit | unit to write to |
Dump single variable to given unit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(in) | :: | me | variable to write into the lua file |
||
integer, | intent(in) | :: | outUnit | unit to write to |
Allows the output of array of variable to lua out
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(in) | :: | me(:) | variable to write into the lua file |
||
type(aot_out_type), | intent(inout) | :: | conf | aotus type handling the output to the file in lua format |
Allows the output of the single variable to lua out.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(in) | :: | me | variable to write into the lua file |
||
type(aot_out_type), | intent(inout) | :: | conf | aotus type handling the output to the file in lua format |
||
integer, | intent(in), | optional | :: | level | to dump variable with key or without key |
This routine provide funtionality to copy variable type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(out) | :: | left | variable to copy to |
||
type(tem_variable_type), | intent(in) | :: | right | variable to copy from |
Description of user defined variables.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=LabelLen), | public | :: | label | A name for this variable. |
|||
integer, | public | :: | nComponents | Number of components of this variable |
|||
character(len=labelLen), | public | :: | varType | How to treat this variable: "operation" or "st_fun" |
|||
character(len=labelLen), | public | :: | operType | Type of Operation to perfom on this variable |
|||
type(tem_reduction_transient_config_type), | public | :: | redTransConfig | additional info to load for reduction transient operation |
|||
character(len=LabelLen), | public, | allocatable | :: | input_varName(:) | input variables names this variable depends on |
||
integer, | public, | allocatable | :: | input_varIndex(:) | Component index to extract from input_varName for operType = 'extract' NOTE: It is possible to extract of component index from only one variable so input_varName for operType="extract" must be single variable name |
||
type(tem_spacetime_fun_type), | public, | allocatable | :: | st_fun(:) | space time functions |
||
character(len=labelLen), | public | :: | evalType | The evaluation type to use. The evaluation type defines how the variable should evaluate a get_point or get_element-request when there are more than one space time functions that could fulfill this request. |
|||
procedure(tem_append_solverVar_method), | public, | pointer | :: | append_solverVar | => | NULL() | A method to append the read solver specific variable to the varSys |
type(c_ptr), | public | :: | solver_specifics | = | C_NULL_PTR |
Load an array of variables from the configuration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(out), | allocatable | :: | me(:) | The variable to read from the Lua script(conf) and fill |
|
type(flu_state) | :: | conf | Lua handle connected to the script to read the table from |
|||
integer, | intent(in), | optional | :: | parent | A parent table handle in which to look the current variable up |
|
character(len=*), | intent(in), | optional | :: | key | key for array of variables |
|
integer, | intent(out), | allocatable | :: | vError(:) | if Error .ne. 0 is variable is not loaded successfully. |
|
integer, | optional | :: | nComp | If the variable is expected to have a certain number of components, this can be provided with this argument. If the definition of the variable does not match this, we will fail loading the variable. |
||
procedure(tem_load_solverVar_method), | optional | :: | load_solvervar | A method to load solver specific variables. |
Reading a single variable from the Lua configuration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(out) | :: | me | The variable to read from the Lua script(conf) and fill |
||
type(flu_state) | :: | conf | Lua handle connected to the script to read the table from |
|||
integer, | intent(in) | :: | parent | A parent table handle in which to look the current variable up |
||
integer, | intent(out) | :: | iError | if Error .ne. 0 is variable is not loaded successfully. |
||
character(len=*), | intent(in), | optional | :: | key | key for a single variable |
|
integer, | optional | :: | nComp | If the variable is expected to have a certain number of components, this can be provided with this argument. If the definition of the variable does not match this, we will fail loading the variable. |
||
logical, | intent(in), | optional | :: | openTable | if variable table is already opened, set openTable = .false. |
|
procedure(tem_load_solverVar_method), | optional | :: | load_solvervar | A method to load solver specific variables. |
Loading of a variable, that is defined in terms of an operation on other variables.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(inout) | :: | me | The variable to read from the Lua script(conf) and fill |
||
type(flu_state) | :: | conf | Lua handle connected to the script to read the table from |
|||
integer, | intent(in) | :: | parent | A parent table handle in which to look the current operation table |
||
integer, | intent(out) | :: | iError | iError .ne. 0 if operation is not loaded successfully. |
Dumps array of variable to given unit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(in) | :: | me(:) | variable to write into the lua file |
||
integer, | intent(in) | :: | outUnit | unit to write to |
Dump single variable to given unit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(in) | :: | me | variable to write into the lua file |
||
integer, | intent(in) | :: | outUnit | unit to write to |
Allows the output of array of variable to lua out
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(in) | :: | me(:) | variable to write into the lua file |
||
type(aot_out_type), | intent(inout) | :: | conf | aotus type handling the output to the file in lua format |
Allows the output of the single variable to lua out.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(in) | :: | me | variable to write into the lua file |
||
type(aot_out_type), | intent(inout) | :: | conf | aotus type handling the output to the file in lua format |
||
integer, | intent(in), | optional | :: | level | to dump variable with key or without key |
This routine provide funtionality to copy variable type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_variable_type), | intent(out) | :: | left | variable to copy to |
||
type(tem_variable_type), | intent(in) | :: | right | variable to copy from |