15#ifndef dealii_block_sparse_matrix_h
16#define dealii_block_sparse_matrix_h
48template <
typename number>
219 template <
typename block_number>
228 template <
typename block_number,
typename nonblock_number>
237 template <
typename block_number,
typename nonblock_number>
246 template <
typename nonblock_number>
255 template <
typename block_number>
264 template <
typename block_number,
typename nonblock_number>
273 template <
typename block_number,
typename nonblock_number>
282 template <
typename nonblock_number>
299 template <
typename BlockVectorType>
302 const BlockVectorType &src,
303 const number omega = 1.)
const;
310 template <
typename number2>
314 const number omega = 1.)
const;
345 const unsigned int precision = 3,
346 const bool scientific =
true,
347 const unsigned int width = 0,
348 const char *zero_string =
" ",
349 const double denominator = 1.,
350 const char *separator =
" ")
const;
380template <
typename number>
386 for (
size_type r = 0; r < this->n_block_rows(); ++r)
387 for (
size_type c = 0; c < this->n_block_cols(); ++c)
388 this->block(r, c) = d;
395template <
typename number>
396template <
typename block_number>
401 BaseClass::vmult_block_block(dst, src);
406template <
typename number>
407template <
typename block_number,
typename nonblock_number>
412 BaseClass::vmult_block_nonblock(dst, src);
417template <
typename number>
418template <
typename block_number,
typename nonblock_number>
423 BaseClass::vmult_nonblock_block(dst, src);
428template <
typename number>
429template <
typename nonblock_number>
434 BaseClass::vmult_nonblock_nonblock(dst, src);
439template <
typename number>
440template <
typename block_number>
445 BaseClass::Tvmult_block_block(dst, src);
450template <
typename number>
451template <
typename block_number,
typename nonblock_number>
456 BaseClass::Tvmult_block_nonblock(dst, src);
461template <
typename number>
462template <
typename block_number,
typename nonblock_number>
467 BaseClass::Tvmult_nonblock_block(dst, src);
472template <
typename number>
473template <
typename nonblock_number>
478 BaseClass::Tvmult_nonblock_nonblock(dst, src);
483template <
typename number>
484template <
typename BlockVectorType>
487 const BlockVectorType &src,
488 const number omega)
const
491 Assert(dst.n_blocks() == this->n_block_rows(),
493 Assert(src.n_blocks() == this->n_block_cols(),
498 for (
size_type i = 0; i < this->n_block_rows(); ++i)
499 this->block(i, i).precondition_Jacobi(dst.block(i), src.block(i), omega);
504template <
typename number>
505template <
typename number2>
509 const number omega)
const
514 Assert(this->n_block_cols() == 1,
515 ExcMessage(
"This function only works if the matrix has "
517 Assert(this->n_block_rows() == 1,
518 ExcMessage(
"This function only works if the matrix has "
523 this->block(0, 0).precondition_Jacobi(dst, src, omega);
SparseMatrix< number > BlockType
const value_type & const_reference
types::global_dof_index size_type
typename BlockType::value_type value_type
MatrixIterator< BlockMatrixIterators::Accessor< BlockMatrixBase, true > > const_iterator
const value_type * const_pointer
MatrixIterator< BlockMatrixIterators::Accessor< BlockMatrixBase, false > > iterator
BlockSparseMatrix(const BlockSparsityPattern &sparsity)
typename BaseClass::value_type value_type
typename BaseClass::iterator iterator
typename BaseClass::const_pointer const_pointer
BlockSparseMatrix()=default
virtual void reinit(const BlockSparsityPattern &sparsity)
size_type n_nonzero_elements() const
void precondition_Jacobi(Vector< number2 > &dst, const Vector< number2 > &src, const number omega=1.) const
std::size_t memory_consumption() const
void vmult(BlockVector< block_number > &dst, const Vector< nonblock_number > &src) const
void Tvmult(Vector< nonblock_number > &dst, const Vector< nonblock_number > &src) const
virtual ~BlockSparseMatrix() override
typename BaseClass::pointer pointer
BlockSparseMatrix & operator=(const BlockSparseMatrix &)
void print_formatted(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const unsigned int width=0, const char *zero_string=" ", const double denominator=1., const char *separator=" ") const
typename BaseClass::const_reference const_reference
size_type n_actually_nonzero_elements(const double threshold=0.0) const
void Tvmult(Vector< nonblock_number > &dst, const BlockVector< block_number > &src) const
typename BaseClass::size_type size_type
void vmult(Vector< nonblock_number > &dst, const BlockVector< block_number > &src) const
void vmult(Vector< nonblock_number > &dst, const Vector< nonblock_number > &src) const
SmartPointer< const BlockSparsityPattern, BlockSparseMatrix< number > > sparsity_pattern
typename BaseClass::const_iterator const_iterator
void Tvmult(BlockVector< block_number > &dst, const BlockVector< block_number > &src) const
void Tvmult(BlockVector< block_number > &dst, const Vector< nonblock_number > &src) const
void vmult(BlockVector< block_number > &dst, const BlockVector< block_number > &src) const
typename BaseClass::BlockType BlockType
typename BaseClass::reference reference
size_type get_row_length(const size_type row) const
void precondition_Jacobi(BlockVectorType &dst, const BlockVectorType &src, const number omega=1.) const
BlockSparseMatrix & operator=(const double d)
const BlockSparsityPattern & get_sparsity_pattern() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DeclException0(Exception0)
static ::ExceptionBase & ExcScalarAssignmentOnlyForZeroValue()
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcBlockDimensionMismatch()
static ::ExceptionBase & ExcNotQuadratic()
static ::ExceptionBase & ExcMessage(std::string arg1)