CountRemoteMortarSides_DomainDecomposition_t Function

public function CountRemoteMortarSides_DomainDecomposition_t(this, mortarInfo, nMortars, nSub) result(nRemote)

Counts the mortar sub-sides this rank exchanges over MPI: those where exactly one of the big side and the sub-side is owned by this rank. A mortar entirely on one rank is served from memory, and one entirely on other ranks is not this rank's to carry.

Input - mortarInfo : the mesh mortarInfo array, null on a mesh with no mortars. Sub-side k has its small element id at row 2*k+1, in both the 2-D (1:8,:) and 3-D (1:14,:) layouts. - nMortars : number of mortar interfaces in the (replicated) mortar table - nSub : sub-sides per mortar, 2 in 2-D (sub-edges) and 4 in 3-D (sub-faces)

Arguments

TypeIntentOptionalAttributesName
class(DomainDecomposition_t), intent(in) :: this
integer, intent(in), pointer:: mortarInfo(:,:)
integer, intent(in) :: nMortars
integer, intent(in) :: nSub

Return Value integer


Contents


Source Code

  integer function CountRemoteMortarSides_DomainDecomposition_t(this,mortarInfo,nMortars,nSub) result(nRemote)
  !! Counts the mortar sub-sides this rank exchanges over MPI: those where exactly
  !! one of the big side and the sub-side is owned by this rank. A mortar entirely
  !! on one rank is served from memory, and one entirely on other ranks is not this
  !! rank's to carry.
  !!
  !!  Input
  !!    - mortarInfo : the mesh mortarInfo array, null on a mesh with no mortars.
  !!      Sub-side k has its small element id at row 2*k+1, in both the 2-D
  !!      (1:8,:) and 3-D (1:14,:) layouts.
  !!    - nMortars : number of mortar interfaces in the (replicated) mortar table
  !!    - nSub : sub-sides per mortar, 2 in 2-D (sub-edges) and 4 in 3-D (sub-faces)
    implicit none
    class(DomainDecomposition_t),intent(in) :: this
    integer,pointer,intent(in) :: mortarInfo(:,:)
    integer,intent(in) :: nMortars
    integer,intent(in) :: nSub
    ! Local
    integer :: m,k
    logical :: bigIsLocal,smallIsLocal

    nRemote = 0
    if(.not. associated(mortarInfo)) return

    do m = 1,nMortars
      bigIsLocal = this%elemToRank(mortarInfo(1,m)) == this%rankId
      do k = 1,nSub
        smallIsLocal = this%elemToRank(mortarInfo(2*k+1,m)) == this%rankId
        if(bigIsLocal .neqv. smallIsLocal) nRemote = nRemote+1
      enddo
    enddo

  endfunction CountRemoteMortarSides_DomainDecomposition_t