tem_varSys_stfunVar_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_stfunvar_test~~CallsGraph program~tem_varsys_stfunvar_test tem_varSys_stfunVar_test proc~load_env load_env program~tem_varsys_stfunvar_test->proc~load_env interface~positionofval~4 positionofval program~tem_varsys_stfunvar_test->interface~positionofval~4 proc~tem_varsys_init tem_varSys_init program~tem_varsys_stfunvar_test->proc~tem_varsys_init proc~fin_env fin_env program~tem_varsys_stfunvar_test->proc~fin_env proc~tem_varsys_append_luavar tem_varSys_append_luaVar program~tem_varsys_stfunvar_test->proc~tem_varsys_append_luavar proc~check_res~2 check_res program~tem_varsys_stfunvar_test->proc~check_res~2 interface~tem_logging_init tem_logging_init program~tem_varsys_stfunvar_test->interface~tem_logging_init interface~init~15 init program~tem_varsys_stfunvar_test->interface~init~15 proc~close_config close_config program~tem_varsys_stfunvar_test->proc~close_config interface~append~16 append program~tem_varsys_stfunvar_test->interface~append~16 proc~load_config~2 load_config program~tem_varsys_stfunvar_test->proc~load_config~2 proc~tem_baryofid tem_BaryOfId program~tem_varsys_stfunvar_test->proc~tem_baryofid proc~tem_create_subtree_of_st_funlist tem_create_subTree_of_st_funList program~tem_varsys_stfunvar_test->proc~tem_create_subtree_of_st_funlist

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//'function dens_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 = "density",'//nl//'    ncomponents = 1,'//nl//'    vartype = "st_fun",'//nl//'    st_fun = dens_fun'//nl//'  },'//nl//'  {'//nl//'    name = "density_shape",'//nl//'    ncomponents = 1,'//nl//'    vartype = "st_fun",'//nl//'    st_fun = {'//nl//'      fun = dens_fun,'//nl//'      shape = shape'//nl//'    }'//nl//'  },'//nl//'  {'//nl//'    name = "density_multi_stfun",'//nl//'    ncomponents = 1,'//nl//'    vartype = "st_fun",'//nl//'    st_fun = {'//nl//'      {'//nl//'        fun = dens_fun,'//nl//'        shape = shape'//nl//'      },'//nl//'      10.0'//nl//'    }'//nl//'  },'//nl//'  {'//nl//'    name = "velocity",'//nl//'    ncomponents = 3,'//nl//'    vartype = "st_fun",'//nl//'    st_fun = vel_fun'//nl//'  },'//nl//'  {'//nl//'    name = "velocity_shape",'//nl//'    ncomponents = 3,'//nl//'    vartype = "st_fun",'//nl//'    st_fun = {'//nl//'      const={1.0,2.0,3.0},'//nl//'      shape=shape'//nl//'    }'//nl//'  },'//nl//'  {'//nl//'    name = "velocity_multi_stfun",'//nl//'    ncomponents = 3,'//nl//'    vartype = "st_fun",'//nl//'    st_fun = {'//nl//'      { 1.0, 2.0, 3.0 },'//nl//'      {'//nl//'        fun = vel_fun,'//nl//'        shape = shape'//nl//'      }'//nl//'    }'//nl//'  }'//nl//'}'//nl//'track_variable = {'//nl//'  "density",'//nl//'  "density_shape",'//nl//'  "density_multi_stfun",'//nl//'  "velocity_shape",'//nl//'  "velocity_multi_stfun",'//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):: dens =(/0.25_rk, 0.25_rk, 0.25_rk, 0.25_rk, 0.75_rk/)
real(kind=rk), parameter, dimension(nElems_track):: dens_shape =(/0.25_rk, 0.25_rk, 0.0_rk, 0.0_rk, 0.0_rk/)
real(kind=rk), parameter, dimension(nElems_track):: dens_multi_stfun =(/10.25_rk, 10.25_rk, 10.0_rk, 10.0_rk, 10.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/))
real(kind=rk), parameter, dimension(nElems_track,3):: vel_shape =reshape((/1.0_rk, 1.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 2.0_rk, 2.0_rk, 0.0_rk, 0.0_rk, 0.0_rk, 3.0_rk, 3.0_rk, 0.0_rk, 0.0_rk, 0.0_rk/), (/nElems_track, 3/))
real(kind=rk), parameter, dimension(nElems_track,3):: vel_multi_stfun =reshape((/1.25_rk, 1.25_rk, 1.0_rk, 1.0_rk, 1.0_rk, 2.25_rk, 2.75_rk, 2.0_rk, 2.0_rk, 2.0_rk, 3.25_rk, 3.25_rk, 3.0_rk, 3.0_rk, 3.0_rk/), (/nElems_track, 3/))
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)
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