tem_variable_module Module

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}
   }
 }

Uses

Used by

  • module~~tem_variable_module~~UsedByGraph module~tem_variable_module tem_variable_module module~tem_derived_module tem_derived_module module~tem_derived_module->module~tem_variable_module module~tem_spacetime_var_module tem_spacetime_var_module module~tem_derived_module->module~tem_spacetime_var_module module~tem_operation_var_module tem_operation_var_module module~tem_derived_module->module~tem_operation_var_module program~tem_varsys_stfunvar_test tem_varSys_stfunVar_test program~tem_varsys_stfunvar_test->module~tem_variable_module program~tem_varsys_stfunvar_test->module~tem_derived_module module~tem_spacetime_var_module->module~tem_variable_module program~tem_variable_evaltype_test tem_variable_evaltype_test program~tem_variable_evaltype_test->module~tem_variable_module program~tem_variable_evaltype_test->module~tem_derived_module program~tem_varsys_test tem_varSys_test program~tem_varsys_test->module~tem_variable_module program~tem_varsys_test->module~tem_spacetime_var_module program~tem_logical_opertor_test tem_logical_opertor_test program~tem_logical_opertor_test->module~tem_variable_module program~tem_logical_opertor_test->module~tem_derived_module program~tem_variable_extract_test tem_variable_extract_test program~tem_variable_extract_test->module~tem_variable_module program~tem_variable_extract_test->module~tem_derived_module program~tem_variable_combine_test tem_variable_combine_Test program~tem_variable_combine_test->module~tem_variable_module program~tem_variable_combine_test->module~tem_derived_module module~tem_operation_var_module->module~tem_variable_module module~tem_varmap_module tem_varMap_module module~tem_operation_var_module->module~tem_varmap_module program~tem_varsys_opvar_test tem_varSys_opVar_test program~tem_varsys_opvar_test->module~tem_variable_module program~tem_varsys_opvar_test->module~tem_derived_module module~tem_varmap_module->module~tem_spacetime_var_module module~tem_depend_module tem_depend_module module~tem_depend_module->module~tem_varmap_module module~tem_restart_module tem_restart_module module~tem_restart_module->module~tem_varmap_module module~hvs_output_module hvs_output_module module~hvs_output_module->module~tem_varmap_module module~hvs_output_module->module~tem_restart_module module~tem_bc_module tem_bc_module module~tem_bc_module->module~tem_varmap_module module~tem_tracking_module tem_tracking_module module~tem_tracking_module->module~tem_varmap_module module~tem_tracking_module->module~hvs_output_module module~tem_convergence_module tem_convergence_module module~tem_convergence_module->module~tem_varmap_module module~tem_general_module tem_general_module module~tem_general_module->module~tem_restart_module module~tem_ini_condition_module tem_ini_condition_module module~tem_ini_condition_module->module~tem_depend_module module~tem_abortcriteria_module tem_abortCriteria_module module~tem_abortcriteria_module->module~tem_convergence_module program~tem_tracking_test tem_tracking_test program~tem_tracking_test->module~tem_tracking_module module~tem_simcontrol_module tem_simControl_module module~tem_simcontrol_module->module~tem_convergence_module

Contents


Interfaces

interface

  • public subroutine tem_append_solverVar_method(var, varSys, pos, solverData_evalElem)

    Arguments

    TypeIntentOptionalAttributesName
    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.

interface

  • public subroutine tem_load_solverVar_method(L, parent, specifics, appender, iError)

    Arguments

    TypeIntentOptionalAttributesName
    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.

public interface tem_variable_load

  • public subroutine tem_variable_load_vector(me, conf, parent, key, vError, nComp, load_solvervar)

    Load an array of variables from the configuration.

    Arguments

    TypeIntentOptionalAttributesName
    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.

  • public subroutine tem_variable_load_single(me, conf, parent, iError, key, nComp, openTable, load_solvervar)

    Reading a single variable from the Lua configuration.

    Arguments

    TypeIntentOptionalAttributesName
    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.

public interface tem_variable_dump

  • public subroutine tem_variable_dump_vector(me, outUnit)

    Dumps array of variable to given unit

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_variable_type), intent(in) :: me(:)

    variable to write into the lua file

    integer, intent(in) :: outUnit

    unit to write to

  • public subroutine tem_variable_dump_single(me, outUnit)

    Dump single variable to given unit

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_variable_type), intent(in) :: me

    variable to write into the lua file

    integer, intent(in) :: outUnit

    unit to write to

public interface tem_variable_out

  • public subroutine tem_variable_out_vector(me, conf)

    Allows the output of array of variable to lua out

    Arguments

    TypeIntentOptionalAttributesName
    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

  • public subroutine tem_variable_out_single(me, conf, level)

    Allows the output of the single variable to lua out.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    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

public interface assignment(=)

  • public subroutine copy_Var(left, right)

    This routine provide funtionality to copy variable type

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_variable_type), intent(out) :: left

    variable to copy to

    type(tem_variable_type), intent(in) :: right

    variable to copy from


Derived Types

type, public :: tem_variable_type

Description of user defined variables.

Components

TypeVisibilityAttributesNameInitial
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.

Read more…
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

Subroutines

public subroutine tem_variable_load_vector(me, conf, parent, key, vError, nComp, load_solvervar)

Load an array of variables from the configuration.

Arguments

TypeIntentOptionalAttributesName
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.

public subroutine tem_variable_load_single(me, conf, parent, iError, key, nComp, openTable, load_solvervar)

Reading a single variable from the Lua configuration.

Arguments

TypeIntentOptionalAttributesName
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.

public subroutine load_variable_operation(me, conf, parent, iError)

Loading of a variable, that is defined in terms of an operation on other variables.

Arguments

TypeIntentOptionalAttributesName
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.

public subroutine tem_variable_dump_vector(me, outUnit)

Dumps array of variable to given unit

Arguments

TypeIntentOptionalAttributesName
type(tem_variable_type), intent(in) :: me(:)

variable to write into the lua file

integer, intent(in) :: outUnit

unit to write to

public subroutine tem_variable_dump_single(me, outUnit)

Dump single variable to given unit

Arguments

TypeIntentOptionalAttributesName
type(tem_variable_type), intent(in) :: me

variable to write into the lua file

integer, intent(in) :: outUnit

unit to write to

public subroutine tem_variable_out_vector(me, conf)

Allows the output of array of variable to lua out

Arguments

TypeIntentOptionalAttributesName
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

public subroutine tem_variable_out_single(me, conf, level)

Allows the output of the single variable to lua out.

Read more…

Arguments

TypeIntentOptionalAttributesName
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

public subroutine copy_Var(left, right)

This routine provide funtionality to copy variable type

Arguments

TypeIntentOptionalAttributesName
type(tem_variable_type), intent(out) :: left

variable to copy to

type(tem_variable_type), intent(in) :: right

variable to copy from