setup_cell_owners Subroutine

private subroutine setup_cell_owners(mesh, flow)

Initializes contiguous-decomposition owner lookup.

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(in) :: mesh
type(flow_mpi_t), intent(inout) :: flow

Source Code

   subroutine setup_cell_owners(mesh, flow)
      type(mesh_t), intent(in) :: mesh
      type(flow_mpi_t), intent(inout) :: flow
      integer :: r, first, last

      allocate(flow%cell_owner(mesh%ncells))
      flow%cell_owner = -1
      do r = 1, flow%nprocs
         first = flow%gather_firsts(r)
         last = first + flow%gather_counts(r) - 1
         if (last >= first) flow%cell_owner(first:last) = r - 1
      end do
   end subroutine setup_cell_owners