20#ifdef DEAL_II_WITH_PETSC
32 : communicator(MPI_COMM_SELF)
45 : communicator(communicator)
56 , communicator(communicator)
75 : communicator(communicator)
90 , communicator(v.communicator)
105 : communicator(communicator)
141 ierr = VecGhostUpdateBegin(
vector, INSERT_VALUES, SCATTER_FORWARD);
143 ierr = VecGhostUpdateEnd(
vector, INSERT_VALUES, SCATTER_FORWARD);
166 const bool omit_zeroing_entries)
176 MPI_Allreduce(&k, &k_global, 1, MPI_INT, MPI_LOR,
communicator);
191 const PetscErrorCode ierr = VecDestroy(&
vector);
199 if (omit_zeroing_entries ==
false)
211 if (!omit_zeroing_entries)
213 const PetscErrorCode ierr = VecSet(
vector, 0.0);
221 omit_zeroing_entries);
231 const PetscErrorCode ierr = VecDestroy(&
vector);
247 const PetscErrorCode ierr = VecDestroy(&
vector);
286 std::vector<size_type> ghostindices;
289 const PetscInt *ptr =
290 (ghostindices.size() > 0 ?
291 reinterpret_cast<const PetscInt *
>(ghostindices.data()) :
316 ierr = VecGhostGetLocalForm(
vector, &
l);
320 ierr = VecGetSize(
l, &lsize);
323 ierr = VecGhostRestoreLocalForm(
vector, &
l);
338# if DEAL_II_PETSC_VERSION_LT(3, 6, 0)
351# ifdef DEAL_II_WITH_MPI
355 return num_nonzero == 0;
357 return has_nonzero == 0;
364 const unsigned int precision,
365 const bool scientific,
366 const bool across)
const
373 PetscInt nlocal, istart, iend;
375 PetscErrorCode ierr = VecGetArray(
vector, &val);
378 ierr = VecGetLocalSize(
vector, &nlocal);
381 ierr = VecGetOwnershipRange(
vector, &istart, &iend);
385 std::ios::fmtflags old_flags = out.flags();
386 unsigned int old_precision = out.precision(precision);
388 out.precision(precision);
390 out.setf(std::ios::scientific, std::ios::floatfield);
392 out.setf(std::ios::fixed, std::ios::floatfield);
399 for (
unsigned int i = 0;
410 out <<
"[Proc" << i <<
" " << istart <<
"-" << iend - 1 <<
"]"
412 for (PetscInt i = 0; i < nlocal; ++i)
413 out << val[i] <<
' ';
417 out <<
"[Proc " << i <<
" " << istart <<
"-" << iend - 1
419 for (PetscInt i = 0; i < nlocal; ++i)
420 out << val[i] << std::endl;
426 out.flags(old_flags);
427 out.precision(old_precision);
431 ierr = VecRestoreArray(
vector, &val);
void fill_index_vector(std::vector< size_type > &indices) const
size_type n_elements() const
void subtract_set(const IndexSet &other)
bool is_ascending_and_one_to_one(const MPI_Comm &communicator) const
virtual void create_vector(const size_type n, const size_type locally_owned_size)
void print(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const
virtual void clear() override
void reinit(const MPI_Comm &communicator, const size_type N, const size_type locally_owned_size, const bool omit_zeroing_entries=false)
Vector & operator=(const Vector &v)
VectorOperation::values last_action
IndexSet locally_owned_elements() const
bool has_ghost_elements() const
size_type locally_owned_size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcIO()
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertThrowMPI(error_code)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
static const types::blas_int zero
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
VectorType::value_type * end(VectorType &V)
VectorType::value_type * begin(VectorType &V)
unsigned int this_mpi_process(const MPI_Comm &mpi_communicator)
T sum(const T &t, const MPI_Comm &mpi_communicator)
unsigned int n_mpi_processes(const MPI_Comm &mpi_communicator)
*braid_SplitCommworld & comm