tem_addFace Subroutine

private subroutine tem_addFace(leftElemId, leftElemPos, leftElemPrp, rightElemId, rightElemPos, rightElemPrp, faces)

Adds a new face to the face description.

If the face already exists in the face description, only the properties of the already existing face will be overwritten.

Arguments

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

Element id of the left element

integer, intent(in) :: leftElemPos

Position of the left element in the level descriptor's total list.

integer, intent(in) :: leftElemPrp

Properties of the left element.

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

Element id of the right element

integer, intent(in) :: rightElemPos

Position of the right element in the level desriptor's total list.

integer, intent(in) :: rightElemPrp

Properties of the right element

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

The face description the new face will be added to. If the face already exists in this face description. The existing face's property will be overwritten by the new ones.


Calls

proc~~tem_addface~~CallsGraph proc~tem_addface tem_addFace interface~append~23 append proc~tem_addface->interface~append~23 proc~append_singlega2d_real append_singlega2d_real interface~append~23->proc~append_singlega2d_real proc~append_arrayga2d_real append_arrayga2d_real interface~append~23->proc~append_arrayga2d_real interface~expand~22 expand proc~append_singlega2d_real->interface~expand~22 proc~append_arrayga2d_real->interface~expand~22 proc~expand_ga2d_real expand_ga2d_real interface~expand~22->proc~expand_ga2d_real

Called by

proc~~tem_addface~~CalledByGraph proc~tem_addface tem_addFace proc~tem_get_faces tem_get_faces proc~tem_get_faces->proc~tem_addface proc~tem_collect_faces tem_collect_faces proc~tem_collect_faces->proc~tem_get_faces proc~tem_build_face_info tem_build_face_info proc~tem_build_face_info->proc~tem_collect_faces

Contents

Source Code


Source Code

  subroutine tem_addFace( leftElemId, leftElemPos, leftElemPrp,          &
    &                     rightElemId, rightElemPos, rightElemPrp, faces )
    ! --------------------------------------------------------------------------
    !> Element id of the left element
    integer(kind=long_k), intent(in) :: leftElemId
    !> Element id of the right element
    integer(kind=long_k), intent(in) :: rightElemId
    !> Position of the left element in the level descriptor's total list.
    integer, intent(in) :: leftElemPos
    !> Properties of the left element.
    integer, intent(in) :: leftElemPrp
    !> Position of the right element in the level desriptor's total list.
    integer, intent(in) :: rightElemPos
    !> Properties of the right element
    integer, intent(in) :: rightElemPrp
    !> The face description the new face will be added to. If the face already
    !! exists in this face description. The existing face's property will be
    !! overwritten by the new ones.
    type(tem_face_descriptor_type), intent(inout) :: faces
    ! --------------------------------------------------------------------------
    logical :: wasAdded
    integer :: pos
    ! --------------------------------------------------------------------------


    ! Try to add the left tree id to the face id list of the faces
    call append( me       = faces%faceList%faceId, &
      &          val      = leftElemId,            &
      &          wasAdded = wasAdded,              &
      &          pos      = pos                    )

    ! Check if the face already existed in the face descriptor.
    ! If yes, we overwrite the properties. If no, we overwrite
    ! the existing properties.
    if(wasAdded) then ! New face
      ! Append right element, element positions and new properties
      call append( me = faces%faceList%rightElemId, val = rightElemId )
      call append( me = faces%faceList%leftElemPos, val = leftElemPos )
      call append( me = faces%faceList%rightElemPos, val = rightElemPos )
      call append( me = faces%faceList%leftPrp, val = leftElemPrp )
      call append( me = faces%faceList%rightPrp, val = rightElemPrp )
    else ! Face already existed
      ! Overwrite existing properies
      faces%faceList%leftPrp%val(pos) = leftElemPrp
      faces%faceList%rightPrp%val(pos) = rightElemPrp
    end if

  end subroutine tem_addFace