Initialize the tracker entities: * create varMap, i.e. map requested variables to global variable system * initialize spatial reduction * initialize hvs output
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_tracking_type), | intent(inout) | :: | me | tracking entities |
||
type(treelmesh_type), | intent(in) | :: | tree | Global mesh from which the elements are identified and then stored to sub-meshes inside the trackers |
||
type(tem_solveHead_type), | intent(in) | :: | solver | Global solver information |
||
type(tem_varSys_type), | intent(in) | :: | varSys | solver-provided variable systems |
||
integer, | intent(in), | optional | :: | nDofs | The number of dofs for each scalar variable of the equation system |
|
type(tem_comm_env_type), | intent(in) | :: | globProc | Process description to use. |
||
integer, | intent(in), | optional | :: | solSpec_unit | Solver specific unit for restart header |
subroutine tem_init_tracker( me, tree, solver, varSys, nDofs, globProc, &
& solSpec_unit )
! -------------------------------------------------------------------- !
!> tracking entities
type(tem_tracking_type),intent(inout) :: me
!> Global mesh from which the elements are identified and then stored to
!! sub-meshes inside the trackers
type(treelmesh_type), intent(in) :: tree
!> Global solver information
type(tem_solveHead_type),intent(in) :: solver
!> solver-provided variable systems
type(tem_varSys_type), intent(in) :: varSys
!> The number of dofs for each scalar variable of the equation system
integer, intent(in), optional :: nDofs
!> Process description to use.
type(tem_comm_env_type), intent(in) :: globProc
!> Solver specific unit for restart header
integer, optional, intent(in) :: solSpec_unit
! -------------------------------------------------------------------- !
integer :: iLog, nVars, iVar, iConfig
! prefix for tracking label to differiate tracking for different scheme
! with same tracking label
character(len=pathLen) :: prefix
! tracking%config%prefix//tracking%config%label
character(len=pathLen) :: basename
! -------------------------------------------------------------------- !
call tem_horizontalSpacer(fUnit=logUnit(1))
write(logUnit(1),*) 'Initialize tracking objects'
call tem_horizontalSpacer(fUnit=logUnit(1))
! prefix for tracking label to differiate tracking for different scheme
! with same tracking label
prefix = trim(solver%simName)//'_'
if( me%control%active ) then
do iLog = 1, me%control%nActive
iConfig = me%instance(iLog)%pntConfig
write(logUnit(3),"(A,I0,A)") 'Track object: ', iLog, ', label: ' &
& // trim( me%config(iConfig)%label )
! map variables
! create tracking variable position in the global varSys
call tem_create_varMap( varname = me%config(iConfig)%varname, &
& varSys = varSys, &
& varMap = me%instance(iLog)%varMap )
nVars = me%instance(iLog)%varMap%varPos%nVals
! Abort if none variables of the variable defined in current
! tracking object are found in varSys
if ( nVars /= size( me%config(iConfig)%varname ) ) then
write(logUnit(1),*) ' Some of the following variables are not found:'
do iVar = 1, size(me%config(iConfig)%varName)
write(logUnit(1),*) trim(me%config(iConfig)%varName(iVar))
end do
call tem_abort()
end if
basename = trim(me%config(iConfig)%prefix) // trim(prefix) &
& // trim(me%config(iConfig)%label)
! Init spatial reduction
me%instance(iLog)%output_file%ascii%isReduce = me%config(iConfig) &
& %redSpatial_config%active
if ( me%config(iConfig)%redSpatial_config%active ) then
! Initialize reduction
call tem_reduction_spatial_init( &
& me = me%instance(iLog)%output_file%ascii &
& %redSpatial, &
& redSpatial_config = me%config(iConfig)%redSpatial_config, &
& varSys = varSys, &
& varPos = me%instance(iLog)%varMap%varPos%val(:nVars) )
end if
! Initialize output
if ( me%instance(iLog)%subTree%useGlobalMesh ) then
call hvs_output_init(out_file = me%instance(iLog)%output_file, &
& out_config = me%config(iConfig)%output_config, &
& tree = tree, &
& varSys = varSys, &
& varPos = me%instance(iLog)%varMap%varPos &
& %val(:nVars), &
& basename = trim(basename), &
& globProc = globProc, &
& timeControl = me%config(iConfig)%timeControl, &
& solver = solver, &
& geometry = me%config(iConfig)%geometry, &
& nDofs = nDofs, &
& solSpec_unit = solSpec_unit )
else
call hvs_output_init(out_file = me%instance(iLog)%output_file, &
& out_config = me%config(iConfig)%output_config, &
& tree = tree, &
& varSys = varSys, &
& varPos = me%instance(iLog)%varMap%varPos &
& %val(:nVars), &
& subTree = me%instance(iLog)%subTree, &
& basename = trim(basename), &
& globProc = globProc, &
& timeControl = me%config(iConfig)%timeControl, &
& solver = solver, &
& geometry = me%config(iConfig)%geometry, &
& nDofs = nDofs, &
& solspec_unit = solSpec_unit )
end if
end do
end if ! if tracking active
end subroutine tem_init_tracker