tem_setEffBoundingBox_fromSubTree Subroutine

private subroutine tem_setEffBoundingBox_fromSubTree(subTree, globalTree)

Calculate the real bounding box around the fluid domain

Arguments

Type IntentOptional Attributes Name
type(tem_subTree_type) :: subTree

subTree to get effective bounding cube from

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

corresponding global tree


Calls

proc~~tem_seteffboundingbox_fromsubtree~~CallsGraph proc~tem_seteffboundingbox_fromsubtree tem_setEffBoundingBox_fromSubTree interface~tem_getlocalboundingcube tem_GetLocalBoundingCube proc~tem_seteffboundingbox_fromsubtree->interface~tem_getlocalboundingcube mpi_allreduce mpi_allreduce proc~tem_seteffboundingbox_fromsubtree->mpi_allreduce proc~tem_getlocalboundingcube_fromtree tem_GetLocalBoundingCube_fromTree interface~tem_getlocalboundingcube->proc~tem_getlocalboundingcube_fromtree proc~tem_getlocalboundingcube_fromsubtree tem_GetLocalBoundingCube_fromSubTree interface~tem_getlocalboundingcube->proc~tem_getlocalboundingcube_fromsubtree proc~tem_vrtxcoordofid tem_vrtxCoordOfId proc~tem_getlocalboundingcube_fromtree->proc~tem_vrtxcoordofid proc~tem_getlocalboundingcube_fromsubtree->proc~tem_vrtxcoordofid proc~tem_coordofid tem_CoordOfId proc~tem_vrtxcoordofid->proc~tem_coordofid proc~tem_baryofid tem_BaryOfId proc~tem_vrtxcoordofid->proc~tem_baryofid

Called by

proc~~tem_seteffboundingbox_fromsubtree~~CalledByGraph proc~tem_seteffboundingbox_fromsubtree tem_setEffBoundingBox_fromSubTree interface~tem_seteffboundingbox tem_setEffBoundingBox interface~tem_seteffboundingbox->proc~tem_seteffboundingbox_fromsubtree proc~tem_create_subtree_of tem_create_subTree_of proc~tem_create_subtree_of->interface~tem_seteffboundingbox proc~tem_init_convergence tem_init_convergence proc~tem_init_convergence->proc~tem_create_subtree_of proc~tem_init_tracker_subtree tem_init_tracker_subTree proc~tem_init_tracker_subtree->proc~tem_create_subtree_of proc~tem_write_debugmesh tem_write_debugMesh proc~tem_write_debugmesh->proc~tem_create_subtree_of proc~tem_create_subtree_of_st_funlist tem_create_subTree_of_st_funList proc~tem_create_subtree_of_st_funlist->proc~tem_create_subtree_of

Contents


Source Code

  subroutine tem_setEffBoundingBox_fromSubTree( subTree, globalTree )
    ! -------------------------------------------------------------------- !
    !> subTree to get effective bounding cube from
    type(tem_subTree_type)   :: subTree
    !> corresponding global tree
    type(treelmesh_type), intent(in) :: globalTree
    ! -------------------------------------------------------------------- !
    real(kind=rk) :: boundingBox(3,2)
    real(kind=rk) :: tBounding(3)
    integer :: iErr
    ! -------------------------------------------------------------------- !

    ! if the subTree equals to the global tree take over the settings
    if( subTree%useGlobalMesh )then
      subTree%global%effOrigin = globalTree%global%effOrigin
      subTree%global%effLength = globalTree%global%effLength
    else ! subTree is not equal to the global tree
      ! Calculate process-local bounding cube
      boundingBox = tem_GetLocalBoundingCube( subTree, globalTree )
      ! Exchange with neighbors
      call mpi_allreduce( boundingBox(:,1), tBounding, 3, rk_mpi, mpi_min, &
        &                 subTree%global%comm, iErr  )
      boundingBox(:,1) = tBounding
      call mpi_allreduce( boundingBox(:,2), tBounding, 3, rk_mpi, mpi_max, &
        &                 subTree%global%comm, iErr  )
      boundingBox(:,2) = tBounding

      ! Set the effective origin and length in the global subTree part
      subTree%global%effOrigin(:) = boundingBox(:,1)
      subTree%global%effLength(:) = boundingBox(:,2) -  boundingBox(:,1)
    end if

  end subroutine tem_setEffBoundingBox_fromSubTree