This UTEST is to test variable system. load variables and access state and derive quantities from c pointer methoddata
Type | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|
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 |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
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 | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | nRequestedVars | ||||
type(grw_intarray_type), | public | :: | varPos | ||||
character(len=labelLen), | public, | allocatable | :: | variable(:) |
load variables defined in sysConf
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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(:) |
access state variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
derive density variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
Check tracking results
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=labelLen), | intent(in) | :: | varname | |||
real(kind=rk), | intent(in) | :: | res(:) | |||
integer, | intent(out) | :: | error |