15#ifndef dealii_block_vector_h
16#define dealii_block_vector_h
36# ifdef DEAL_II_WITH_TRILINOS
69template <
typename Number>
128 template <typename OtherNumber>
131#ifdef DEAL_II_WITH_TRILINOS
160 template <
typename InputIterator>
162 const InputIterator
first,
163 const InputIterator
end);
219 template <
class Number2>
229#ifdef DEAL_II_WITH_TRILINOS
253 const bool omit_zeroing_entries =
false);
272 reinit(
const std::vector<size_type> &block_sizes,
273 const bool omit_zeroing_entries =
false);
286 const bool omit_zeroing_entries =
false);
301 template <
typename Number2>
304 const bool omit_zeroing_entries =
false);
310 template <
class BlockVector2>
333 const unsigned int precision = 3,
334 const bool scientific =
true,
335 const bool across =
true)
const;
378template <
typename Number>
379template <
typename InputIterator>
381 const InputIterator
first,
382 const InputIterator end)
388 reinit(block_sizes,
true);
389 InputIterator start =
first;
390 for (size_type b = 0; b < block_sizes.size(); ++b)
392 InputIterator end = start;
393 std::advance(end,
static_cast<signed int>(block_sizes[b]));
394 std::copy(start, end, this->block(b).begin());
397 Assert(start == end, ExcIteratorRangeDoesNotMatchVectorSize());
402template <
typename Number>
408 BaseClass::operator=(s);
414template <
typename Number>
419 BaseClass::operator=(v);
425template <
typename Number>
429 BaseClass::operator=(v);
435template <
typename Number>
436template <
typename Number2>
441 BaseClass::operator=(v);
445template <
typename Number>
449 for (size_type i = 0; i < this->
n_blocks(); ++i)
450 this->components[i].
compress(operation);
455template <
typename Number>
464template <
typename Number>
465template <
class BlockVector2>
482template <
typename Number>
492 namespace LinearOperatorImplementation
501 template <
typename number>
505 template <
typename Matrix>
509 bool omit_zeroing_entries)
511 v.
reinit(matrix.get_row_indices(), omit_zeroing_entries);
514 template <
typename Matrix>
518 bool omit_zeroing_entries)
520 v.
reinit(matrix.get_column_indices(), omit_zeroing_entries);
531template <
typename Number>
::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
::internal::BlockVectorIterators::Iterator< BlockVectorBase, true > const_iterator
typename BlockType::reference reference
BlockIndices block_indices
typename BlockType::real_type real_type
Vector< Number > BlockType
BlockVector(const std::vector< size_type > &block_sizes)
typename BaseClass::const_reference const_reference
void reinit(const BlockIndices &block_indices, const bool omit_zeroing_entries=false)
typename BaseClass::reference reference
void print(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const
void swap(BlockVector< Number > &u, BlockVector< Number > &v) noexcept
void compress(VectorOperation::values operation=VectorOperation::unknown)
bool has_ghost_elements() const
BlockVector(const TrilinosWrappers::MPI::BlockVector &v)
BlockVector< Number > & operator=(const TrilinosWrappers::MPI::BlockVector &V)
BlockVector< Number > & operator=(const BlockVector< Number2 > &V)
BlockVector(const BlockIndices &block_indices)
BlockVector< Number > & operator=(BlockVector< Number > &&)=default
typename BaseClass::value_type value_type
typename BaseClass::const_pointer const_pointer
BlockVector(const BlockVector< Number > &V)
void block_write(std::ostream &out) const
typename BaseClass::pointer pointer
~BlockVector() override=default
typename BaseClass::BlockType BlockType
BlockVector(const unsigned int n_blocks=0, const size_type block_size=0)
void scale(const BlockVector2 &v)
void swap(BlockVector< Number > &v) noexcept
BlockVector(BlockVector< Number > &&) noexcept=default
void reinit(const std::vector< size_type > &block_sizes, const bool omit_zeroing_entries=false)
typename BaseClass::iterator iterator
void block_read(std::istream &in)
BlockVector & operator=(const value_type s)
typename BaseClass::size_type size_type
BlockVector< Number > & operator=(const Vector< Number > &V)
BlockVector< Number > & operator=(const BlockVector< Number > &v)
BlockVector(const std::vector< size_type > &block_sizes, const InputIterator first, const InputIterator end)
void reinit(const unsigned int n_blocks, const size_type block_size=0, const bool omit_zeroing_entries=false)
typename BaseClass::const_iterator const_iterator
void reinit(const BlockVector< Number2 > &V, const bool omit_zeroing_entries=false)
typename BaseClass::real_type real_type
static void reinit_range_vector(const Matrix &matrix, BlockVector< number > &v, bool omit_zeroing_entries)
static void reinit_domain_vector(const Matrix &matrix, BlockVector< number > &v, bool omit_zeroing_entries)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DeclException0(Exception0)
#define Assert(cond, exc)
#define AssertIsFinite(number)
static ::ExceptionBase & ExcIteratorRangeDoesNotMatchVectorSize()
std::enable_if_t< IsBlockVector< VectorType >::value, unsigned int > n_blocks(const VectorType &vector)
std::string compress(const std::string &input)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)