This subroutine creates a new mesh in treelmesh format from a global and a sub tree and dumps it to disc in treelmesh format (needed for tracking in harvester format where the mesh has to be dumped to disc)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_subTree_type), | intent(in) | :: | me |
subTree to dump to disk |
||
type(treelmesh_type), | intent(in) | :: | globalTree |
the global tree |
||
logical, | intent(in), | optional | :: | root_only |
root dump global mesh when true and all process dump its own mesh when false |
subroutine tem_dump_subTree( me, globalTree, root_only )
! ---------------------------------------------------------------------------
!> subTree to dump to disk
type(tem_subTree_type), intent(in) :: me
!> the global tree
type(treelmesh_type), intent(in) :: globalTree
!> root dump global mesh when true and
!! all process dump its own mesh when false
logical, intent(in), optional :: root_only
! ---------------------------------------------------------------------------
type(treelmesh_type) :: local_tree
integer :: iElem
! ---------------------------------------------------------------------------
local_tree%global = me%global
local_tree%nElems = me%nElems
local_tree%elemOffset = me%elemOffset
allocate(local_tree%treeID( me%nElems ))
if (me%useLocalMesh) then
local_tree%treeID = me%treeID
else if (me%useGlobalMesh) then
local_tree%treeID = globalTree%treeID
else
do iElem = 1, me%nElems
local_tree%treeID( iElem ) = globalTree%treeID( me%map2global( iElem ))
end do
endif
allocate( local_tree%ElemPropertyBits( size( me%ElemPropertyBits )))
local_tree%ElemPropertyBits = me%ElemPropertyBits
if (associated(me%property)) then
allocate( local_tree%Property( size( me%Property )))
local_tree%Property = me%Property
end if
call dump_treelmesh( me = local_tree, root_only = root_only )
end subroutine tem_dump_subTree