The following function provides the coordinates of the origin for a given ID in the complete mesh.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree |
mesh information |
||
integer(kind=long_k), | intent(in) | :: | TreeID |
input element ID |
origin return value
pure function tem_originOfId(tree,TreeID) result(origin)
! -------------------------------------------------------------------- !
!> mesh information
type(treelmesh_type), intent(in) :: tree
!> input element ID
integer(kind=long_k), intent(in) :: TreeID
!> origin return value
real(kind=rk) :: origin(3)
! -------------------------------------------------------------------- !
integer :: coord(4) !< spatial index triple for a given ID
real(kind=rk) :: dx !< size of Element
! -------------------------------------------------------------------- !
coord = tem_CoordOfId( TreeID )
dx = tem_elemSizeLevel( tree, coord(4) )
origin = tree%global%origin + real(coord(:3), kind=rk)*dx
end function tem_originOfId