16 #ifndef dealii__petsc_parallel_vector_h 17 #define dealii__petsc_parallel_vector_h 20 #include <deal.II/base/config.h> 22 #ifdef DEAL_II_WITH_PETSC 24 # include <deal.II/base/subscriptor.h> 25 # include <deal.II/lac/exceptions.h> 26 # include <deal.II/lac/vector.h> 27 # include <deal.II/lac/petsc_vector_base.h> 28 # include <deal.II/base/index_set.h> 29 # include <deal.II/lac/vector_type_traits.h> 31 DEAL_II_NAMESPACE_OPEN
216 template <
typename Number>
218 const ::Vector<Number> &v,
312 template <
typename number>
334 const bool omit_zeroing_entries =
false);
346 const bool omit_zeroing_entries =
false);
386 void print (std::ostream &out,
387 const unsigned int precision = 3,
388 const bool scientific =
true,
389 const bool across =
true)
const;
449 template <
typename number>
451 const ::Vector<number> &v,
452 const size_type local_size)
454 communicator (communicator)
495 #if DEAL_II_PETSC_VERSION_LT(3,2,0) 496 PetscErrorCode ierr = VecDestroy (
vector);
498 PetscErrorCode ierr = VecDestroy (&
vector);
503 ierr = VecCreateSeq (PETSC_COMM_SELF, n, &
vector);
514 if (v.has_ghost_elements())
517 reinit (v.communicator, v.
size(), v.local_size(),
true);
520 PetscErrorCode ierr = VecCopy (v.vector,
vector);
525 ierr = VecGhostUpdateBegin(
vector, INSERT_VALUES, SCATTER_FORWARD);
527 ierr = VecGhostUpdateEnd(
vector, INSERT_VALUES, SCATTER_FORWARD);
535 template <
typename number>
594 template <
typename>
class ReinitHelper;
604 template <
typename Matrix>
610 v.
reinit(matrix.locally_owned_range_indices(), matrix.get_mpi_communicator());
613 template <
typename Matrix>
619 v.
reinit(matrix.locally_owned_domain_indices(), matrix.get_mpi_communicator());
640 DEAL_II_NAMESPACE_CLOSE
642 #endif // DEAL_II_WITH_PETSC
types::global_dof_index size_type
Vector & operator=(const Vector &v)
#define AssertThrow(cond, exc)
VectorBase & operator=(const PetscScalar s)
static void reinit_domain_vector(const Matrix &matrix, Vector &v, bool omit_zeroing_entries)
size_type local_size() const
void compress(const VectorOperation::values operation)
unsigned int global_dof_index
VectorOperation::values last_action
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static const bool supports_distributed_data
const MPI_Comm & get_mpi_communicator() const
static void reinit_range_vector(const Matrix &matrix, Vector &v, bool omit_zeroing_entries)
IndexSet locally_owned_elements() const
bool has_ghost_elements() const
void reinit(const MPI_Comm &communicator, const size_type N, const size_type local_size, const bool omit_zeroing_entries=false)
virtual void create_vector(const size_type n, const size_type local_size)
void print(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const
void swap(Vector &u, Vector &v)