tem_varSys_test Program

Uses

This UTEST is to test variable system. load variables and access state and derive quantities from c pointer methoddata


Calls

program~~tem_varsys_test~~CallsGraph program~tem_varsys_test tem_varSys_test proc~load_env load_env program~tem_varsys_test->proc~load_env interface~positionofval~4 positionofval program~tem_varsys_test->interface~positionofval~4 proc~tem_varsys_append_dervar tem_varSys_append_derVar program~tem_varsys_test->proc~tem_varsys_append_dervar proc~tem_varsys_append_statevar tem_varSys_append_stateVar program~tem_varsys_test->proc~tem_varsys_append_statevar proc~tem_varsys_init tem_varSys_init program~tem_varsys_test->proc~tem_varsys_init proc~fin_env fin_env program~tem_varsys_test->proc~fin_env proc~load_config load_config program~tem_varsys_test->proc~load_config interface~append~36 append program~tem_varsys_test->interface~append~36 interface~init~15 init program~tem_varsys_test->interface~init~15 proc~check_res check_res program~tem_varsys_test->proc~check_res proc~close_config close_config program~tem_varsys_test->proc~close_config proc~tem_create_subtree_of tem_create_subTree_of program~tem_varsys_test->proc~tem_create_subtree_of

Contents


Variables

TypeAttributesNameInitial
character, parameter:: nl =C_NEW_LINE
character(len=solSpecLen), parameter:: sysConf ='function vel_fun(x,y,z,t)'//nl//'  return {x,y,z}'//nl//'end'//nl//'variables = {'//nl//'  {'//nl//'    name = "velocity",'//nl//'    ncomponents = 3, '//nl//'    vartype = "st_fun",'//nl//'    st_fun = vel_fun'//nl//'  }'//nl//'}'//nl//'track_variable = {'//nl//'  "state",'//nl//'  "density",'//nl//'  "velocity"'//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,4):: state =reshape((/1.0_rk, 9.0_rk, 17.0_rk, 25.0_rk, 29.0_rk, 2.0_rk, 10.0_rk, 18.0_rk, 26.0_rk, 30.0_rk, 3.0_rk, 11.0_rk, 19.0_rk, 27.0_rk, 31.0_rk, 4.0_rk, 12.0_rk, 20.0_rk, 28.0_rk, 32.0_rk/), (/nElems_track, 4/))
real(kind=rk), parameter, dimension(nElems_track):: dens =(/10.0_rk, 42.0_rk, 74.0_rk, 106.0_rk, 122.0_rk/)
real(kind=rk), parameter, dimension(nElems_track,3):: vel =reshape((/0.25_rk, 0.25_rk, 0.25_rk, 0.25_rk, 0.75_rk, 0.25_rk, 0.75_rk, 0.25_rk, 0.75_rk, 0.75_rk, 0.25_rk, 0.25_rk, 0.75_rk, 0.75_rk, 0.75_rk/), (/nElems_track, 3/))
type(tem_varSys_type) :: varSys
procedure(tem_varSys_proc_point), pointer:: get_point=> NULL()
procedure(tem_varSys_proc_element), pointer:: get_element=> NULL()
procedure(tem_varSys_proc_setParams), pointer:: set_params=> null()
procedure(tem_varSys_proc_getParams), pointer:: get_params=> null()
procedure(tem_varSys_proc_setupIndices), pointer:: setup_indices=> null()
procedure(tem_varSys_proc_getValOfIndex), pointer:: get_valOfIndex=> null()
type(tem_st_fun_linkedList_type) :: st_funList
type(tem_st_fun_listElem_type), pointer:: st_fun
type(solver_type), target:: solver
type(tracking_type) :: tracking
type(tem_variable_type), allocatable:: newVar(:)
integer :: addedPos
integer :: iElem
integer :: iComp
integer :: iDof
integer :: elem_offset
integer :: comp_offset
integer :: nComp
integer :: iVar
integer :: iList
integer :: iSt
logical :: wasAdded
real(kind=rk), allocatable:: res(:)
integer, allocatable:: error(:)
character(len=labelLen), allocatable:: input_varname(:)
type(tem_stencilHeader_type) :: stencil

dummy variable required by creat_subTree

type(tem_st_fun_listElem_type), pointer:: newElem

Derived Types

type :: solver_type

Components

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

type :: tracking_type

Components

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

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 access_state(fun, varSys, elempos, time, tree, n, nDofs, res)

access state variables

Arguments

TypeIntentOptionalAttributesName
class(tem_varSys_op_type), intent(in) :: fun

Description of the method to obtain the variables, here some preset values might be stored, like the space time function to use or the required variables.

type(tem_varSys_type), intent(in) :: varSys

The variable system to obtain the variable from.

integer, intent(in) :: elempos(:)

TreeID of the element to get the variable for.

type(tem_time_type), intent(in) :: time

Point in time at which to evaluate the variable.

type(treelmesh_type), intent(in) :: tree

global treelm mesh info

integer, intent(in) :: n

Number of values to obtain for this variable (vectorized access).

integer, intent(in) :: nDofs

Number of degrees of freedom within an element.

real(kind=rk), intent(out) :: res(:)

Resulting values for the requested variable.

The first dimension are the n requested entries and the second dimension are the components of this variable. Third dimension are the degrees of freedom.

subroutine derive_density(fun, varSys, elempos, time, tree, n, nDofs, res)

derive density variables

Arguments

TypeIntentOptionalAttributesName
class(tem_varSys_op_type), intent(in) :: fun

Description of the method to obtain the variables, here some preset values might be stored, like the space time function to use or the required variables.

type(tem_varSys_type), intent(in) :: varSys

The variable system to obtain the variable from.

integer, intent(in) :: elempos(:)

TreeID of the element to get the variable for.

type(tem_time_type), intent(in) :: time

Point in time at which to evaluate the variable.

type(treelmesh_type), intent(in) :: tree

global treelm mesh info

integer, intent(in) :: n

Number of values to obtain for this variable (vectorized access).

integer, intent(in) :: nDofs

Number of degrees of freedom within an element.

real(kind=rk), intent(out) :: res(:)

Resulting values for the requested variable.

The first dimension are the n requested entries and the second dimension are the components of this variable. Third dimension are the degrees of freedom.

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