tem_GetLocalBoundingCube_fromTree Function

private function tem_GetLocalBoundingCube_fromTree(tree) result(BoundingCube)

Run through all the elements, check the vertices and return the fluid bounding cube

Arguments

Type IntentOptional Attributes Name
type(treelmesh_type), intent(in) :: tree

global mesh information

Return Value real(kind=rk), (3,2)

xyz coordinate for min and max of bounding cube


Calls

proc~~tem_getlocalboundingcube_fromtree~~CallsGraph proc~tem_getlocalboundingcube_fromtree tem_GetLocalBoundingCube_fromTree proc~tem_vrtxcoordofid tem_vrtxCoordOfId proc~tem_getlocalboundingcube_fromtree->proc~tem_vrtxcoordofid proc~tem_baryofid tem_BaryOfId proc~tem_vrtxcoordofid->proc~tem_baryofid proc~tem_coordofid tem_CoordOfId proc~tem_vrtxcoordofid->proc~tem_coordofid proc~tem_baryofid->proc~tem_coordofid proc~tem_elemsizelevel tem_ElemSizeLevel proc~tem_baryofid->proc~tem_elemsizelevel proc~tem_levelof tem_LevelOf proc~tem_coordofid->proc~tem_levelof

Called by

proc~~tem_getlocalboundingcube_fromtree~~CalledByGraph proc~tem_getlocalboundingcube_fromtree tem_GetLocalBoundingCube_fromTree interface~tem_getlocalboundingcube tem_GetLocalBoundingCube interface~tem_getlocalboundingcube->proc~tem_getlocalboundingcube_fromtree proc~tem_getrealboundingcube tem_GetRealBoundingCube proc~tem_getrealboundingcube->interface~tem_getlocalboundingcube proc~tem_seteffboundingbox_fromsubtree tem_setEffBoundingBox_fromSubTree proc~tem_seteffboundingbox_fromsubtree->interface~tem_getlocalboundingcube interface~tem_seteffboundingbox tem_setEffBoundingBox interface~tem_seteffboundingbox->proc~tem_seteffboundingbox_fromsubtree proc~tem_seteffboundingbox_fromtree tem_setEffBoundingBox_fromTree interface~tem_seteffboundingbox->proc~tem_seteffboundingbox_fromtree proc~tem_seteffboundingbox_fromtree->proc~tem_getrealboundingcube proc~tem_create_subtree_of tem_create_subTree_of proc~tem_create_subtree_of->interface~tem_seteffboundingbox

Source Code

  function tem_GetLocalBoundingCube_fromTree( tree ) result(BoundingCube)
    ! -------------------------------------------------------------------- !
    !> global mesh information
    type(treelmesh_type), intent(in) :: tree
    !> xyz coordinate for min and max of bounding cube
    real(kind=rk) :: BoundingCube(3,2)
    ! -------------------------------------------------------------------- !
    real(kind=rk) :: vrtxCoord(3,8) ! coordinates for all eight vertices
    real(kind=rk) :: minX(3) ! xyz coordinate for min of bounding cube
    real(kind=rk) :: maxX(3) ! xyz coordinate for max of bounding cube
    integer(kind=long_k) :: tTreeID
    integer :: iElem, iVert
    ! -------------------------------------------------------------------- !

    minX =  huge( minX )
    maxX = -huge( maxX )

    do iElem = 1, tree%nElems
      tTreeID = tree%treeID( iElem )
      ! Calculate coordinates of vertices
      vrtxCoord(:,:) = tem_vrtxCoordOfId( tree, tTreeID )
      do iVert = 1, 8
        ! Compare with min max
        minX(:) = min( minX(:), vrtxCoord(:, iVert ))
        maxX(:) = max( maxX(:), vrtxCoord(:, iVert ))
      enddo
    enddo
    BoundingCube(:,1) = minX(:)
    BoundingCube(:,2) = maxX(:)

  end function tem_GetLocalBoundingCube_fromTree