16#ifndef dealii_petsc_block_vector_h
17#define dealii_petsc_block_vector_h
22#ifdef DEAL_II_WITH_PETSC
130 const std::vector<IndexSet> &ghost_indices,
144 template <
size_t num_blocks>
145 explicit BlockVector(
const std::array<Vec, num_blocks> &);
257 const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
310 operator const Vec &()
const;
344 print(std::ostream & out,
345 const unsigned int precision = 3,
346 const bool scientific =
true,
347 const bool across =
true)
const;
413 for (
unsigned int i = 0; i < this->
n_blocks(); ++i)
433 const std::vector<IndexSet> &ghost_indices,
450 template <
size_t num_blocks>
485 for (
unsigned int i = 0; i < this->
n_blocks(); ++i)
519 for (
unsigned int i = 0; i < this->
n_blocks(); ++i)
536 for (
unsigned int i = 0; i < this->
n_blocks(); ++i)
553 for (
unsigned int i = 0; i < this->
n_blocks(); ++i)
574 for (
unsigned int i = 0; i < this->
n_blocks(); ++i)
587 const std::vector<std::shared_ptr<const Utilities::MPI::Partitioner>>
596 for (
unsigned int i = 0; i < this->
n_blocks(); ++i)
618 for (
unsigned int i = 0; i < this->
n_blocks(); ++i)
639 const unsigned int precision,
640 const bool scientific,
643 for (
unsigned int i = 0; i < this->
n_blocks(); ++i)
646 out <<
'C' << i <<
':';
648 out <<
"Component " << i << std::endl;
673 namespace LinearOperatorImplementation
686 template <
typename Matrix>
692 v.
reinit(matrix.locally_owned_range_indices(),
693 matrix.get_mpi_communicator());
696 template <
typename Matrix>
702 v.
reinit(matrix.locally_owned_domain_indices(),
703 matrix.get_mpi_communicator());
void reinit(const unsigned int n_blocks, const size_type n_elements_per_block)
::internal::BlockVectorIterators::Iterator< BlockVectorBase, false > iterator
unsigned int n_blocks() const
const value_type * const_pointer
typename BlockType::const_reference const_reference
types::global_dof_index size_type
typename BlockType::value_type value_type
BlockVectorBase & operator=(const value_type s)
std::vector< Vector > components
::internal::BlockVectorIterators::Iterator< BlockVectorBase, true > const_iterator
typename BlockType::reference reference
BlockIndices block_indices
BlockType & block(const unsigned int i)
std::size_t locally_owned_size() const
const BlockIndices & get_block_indices() const
BaseClass::value_type value_type
void print(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const
bool has_ghost_elements() const
void swap(BlockVector &v)
BaseClass::const_reference const_reference
void swap(BlockVector &u, BlockVector &v)
MPI_Comm get_mpi_communicator() const
BaseClass::pointer pointer
BlockVector & operator=(const value_type s)
BaseClass::reference reference
void compress(VectorOperation::values operation)
BaseClass::const_pointer const_pointer
bool has_ghost_elements() const
static void reinit_range_vector(const Matrix &matrix, PETScWrappers::MPI::BlockVector &v, bool)
static void reinit_domain_vector(const Matrix &matrix, PETScWrappers::MPI::BlockVector &v, bool)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DeclException0(Exception0)
static ::ExceptionBase & ExcNonMatchingBlockVectors()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcIteratorRangeDoesNotMatchVectorSize()