tem_extend_commFromCoarserPrp Subroutine

private subroutine tem_extend_commFromCoarserPrp(levelDesc, direction, faces)

the neighboring halo element is from coarser on the remote partition.

Arguments

Type IntentOptional Attributes Name
type(tem_levelDesc_type), intent(in) :: levelDesc

Level descriptor of the level of the mesh you want to collect the faces for.

integer, intent(in) :: direction

The face direction.

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

Description of the faces on the current level.


Source Code

  subroutine tem_extend_commFromCoarserPrp( levelDesc, direction, faces )
    ! --------------------------------------------------------------------------
    !> Level descriptor of the level of the mesh you want to collect the
    !! faces for.
    type(tem_levelDesc_type), intent(in) :: levelDesc
    !> The face direction.
    integer, intent(in) :: direction
    !> Description of the faces on the current level.
    type(tem_face_descriptor_type), intent(inout) :: faces
    ! --------------------------------------------------------------------------
    integer :: iElem, iProc
    integer :: neighIndex
    integer(kind=long_k) :: elemId, neighId
    integer :: elemPos, neighPos
    ! --------------------------------------------------------------------------

    ! We run over all the elements in the from coarser buffer and attach
    ! the from coarser property to the face the element is aligned to.
    processLoop: do iProc = 1, levelDesc%recvbufferFromCoarser%nProcs

      elementLoop: do iElem = 1, levelDesc%recvbufferFromCoarser%              &
        &                                                     nElemsProc(iProc)

        ! The element position in the total list of the level descriptor.
        elemPos = levelDesc%recvbufferFromCoarser%elemPos(iProc)%val(iElem)
        elemId = levelDesc%total(elemPos)

        ! Attach elem property for its right face (checks also if face exists).
        neighIndex = tem_right
        call tem_get_faceNeigh( levelDesc, elemPos, direction, neighIndex, &
          &                     neighId, neighPos                          )
        call tem_appendFace_prp( elemId, tem_fromCoarserFace_prp, faces, &
          &                      tem_left                        )

        ! Attach elem property for its left face (checks also if face exists).
        neighIndex = tem_left
        call tem_get_faceNeigh( levelDesc, elemPos, direction, neighIndex, &
          &                     neighId, neighPos                          )
        call tem_appendFace_prp( neighId, tem_fromCoarserFace_prp, faces, &
          &                      tem_right                        )

      end do elementLoop
    end do processLoop

  end subroutine tem_extend_commFromCoarserPrp