Counts the conforming sides of the local elements whose neighbor element is owned by another rank -- the sides an exchange sends and receives over MPI.
The scan is over the side table alone (a few integers per side), which is negligible next to packing and sending the traces those sides carry, and it stays correct when the mesh is re-partitioned under adaptive refinement.
Input - sideInfo : the mesh sideInfo array, (1:5, 1:nSidesPerElem, 1:nElem) - nElem : number of local elements - nSidesPerElem : 4 for 2-D (quadrilateral), 6 for 3-D (hexahedral)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DomainDecomposition_t), | intent(in) | :: | this | |||
| integer, | intent(in) | :: | sideInfo(1:5,1:nSidesPerElem,1:nElem) | |||
| integer, | intent(in) | :: | nElem | |||
| integer, | intent(in) | :: | nSidesPerElem |
integer function CountRemoteSides_DomainDecomposition_t(this,sideInfo,nElem,nSidesPerElem) result(nRemote)
!! Counts the conforming sides of the local elements whose neighbor element is
!! owned by another rank -- the sides an exchange sends and receives over MPI.
!!
!! The scan is over the side table alone (a few integers per side), which is
!! negligible next to packing and sending the traces those sides carry, and it
!! stays correct when the mesh is re-partitioned under adaptive refinement.
!!
!! Input
!! - sideInfo : the mesh sideInfo array, (1:5, 1:nSidesPerElem, 1:nElem)
!! - nElem : number of local elements
!! - nSidesPerElem : 4 for 2-D (quadrilateral), 6 for 3-D (hexahedral)
implicit none
class(DomainDecomposition_t),intent(in) :: this
integer,intent(in) :: nElem
integer,intent(in) :: nSidesPerElem
integer,intent(in) :: sideInfo(1:5,1:nSidesPerElem,1:nElem)
! Local
integer :: e1,s1,e2
nRemote = 0
do e1 = 1,nElem
do s1 = 1,nSidesPerElem
e2 = sideInfo(3,s1,e1) ! Neighbor element (global id); 0 on a boundary or mortar side
if(e2 > 0) then
if(this%elemToRank(e2) /= this%rankId) nRemote = nRemote+1
endif
enddo
enddo
endfunction CountRemoteSides_DomainDecomposition_t