tem_treeIDfrom_subTree Subroutine

public subroutine tem_treeIDfrom_subTree(me, glob_tree, treeID, bound)

This subroutine derives all treeIDs of a subTree from the corresponding global tree and stores them in treeID.

Arguments

Type IntentOptional Attributes Name
type(tem_subTree_type), intent(in) :: me

subTree of glob_tree

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

corresponding global tree

integer(kind=long_k), intent(out), allocatable :: treeID(:)

complete treeID list

integer, intent(in) :: bound(2)

lower(1) and upper(2) bound of the element array


Source Code

  subroutine tem_treeIDfrom_subTree( me, glob_tree, treeID, bound )
    ! ---------------------------------------------------------------------------
    !> subTree of glob_tree
    type(tem_subTree_type), intent(in) :: me
    !> corresponding global tree
    type(treelmesh_type), intent(in) :: glob_tree
    !> complete treeID list
    integer(kind=long_k), intent(out), allocatable :: treeID(:)
    !> lower(1) and upper(2) bound of the element array
    integer, intent(in) :: bound(2)
    ! ---------------------------------------------------------------------------

    ! allocate the array of treeIDs
    allocate( treeID( bound(2)-bound(1)+1 ))
    ! set the number of elements in the subTree
    if( me%useGlobalMesh)then
      treeID = glob_tree%treeID( bound(1) : bound(2) )
    else if( me%useLocalMesh)then
      treeID = me%treeID( bound(1) : bound(2) )
    else
      treeID = glob_tree%treeID( me%map2global( bound(1) : bound(2) ) )
    end if

  end subroutine tem_treeIDfrom_subTree