16 #ifndef dealii_la_parallel_block_vector_h 17 #define dealii_la_parallel_block_vector_h 20 #include <deal.II/base/config.h> 22 #include <deal.II/base/exceptions.h> 24 #include <deal.II/lac/block_indices.h> 25 #include <deal.II/lac/block_vector_base.h> 26 #include <deal.II/lac/la_parallel_vector.h> 27 #include <deal.II/lac/vector_operation.h> 28 #include <deal.II/lac/vector_type_traits.h> 33 DEAL_II_NAMESPACE_OPEN
36 #ifdef DEAL_II_WITH_PETSC 46 #ifdef DEAL_II_WITH_TRILINOS 81 template <
typename Number>
115 using pointer =
typename BaseClass::pointer;
116 using const_pointer =
typename BaseClass::const_pointer;
117 using reference =
typename BaseClass::reference;
118 using const_reference =
typename BaseClass::const_reference;
119 using size_type =
typename BaseClass::size_type;
138 explicit BlockVector(
const size_type num_blocks = 0,
139 const size_type block_size = 0);
159 template <
typename OtherNumber>
166 BlockVector(
const std::vector<size_type> &block_sizes);
172 BlockVector(
const std::vector<IndexSet> &local_ranges,
173 const std::vector<IndexSet> &ghost_indices,
174 const MPI_Comm communicator);
179 BlockVector(
const std::vector<IndexSet> &local_ranges,
180 const MPI_Comm communicator);
210 template <
class Number2>
220 #ifdef DEAL_II_WITH_PETSC 232 #ifdef DEAL_II_WITH_TRILINOS 259 reinit(
const size_type num_blocks,
260 const size_type block_size = 0,
261 const bool omit_zeroing_entries =
false);
283 reinit(
const std::vector<size_type> &N,
284 const bool omit_zeroing_entries =
false);
300 template <
typename Number2>
303 const bool omit_zeroing_entries =
false);
364 template <
typename OtherNumber>
366 add(
const std::vector<size_type> & indices,
367 const ::Vector<OtherNumber> &values);
420 lp_norm(
const real_type p)
const;
454 const bool omit_zeroing_entries =
false)
override;
492 std::shared_ptr<const CommunicationPatternBase> communication_pattern =
493 std::shared_ptr<const CommunicationPatternBase>())
override;
517 template <
typename FullMatrixType>
521 const bool symmetric =
false)
const;
539 template <
typename FullMatrixType>
543 const bool symmetric =
false)
const;
554 template <
typename FullMatrixType>
557 const FullMatrixType &matrix,
558 const Number s = Number(0.),
559 const Number b = Number(1.))
const;
565 add(
const Number a)
override;
587 add(
const std::vector<size_type> &indices,
588 const std::vector<Number> & values);
670 size()
const override;
690 print(std::ostream & out,
691 const unsigned int precision = 3,
692 const bool scientific =
true,
693 const bool across =
true)
const override;
736 template <
typename Number>
750 template <
typename Number>
756 DEAL_II_NAMESPACE_CLOSE
759 # include <deal.II/lac/la_parallel_block_vector.templates.h> static ::ExceptionBase & ExcIteratorRangeDoesNotMatchVectorSize()
typename BaseClass::BlockType BlockType
virtual std::size_t memory_consumption() const override
virtual BlockVector< Number > & operator-=(const VectorSpaceVector< Number > &V) override
virtual void compress(::VectorOperation::values operation) override
virtual BlockVector & operator=(const value_type s) override
real_type lp_norm(const real_type p) const
virtual BlockVector< Number > & operator/=(const Number factor) override
virtual real_type l2_norm() const override
virtual Number mean_value() const override
virtual real_type linfty_norm() const override
typename BaseClass::value_type value_type
virtual bool all_zero() const override
void reinit(const size_type num_blocks, const size_type block_size=0, const bool omit_zeroing_entries=false)
void equ(const Number a, const BlockVector< Number > &u, const Number b, const BlockVector< Number > &v)
static ::ExceptionBase & ExcVectorTypeNotCompatible()
virtual Number operator*(const VectorSpaceVector< Number > &V) const override
void swap(LinearAlgebra::distributed::BlockVector< Number > &u, LinearAlgebra::distributed::BlockVector< Number > &v)
real_type norm_sqr() const
#define DeclException0(Exception0)
virtual real_type l1_norm() const override
void swap(BlockVector< Number > &v)
void update_ghost_values() const
Vector< Number > BlockType
void mmult(BlockVector< Number > &V, const FullMatrixType &matrix, const Number s=Number(0.), const Number b=Number(1.)) const
virtual void scale(const VectorSpaceVector< Number > &scaling_factors) override
BlockVector(const size_type num_blocks=0, const size_type block_size=0)
Number multivector_inner_product_with_metric(const FullMatrixType &matrix, const BlockVector< Number > &V, const bool symmetric=false) const
virtual size_type size() const override
void zero_out_ghosts() const
virtual void print(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const override
void add(const std::vector< size_type > &indices, const ::Vector< OtherNumber > &values)
virtual BlockVector< Number > & operator+=(const VectorSpaceVector< Number > &V) override
virtual ::IndexSet locally_owned_elements() const override
typename BlockType::real_type real_type
void multivector_inner_product(FullMatrixType &matrix, const BlockVector< Number > &V, const bool symmetric=false) const
void sadd(const Number s, const BlockVector< Number > &V)
static constexpr unsigned int communication_block_size
virtual BlockVector< Number > & operator*=(const Number factor) override
LinearAlgebra::distributed::BlockVector< Number > BlockVector
virtual ~BlockVector() override=default
virtual Number add_and_dot(const Number a, const VectorSpaceVector< Number > &V, const VectorSpaceVector< Number > &W) override
bool has_ghost_elements() const