tem_varSys_opVar_test Program

Uses

This UTEST is to test operation variables function pointers


Calls

program~~tem_varsys_opvar_test~~CallsGraph program~tem_varsys_opvar_test tem_varSys_opVar_test proc~load_env load_env program~tem_varsys_opvar_test->proc~load_env proc~check_res~3 check_res program~tem_varsys_opvar_test->proc~check_res~3 proc~load_config~3 load_config program~tem_varsys_opvar_test->proc~load_config~3 proc~tem_varsys_init tem_varSys_init program~tem_varsys_opvar_test->proc~tem_varsys_init proc~tem_varsys_append_luavar tem_varSys_append_luaVar program~tem_varsys_opvar_test->proc~tem_varsys_append_luavar proc~fin_env fin_env program~tem_varsys_opvar_test->proc~fin_env interface~tem_logging_init tem_logging_init program~tem_varsys_opvar_test->interface~tem_logging_init proc~close_config close_config program~tem_varsys_opvar_test->proc~close_config proc~tem_baryofid tem_BaryOfId program~tem_varsys_opvar_test->proc~tem_baryofid proc~tem_create_subtree_of_st_funlist tem_create_subTree_of_st_funList program~tem_varsys_opvar_test->proc~tem_create_subtree_of_st_funlist

Contents


Variables

TypeAttributesNameInitial
character, parameter:: nl =C_NEW_LINE
character(len=solSpecLen), parameter:: sysConf ='function lua_fun(x,y,z,t)'//nl//'  return x'//nl//'end'//nl//'shape = {'//nl//'  kind = "canoND",'//nl//'  object = {'//nl//'    origin = {0.0,0.0,0.0},'//nl//'    vec = {0.0,1.0,0.0},'//nl//'    segments = 2'//nl//'  }'//nl//'}'//nl//'variable = {'//nl//'  {'//nl//'    name = "lua_fun",'//nl//'    ncomponents = 1,'//nl//'    vartype = "st_fun",'//nl//'    st_fun = lua_fun'//nl//'  },'//nl//'  {'//nl//'    name = "luafun_shape",'//nl//'    ncomponents = 1,'//nl//'    vartype = "st_fun",'//nl//'    st_fun = {'//nl//'      fun = lua_fun,'//nl//'      shape = shape'//nl//'    }'//nl//'  },'//nl//'  {'//nl//'    name = "const11",'//nl//'    ncomponents = 1, '//nl//'    vartype = "st_fun",'//nl//'    st_fun = 11.0'//nl//'  },'//nl//'  {'//nl//'    name = "const11_shape",'//nl//'    ncomponents = 1,'//nl//'    vartype = "st_fun",'//nl//'    st_fun = {'//nl//'      const = 11.0,'//nl//'      shape = shape'//nl//'    }'//nl//'  },'//nl//'  {'//nl//'    name = "const11_lua_fun",'//nl//'    ncomponents = 1,'//nl//'    vartype = "st_fun",'//nl//'    st_fun = {'//nl//'      {'//nl//'        fun = lua_fun,'//nl//'        shape = shape'//nl//'      },'//nl//'      100.0'//nl//'    }'//nl//'  },'//nl//'  {'//nl//'    name = "add1",'//nl//'    ncomponents = 1,'//nl//'    vartype = "operation",'//nl//'    operation = {'//nl//'      kind = "addition",'//nl//'      input_varname = {'//nl//'        "lua_fun",'//nl//'        "const11"'//nl//'      }'//nl//'    }'//nl//'  },'//nl//'  {'//nl//'    name = "add2",'//nl//'    ncomponents = 1,'//nl//'    vartype = "operation",'//nl//'    operation = {'//nl//'      kind = "addition",'//nl//'      input_varname = {'//nl//'        "luafun_shape",'//nl//'        "const11_shape"'//nl//'      }'//nl//'    }'//nl//'  },'//nl//'  {'//nl//'    name = "diff1",'//nl//'    ncomponents = 1,'//nl//'    vartype = "operation",'//nl//'    operation= {'//nl//'      kind = "difference",'//nl//'      input_varname = {'//nl//'        "const11_lua_fun", '//nl//'        "add1"'//nl//'      }'//nl//'    }'//nl//'  },'//nl//'  {'//nl//'    name = "combine",'//nl//'    ncomponents = 2,'//nl//'    vartype = "operation",'//nl//'    operation = {'//nl//'      kind = "combine",'//nl//'      input_varname = {'//nl//'        "diff1",'//nl//'        "add2"'//nl//'      }'//nl//'    }'//nl//'  },'//nl//'  {'//nl//'    name = "extract1",'//nl//'    ncomponents = 1,'//nl//'    vartype = "operation",'//nl//'    operation= {'//nl//'      kind = "extract", '//nl//'      input_varname = {"combine"}, '//nl//'      input_varindex = {1} '//nl//'    }'//nl//'  },'//nl//'  {'//nl//'    name = "extract2",'//nl//'    ncomponents = 1,'//nl//'    vartype = "operation",'//nl//'    operation= {'//nl//'      kind = "extract",'//nl//'      input_varname = {"combine"},'//nl//'      input_varindex = {2}'//nl//'    }'//nl//'  },'//nl//'}'//nl//'track_variable = {'//nl//'  "lua_fun",'//nl//'  "luafun_shape",'//nl//'  "const11",'//nl//'  "const11_shape",'//nl//'  "const11_lua_fun",'//nl//'  "add1",'//nl//'  "add2",'//nl//'  "diff1",'//nl//'  "combine",'//nl//'  "extract1",'//nl//'  "extract2"'//nl//'}'//nl
logical, parameter:: dumpRes =.true.
integer, parameter:: nElems_track =5
integer, parameter, dimension(nElems_track):: elemPos =(/1, 3, 5, 7, 8/)
real(kind=rk), parameter, dimension(nElems_track):: luaFun_ref =(/0.25_rk, 0.25_rk, 0.25_rk, 0.25_rk, 0.75_rk/)
real(kind=rk), parameter, dimension(nElems_track):: luaFunShape_ref =(/0.25_rk, 0.25_rk, 0.0_rk, 0.0_rk, 0.0_rk/)
real(kind=rk), parameter, dimension(nElems_track):: const11_ref =(/11.0_rk, 11.0_rk, 11.0_rk, 11.0_rk, 11.0_rk/)
real(kind=rk), parameter, dimension(nElems_track):: const11Shape_ref =(/11.0_rk, 11.0_rk, 0.0_rk, 0.0_rk, 0.0_rk/)
real(kind=rk), parameter, dimension(nElems_track):: const11LuaFun_ref =(/100.25_rk, 100.25_rk, 100.0_rk, 100.0_rk, 100.0_rk/)
real(kind=rk), parameter, dimension(nElems_track):: add1_ref =(/11.25_rk, 11.25_rk, 11.25_rk, 11.25_rk, 11.75_rk/)
real(kind=rk), parameter, dimension(nElems_track):: add2_ref =(/11.25_rk, 11.25_rk, 0.0_rk, 0.0_rk, 0.0_rk/)
real(kind=rk), parameter, dimension(nElems_track):: diff1_ref =(/89.0_rk, 89.0_rk, 88.75_rk, 88.75_rk, 88.25_rk/)
real(kind=rk), parameter, dimension(nElems_track,2):: combine_ref =reshape((/89.0_rk, 89.0_rk, 88.75_rk, 88.75_rk, 88.25_rk, 11.25_rk, 11.25_rk, 0.0_rk, 0.0_rk, 0.0_rk/), (/nElems_track, 2/))
real(kind=rk), parameter, dimension(nElems_track):: extract1_ref =(/89.0_rk, 89.0_rk, 88.75_rk, 88.75_rk, 88.25_rk/)
real(kind=rk), parameter, dimension(nElems_track):: extract2_ref =(/11.25_rk, 11.25_rk, 0.0_rk, 0.0_rk, 0.0_rk/)
type(tem_varSys_type) :: varSys
type(tem_st_fun_linkedList_type) :: st_funList
type(solver_type), target:: solver
type(tracking_type) :: tracking
type(tem_variable_type), allocatable:: newVar(:)
integer :: addedPos
integer :: iElem
integer :: iVar
real(kind=rk), allocatable:: res(:)
integer, allocatable:: error(:)
real(kind=rk) :: point(nElems_track,3)
integer :: idx(nElems_track)
type(var_index), allocatable:: varIdx(:)

Derived Types

type :: solver_type

Components

TypeVisibilityAttributesNameInitial
integer, public :: nDofs
real(kind=rk), public, allocatable:: state(:)
type(treelmesh_type), public :: tree
type(tem_BC_prop_type), public :: boundary
type(tem_general_type), public :: general

type :: tracking_type

Components

TypeVisibilityAttributesNameInitial
type(grw_intarray_type), public :: varPos
integer, public :: nRequestedVars
character(len=labelLen), public, allocatable:: variable(:)

type :: var_index

Components

TypeVisibilityAttributesNameInitial
integer, public :: idx(nElems_track)

Subroutines

subroutine load_config(conf, chunk, stfun_linkedList, tracking, newVar)

load variables defined in sysConf

Arguments

TypeIntentOptionalAttributesName
type(flu_state) :: conf
character(len=*), intent(in) :: chunk
type(tem_st_fun_linkedList_type), intent(out) :: stfun_linkedList
type(tracking_type), intent(out) :: tracking
type(tem_variable_type), intent(out), allocatable:: newVar(:)

subroutine check_res(varname, res, error)

Check tracking results

Arguments

TypeIntentOptionalAttributesName
character(len=labelLen), intent(in) :: varname
real(kind=rk), intent(in) :: res(:)
integer, intent(out) :: error