tem_originOfId Function

public pure function tem_originOfId(tree, TreeID) result(origin)

The following function provides the coordinates of the origin for a given ID in the complete mesh.

Arguments

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

mesh information

integer(kind=long_k), intent(in) :: TreeID

input element ID

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

origin return value


Source Code

  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