Regroup markers with their respective centroids on the same MPI block
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ResPart_set), | intent(inout) | :: | this |
Set of resolved particles |
impure subroutine ResPart_set_Regroup(this) !> Regroup markers with their respective centroids on ! the same MPI block implicit none class(ResPart_set), intent(inout):: this !! Set of resolved particles ! Work variables integer, allocatable :: buf1d(:) integer :: n integer(kind=8):: id ! Update this%count call this%UpdateCount() ! Allocate global arrays of centroids MPI ranks if (.not.allocated(this%ranks)) allocate(this%ranks(this%count)) if (size(this%ranks).ne. this%count) then deallocate(this%ranks) allocate(this%ranks(this%count)) end if allocate(buf1D(this%count)) ! Set to zero this%ranks(:)=0 ! Update Gloabl ranks do n=1,this%count_ id=this%p(n)%id this%ranks(id)=this%block%Locate(this%p(n)%p) end do call this%parallel%Sum(this%ranks,buf1D); this%ranks=buf1D select type (markers=>this%ib%p) type is (marker_obj) do n=1,this%ib%count_ ! %s stores global id of centroid, %t stores owning MPI rank markers(n)%t=this%ranks(markers(n)%s) end do end select ! Communicate with specified particle locator call this%ib%Communicate(ResPart_set_GetOwnerRankByRP) deallocate(buf1D) return end subroutine ResPart_set_Regroup