Run through all the elements, check the vertices and return the fluid bounding cube
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree |
global mesh information |
xyz coordinate for min and max of bounding cube
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