18#ifdef DEAL_II_WITH_PETSC
26# define AssertPETSc(code) \
29 PetscErrorCode ierr = (code); \
30 AssertThrow(ierr == 0, ExcPETScError(ierr)); \
61 want.add_range(start, end);
62 want.add_indices(ghost_indices);
67 IS is =
want.make_petsc_is(communicator);
86 std::vector<types::global_dof_index>
in_deal;
90 std::vector<types::global_dof_index>
out_deal;
94 std::vector<PetscInt>
dummy;
101 const std::vector<types::global_dof_index> &
indices_has,
102 const std::vector<types::global_dof_index> &
indices_want,
154 const std::vector<PetscInt> &
inloc,
155 const std::vector<PetscInt> &
outidx,
156 const std::vector<PetscInt> &
outloc,
175 PetscInt n =
static_cast<PetscInt
>(
inidx.
size());
179 Utilities::MPI::internal::all_reduce<PetscInt>(
194 const PetscInt *ranges;
199 for (
const auto idx :
inidx)
202 if (idx < ranges[
owner] || ranges[
owner + 1] <= idx)
215 const_cast<PetscInt *
>(
234 const_cast<PetscInt *
>(n > 0 ?
outidx.
data() :
nullptr)));
258 template <
typename Number>
264 auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
266# if DEAL_II_PETSC_VERSION_LT(3, 15, 0)
274 template <
typename Number>
280 auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
282# if DEAL_II_PETSC_VERSION_LT(3, 15, 0)
290 template <
typename Number>
300 template <
typename Number>
308 auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
314 template <
typename Number>
322 auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
327 template <
typename Number>
343 , ghost_indices_data()
344 , n_ghost_indices_data(
numbers::invalid_dof_index)
345 , n_ghost_indices_larger(
numbers::invalid_dof_index)
370 std::vector<types::global_dof_index> local_indices;
382 ExcMessage(
"The given larger ghost index set must contain "
383 "all indices in the actual index set."));
400 template <
typename Number>
415 template <
typename Number>
431 template <
typename Number>
440 template <
typename Number>
457 template <
typename Number>
474 template <
typename Number>
487# include "petsc_communication_pattern.inst"
value_type * data() const noexcept
void fill_index_vector(std::vector< size_type > &indices) const
size_type n_elements() const
void subtract_set(const IndexSet &other)
MPI_Comm get_mpi_communicator() const override
void import_from_ghosted_array(const VectorOperation::values op, const ArrayView< const Number > &ghost_array, const ArrayView< Number > &locally_owned_array) const
virtual ~CommunicationPattern() override
void export_to_ghosted_array_start(const ArrayView< const Number > &locally_owned_array, const ArrayView< Number > &ghost_array) const
void export_to_ghosted_array(const ArrayView< const Number > &locally_owned_array, const ArrayView< Number > &ghost_array) const
void export_to_ghosted_array_finish(const ArrayView< const Number > &locally_owned_array, const ArrayView< Number > &ghost_array) const
void import_from_ghosted_array_finish(const VectorOperation::values op, const ArrayView< const Number > &ghost_array, const ArrayView< Number > &locally_owned_array) const
void do_reinit(const std::vector< PetscInt > &inidx, const std::vector< PetscInt > &inloc, const std::vector< PetscInt > &outidx, const std::vector< PetscInt > &outloc, const MPI_Comm communicator)
virtual void reinit(const IndexSet &locally_owned_indices, const IndexSet &ghost_indices, const MPI_Comm communicator) override
void import_from_ghosted_array_start(const VectorOperation::values op, const ArrayView< const Number > &ghost_array, const ArrayView< Number > &locally_owned_array) const
types::global_dof_index n_ghost_indices_data
CommunicationPattern ghost
IndexSet ghost_indices_data
void import_from_ghosted_array(const VectorOperation::values op, const ArrayView< const Number > &ghost_array, const ArrayView< Number > &locally_owned_array) const
void export_to_ghosted_array_finish(const ArrayView< const Number > &locally_owned_array, const ArrayView< Number > &ghost_array) const
MPI_Comm get_mpi_communicator() const override
void export_to_ghosted_array(const ArrayView< const Number > &locally_owned_array, const ArrayView< Number > &ghost_array) const
const IndexSet & ghost_indices() const
void export_to_ghosted_array_start(const ArrayView< const Number > &locally_owned_array, const ArrayView< Number > &ghost_array) const
void import_from_ghosted_array_start(const VectorOperation::values op, const ArrayView< const Number > &ghost_array, const ArrayView< Number > &locally_owned_array) const
virtual void reinit(const IndexSet &locally_owned_indices, const IndexSet &ghost_indices, const MPI_Comm communicator) override
void import_from_ghosted_array_finish(const VectorOperation::values op, const ArrayView< const Number > &ghost_array, const ArrayView< Number > &locally_owned_array) const
CommunicationPattern larger_ghost
types::global_dof_index n_ghost_indices_larger
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
const types::global_dof_index invalid_dof_index
#define AssertPETSc(code)