tem_addDep_up Subroutine

private subroutine tem_addDep_up(fineFacePos, fineFaces, coarseFaces)

descriptor.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: fineFacePos

The position of the face in the fineFaces descriptor you want to add.

type(tem_face_descriptor_type), intent(inout) :: fineFaces

The description of the faces on the fine level. The dependency will be added to this face descriptor.

type(tem_face_descriptor_type), intent(in) :: coarseFaces

The descriptor of the faces on the coarse level.


Source Code

  subroutine tem_addDep_up( fineFacePos, fineFaces, coarseFaces )
    ! --------------------------------------------------------------------------
    !> The position of the face in the fineFaces descriptor you want to add.
    integer, intent(in) :: fineFacePos
    !> The description of the faces on the fine level. The dependency will be
    !! added to this face descriptor.
    type(tem_face_descriptor_type), intent(inout) :: fineFaces
    !> The descriptor of the faces on the coarse level.
    type(tem_face_descriptor_type), intent(in) :: coarseFaces
    ! --------------------------------------------------------------------------
    integer(kind=long_k) :: faceId, parentId
    integer :: parentPos
    ! --------------------------------------------------------------------------

    ! Left element id of the face.
    faceId = fineFaces%faceList%faceId%val(fineFacePos)

    ! Identify the parent element.
    parentId = tem_parentOf(faceId)

    ! Get its position in the coarse face descriptor.
    parentPos = PositionOfVal( me  = coarseFaces%faceList%faceId, &
      &                        val = parentId                     )

    ! If the parent element exists in the coarse face descriptor, add a
    ! dependency from fine element to its parent element.
    if( parentPos<=0 ) then
      fineFaces%faceDep%parentFaceId(fineFacePos) = -1_long_k
      fineFaces%faceDep%parentFacePos(fineFacePos) = -1
    else
      fineFaces%faceDep%parentFaceId(fineFacePos) = parentId
      fineFaces%faceDep%parentFacePos(fineFacePos) = parentPos
    end if

  end subroutine tem_addDep_up