tem_treeIDinTotal Function

public function tem_treeIDinTotal(tID, levelDesc, eType) result(elemPos)

Returns the absolute position in the total list of a given treeID opposed to PosOfId, where the relative position in one of the separate lists is returned. Herefore, total list has to be created beforehand.

Arguments

Type IntentOptional Attributes Name
integer(kind=long_k), intent(in) :: tID

the element you are looking for

type(tem_levelDesc_type), intent(in) :: levelDesc

the descriptor you use for searching

integer, intent(in), optional :: eType

element type

Return Value integer

return position of tID in levelDesc%total list


Calls

proc~~tem_treeidintotal~~CallsGraph proc~tem_treeidintotal tem_treeIDinTotal proc~tem_etypeofid tem_eTypeOfId proc~tem_treeidintotal->proc~tem_etypeofid tem_positioninsorted tem_positioninsorted proc~tem_treeidintotal->tem_positioninsorted interface~positionofval~5 positionofval proc~tem_etypeofid->interface~positionofval~5 proc~posofval_label posofval_label interface~positionofval~5->proc~posofval_label interface~sortedposofval~5 sortedposofval proc~posofval_label->interface~sortedposofval~5

Called by

proc~~tem_treeidintotal~~CalledByGraph proc~tem_treeidintotal tem_treeIDinTotal proc~tem_build_listhorizontaldep tem_build_listHorizontalDep proc~tem_build_listhorizontaldep->proc~tem_treeidintotal proc~tem_build_treehorizontaldep tem_build_treeHorizontalDep proc~tem_build_treehorizontaldep->proc~tem_treeidintotal proc~tem_build_verticaldependencies tem_build_verticalDependencies proc~tem_build_verticaldependencies->proc~tem_treeidintotal proc~tem_get_faceneigh tem_get_faceNeigh proc~tem_get_faceneigh->proc~tem_treeidintotal proc~tem_init_surfdata tem_init_surfData proc~tem_init_surfdata->proc~tem_treeidintotal proc~update_buffer_elempos update_buffer_elemPos proc~update_buffer_elempos->proc~tem_treeidintotal proc~update_elempostototalpos update_elemPosToTotalPos proc~update_elempostototalpos->proc~tem_treeidintotal proc~update_elempostototalpos->proc~update_buffer_elempos proc~tem_build_horizontaldependencies tem_build_horizontalDependencies proc~tem_build_horizontaldependencies->proc~tem_build_listhorizontaldep proc~tem_build_horizontaldependencies->proc~tem_build_treehorizontaldep proc~tem_create_leveldesc tem_create_levelDesc proc~tem_create_leveldesc->proc~tem_build_verticaldependencies proc~tem_create_leveldesc->proc~tem_build_horizontaldependencies proc~tem_find_allelements tem_find_allElements proc~tem_create_leveldesc->proc~tem_find_allelements proc~tem_extend_commfromcoarserprp tem_extend_commFromCoarserPrp proc~tem_extend_commfromcoarserprp->proc~tem_get_faceneigh proc~tem_extend_commfromfinerprp tem_extend_commFromFinerPrp proc~tem_extend_commfromfinerprp->proc~tem_get_faceneigh proc~tem_find_allelements->proc~update_elempostototalpos proc~tem_get_faces tem_get_faces proc~tem_get_faces->proc~tem_get_faceneigh proc~tem_update_surfpos tem_update_surfPos proc~tem_update_surfpos->proc~tem_init_surfdata proc~tem_collect_faces tem_collect_faces proc~tem_collect_faces->proc~tem_get_faces proc~tem_dimbydim_construction tem_dimByDim_construction proc~tem_dimbydim_construction->proc~tem_create_leveldesc proc~tem_extend_remoteprp tem_extend_remotePrp proc~tem_extend_remoteprp->proc~tem_extend_commfromcoarserprp proc~tem_extend_remoteprp->proc~tem_extend_commfromfinerprp proc~tem_build_face_info tem_build_face_info proc~tem_build_face_info->proc~tem_collect_faces proc~tem_build_face_info->proc~tem_dimbydim_construction proc~tem_build_face_info->proc~tem_extend_remoteprp

Source Code

  function tem_treeIDinTotal( tID, levelDesc, eType ) result( elemPos )
    ! -------------------------------------------------------------------- !
    !> the element you are looking for
    integer(kind=long_k), intent(in) :: tID
    !> the descriptor you use for searching
    type(tem_levelDesc_type), intent(in) :: levelDesc
    !> element type
    integer, intent(in), optional :: eType
    !> return position of tID in levelDesc%total list
    integer :: elemPos
    ! -------------------------------------------------------------------- !
    integer :: eType_loc
    ! -------------------------------------------------------------------- !

    if( present( eType )) then
      eType_loc = eType
    else
      eType_loc = tem_eTypeOfID( tID, levelDesc%elem )
    end if

    elemPos = 0
    if( eType_loc > 0 ) then
      elemPos = tem_PositionInSorted( me    = levelDesc%total,                 &
        &                             lower = levelDesc%offset(1, eType_loc)+1,&
        &                             upper = levelDesc%offset(2, eType_loc),  &
        &                             val   = tID )
    end if
    elemPos = max( elemPos, 0 )

  end function tem_treeIDinTotal