13#ifndef dealii_matrix_block_h
14#define dealii_matrix_block_h
36template <
typename MatrixType>
42 template <
typename MatrixType>
44 reinit(MatrixBlock<MatrixType> &v,
const BlockSparsityPattern &p);
46 template <
typename number>
48 reinit(MatrixBlock<::SparseMatrix<number>> &v,
49 const BlockSparsityPattern &p);
89template <
typename MatrixType>
135 operator MatrixType &();
136 operator const MatrixType &()
const;
145 const typename MatrixType::value_type
value);
162 template <
typename number>
164 add(
const std::vector<size_type> &indices,
166 const bool elide_zero_values =
true);
182 template <
typename number>
185 const std::vector<size_type> &col_indices,
187 const bool elide_zero_values =
true);
205 template <
typename number>
208 const std::vector<size_type> &col_indices,
209 const std::vector<number> &values,
210 const bool elide_zero_values =
true);
221 template <
typename number>
226 const number *values,
227 const bool elide_zero_values =
true,
228 const bool col_indices_are_sorted =
false);
235 template <
typename VectorType>
237 vmult(VectorType &w,
const VectorType &v)
const;
244 template <
typename VectorType>
253 template <
typename VectorType>
255 Tvmult(VectorType &w,
const VectorType &v)
const;
262 template <
typename VectorType>
279 <<
"Block index " << arg1 <<
" does not match " << arg2);
310 template <
class OTHER_MatrixType>
315 template <
typename number>
330template <
typename MatrixType>
375 clear(
bool really_clean =
false);
417template <
typename MatrixType>
493 clear(
bool really_clean =
false);
593 template <
typename MatrixType>
602 template <
typename number>
614template <
typename MatrixType>
621template <
typename MatrixType>
628template <
typename MatrixType>
636template <
typename MatrixType>
643template <
typename MatrixType>
650template <
typename MatrixType>
654 const typename MatrixType::value_type
value)
659 const std::pair<unsigned int, size_type> bi =
row_indices.global_to_local(gi);
660 const std::pair<unsigned int, size_type> bj =
670template <
typename MatrixType>
671template <
typename number>
674 const std::vector<size_type> &c_indices,
676 const bool elide_zero_values)
693template <
typename MatrixType>
694template <
typename number>
699 const number *values,
706 const std::pair<unsigned int, size_type> bi =
722 const std::pair<unsigned int, size_type> bj =
726 matrix.add(bi.second, bj.second, values[j]);
732template <
typename MatrixType>
733template <
typename number>
737 const bool elide_zero_values)
745 for (
size_type i = 0; i < indices.size(); ++i)
755template <
typename MatrixType>
756template <
typename number>
759 const std::vector<size_type> &col_indices,
760 const std::vector<number> &values,
761 const bool elide_zero_values)
775template <
typename MatrixType>
776template <
typename VectorType>
784template <
typename MatrixType>
785template <
typename VectorType>
793template <
typename MatrixType>
794template <
typename VectorType>
802template <
typename MatrixType>
803template <
typename VectorType>
811template <
typename MatrixType>
821template <
typename MatrixType>
825 const std::string &
name)
832template <
typename MatrixType>
838 block(i).reinit(sparsity);
843template <
typename MatrixType>
860template <
typename MatrixType>
868template <
typename MatrixType>
876template <
typename MatrixType>
887template <
typename MatrixType>
895template <
typename MatrixType>
903template <
typename MatrixType>
907 const std::string &name)
911 p[0].column = column;
927template <
typename MatrixType>
935template <
typename MatrixType>
943template <
typename MatrixType>
951template <
typename MatrixType>
959template <
typename MatrixType>
967template <
typename MatrixType>
975template <
typename MatrixType>
983template <
typename MatrixType>
991template <
typename MatrixType>
999template <
typename MatrixType>
1007template <
typename MatrixType>
1022 o[level].column = col;
1029template <
typename MatrixType>
1055template <
typename MatrixType>
1081template <
typename MatrixType>
1090 o[level].matrix.
clear();
1095template <
typename MatrixType>
const std::string & name(const unsigned int i) const
Name of object at index.
type entry(const std::string &name)
Access to stored data object by name.
void add(type entry, const std::string &name)
Add a new data object.
unsigned int size() const
Number of stored data objects.
type read(const std::string &name) const
Dedicated read only access by name.
AnyData()=default
Default constructor for empty object.
void reinit(const unsigned int n_blocks, const size_type n_elements_per_block)
SparsityPatternType & block(const size_type row, const size_type column)
const BlockIndices & get_column_indices() const
const BlockIndices & get_row_indices() const
void resize(const unsigned int new_minlevel, const unsigned int new_maxlevel, Args &&...args)
unsigned int max_level() const
unsigned int min_level() const
AnyData flux_matrices_up
The DG flux from the lower level to a level.
types::global_dof_index size_type
const value_type & block_down(size_type i) const
void clear_object(AnyData &)
Clear one of the matrix objects.
const value_type & block(size_type i) const
void clear(bool really_clean=false)
void reinit_edge_flux(const MGLevelObject< BlockSparsityPattern > &sparsity)
MGLevelObject< MatrixBlock< MatrixType > > value_type
const bool edge_flux_matrices
Flag for storing flux_matrices_up and flux_matrices_down.
AnyData matrices_out
The matrix from the refinement edge to the interior of a level.
void reinit_matrix(const MGLevelObject< BlockSparsityPattern > &sparsity)
const value_type & block_in(size_type i) const
MGMatrixBlockVector(const bool edge_matrices=false, const bool edge_flux_matrices=false)
const value_type & block_out(size_type i) const
std::size_t memory_consumption() const
AnyData flux_matrices_down
The DG flux from a level to the lower level.
AnyData matrices
The level matrices.
void reinit_edge(const MGLevelObject< BlockSparsityPattern > &sparsity)
AnyData matrices_in
The matrix from the interior of a level to the refinement edge.
const bool edge_matrices
Flag for storing matrices_in and matrices_out.
void add(size_type row, size_type column, const std::string &name)
unsigned int size() const
const value_type & block_up(size_type i) const
const std::string & name(const unsigned int i) const
std::shared_ptr< value_type > ptr_type
MatrixBlock< MatrixType > value_type
void add(size_type row, size_type column, const std::string &name)
unsigned int size() const
Number of stored data objects.
const value_type & block(size_type i) const
void clear(bool really_clean=false)
std::size_t memory_consumption() const
types::global_dof_index size_type
void reinit(const BlockSparsityPattern &sparsity)
MatrixType & matrix(size_type i)
MatrixBlock< MatrixType > & operator=(const MatrixBlock< MatrixType > &)=default
void vmult_add(VectorType &w, const VectorType &v) const
void reinit(const BlockSparsityPattern &sparsity)
BlockIndices column_indices
void add(const size_type i, const size_type j, const typename MatrixType::value_type value)
std::size_t memory_consumption() const
void Tvmult_add(VectorType &w, const VectorType &v) const
void vmult(VectorType &w, const VectorType &v) const
types::global_dof_index size_type
void Tvmult(VectorType &w, const VectorType &v) const
typename MatrixType::value_type value_type
MatrixBlock(const MatrixBlock< MatrixType > &M)=default
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NOT_IMPLEMENTED()
static ::ExceptionBase & ExcBlockIndexMismatch(size_type arg1, size_type arg2)
#define Assert(cond, exc)
#define DeclException2(Exception2, type1, type2, outsequence)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcNotInitialized()
static ::ExceptionBase & ExcNotQuadratic()
const bool IsBlockVector< VectorType >::value
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
unsigned int global_dof_index