16 #ifndef dealii_matrix_block_h 17 #define dealii_matrix_block_h 39 template <
typename MatrixType>
45 template <
typename MatrixType>
49 template <
typename number>
111 template <
typename MatrixType>
157 operator MatrixType &();
158 operator const MatrixType &()
const;
167 const typename MatrixType::value_type
value);
184 template <
typename number>
186 add(
const std::vector<size_type> &indices,
188 const bool elide_zero_values =
true);
204 template <
typename number>
206 add(
const std::vector<size_type> &row_indices,
207 const std::vector<size_type> &col_indices,
209 const bool elide_zero_values =
true);
227 template <
typename number>
230 const std::vector<size_type> &col_indices,
231 const std::vector<number> & values,
232 const bool elide_zero_values =
true);
243 template <
typename number>
248 const number * values,
249 const bool elide_zero_values =
true,
250 const bool col_indices_are_sorted =
false);
257 template <
class VectorType>
266 template <
class VectorType>
275 template <
class VectorType>
284 template <
class VectorType>
301 <<
"Block index " << arg1 <<
" does not match " << arg2);
332 template <
class OTHER_MatrixType>
337 template <
typename number>
353 template <
typename MatrixType>
398 clear(
bool really_clean =
false);
443 template <
typename MatrixType>
466 const bool edge_flux_matrices =
false);
519 clear(
bool really_clean =
false);
619 template <
typename MatrixType>
628 template <
typename number>
640 template <
typename MatrixType>
647 template <
typename MatrixType>
654 template <
typename MatrixType>
662 template <
typename MatrixType>
669 template <
typename MatrixType>
676 template <
typename MatrixType>
680 const typename MatrixType::value_type
value)
686 const std::pair<unsigned int, size_type> bj =
692 matrix.add(bi.second, bj.second, value);
696 template <
typename MatrixType>
697 template <
typename number>
700 const std::vector<size_type> &c_indices,
702 const bool elide_zero_values)
719 template <
typename MatrixType>
720 template <
typename number>
725 const number * values,
732 const std::pair<unsigned int, size_type> bi =
748 const std::pair<unsigned int, size_type> bj =
752 matrix.add(bi.second, bj.second, values[j]);
758 template <
typename MatrixType>
759 template <
typename number>
763 const bool elide_zero_values)
771 for (
size_type i = 0; i < indices.size(); ++i)
781 template <
typename MatrixType>
782 template <
typename number>
785 const std::vector<size_type> &col_indices,
786 const std::vector<number> & values,
787 const bool elide_zero_values)
801 template <
typename MatrixType>
802 template <
class VectorType>
810 template <
typename MatrixType>
811 template <
class VectorType>
819 template <
typename MatrixType>
820 template <
class VectorType>
828 template <
typename MatrixType>
829 template <
class VectorType>
837 template <
typename MatrixType>
847 template <
typename MatrixType>
851 const std::string &name)
858 template <
typename MatrixType>
862 for (
size_type i = 0; i < this->size(); ++i)
864 block(i).reinit(sparsity);
869 template <
typename MatrixType>
879 for (
size_type i = 0; i < this->size(); ++i)
886 template <
typename MatrixType>
890 return *this->read<ptr_type>(i);
894 template <
typename MatrixType>
898 return *this->entry<ptr_type>(i);
902 template <
typename MatrixType>
906 return this->entry<ptr_type>(i)->
matrix;
913 template <
typename MatrixType>
917 , edge_flux_matrices(f)
921 template <
typename MatrixType>
929 template <
typename MatrixType>
933 const std::string &name)
937 p[0].column = column;
953 template <
typename MatrixType>
961 template <
typename MatrixType>
969 template <
typename MatrixType>
977 template <
typename MatrixType>
985 template <
typename MatrixType>
993 template <
typename MatrixType>
1001 template <
typename MatrixType>
1009 template <
typename MatrixType>
1017 template <
typename MatrixType>
1025 template <
typename MatrixType>
1033 template <
typename MatrixType>
1048 o[
level].column = col;
1055 template <
typename MatrixType>
1081 template <
typename MatrixType>
1107 template <
typename MatrixType>
1121 template <
typename MatrixType>
void reinit_matrix(const MGLevelObject< BlockSparsityPattern > &sparsity)
unsigned int max_level() const
const types::global_dof_index invalid_size_type
const bool edge_matrices
Flag for storing matrices_in and matrices_out.
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
type entry(const std::string &name)
Access to stored data object by name.
AnyData matrices
The level matrices.
#define DeclException2(Exception2, type1, type2, outsequence)
#define AssertDimension(dim1, dim2)
Contents is actually a matrix.
AnyData matrices_out
The matrix from the refinement edge to the interior of a level.
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
const type read(const std::string &name) const
Dedicated read only access by name.
MatrixType & matrix(size_type i)
const value_type & block(size_type i) const
void Tvmult(VectorType &w, const VectorType &v) const
void vmult(VectorType &w, const VectorType &v) const
const value_type & block(size_type i) const
void unsubscribe(std::atomic< bool > *const validity, const std::string &identifier="") const
AnyData matrices_in
The matrix from the interior of a level to the refinement edge.
static ::ExceptionBase & ExcNotInitialized()
void add(const size_type i, const size_type j, const typename MatrixType::value_type value)
unsigned int min_level() const
SparsityPatternType & block(const size_type row, const size_type column)
const bool edge_flux_matrices
Flag for storing flux_matrices_up and flux_matrices_down.
void clear(bool really_clean=false)
const value_type & block_out(size_type i) const
void add(size_type row, size_type column, const std::string &name)
void reinit_edge(const MGLevelObject< BlockSparsityPattern > &sparsity)
MGMatrixBlockVector(const bool edge_matrices=false, const bool edge_flux_matrices=false)
void subscribe(std::atomic< bool > *const validity, const std::string &identifier="") const
#define Assert(cond, exc)
AnyData flux_matrices_down
The DG flux from a level to the lower level.
void reinit(const unsigned int n_blocks, const size_type n_elements_per_block)
void reinit(MatrixBlock<::SparseMatrix< number >> &v, const BlockSparsityPattern &p)
const BlockIndices & get_row_indices() const
#define DEAL_II_NAMESPACE_CLOSE
std::size_t memory_consumption() const
BlockIndices column_indices
const value_type & block_in(size_type i) const
void vmult_add(VectorType &w, const VectorType &v) const
std::shared_ptr< value_type > ptr_type
typename FullMatrix< number > ::value_type value_type
static ::ExceptionBase & ExcNotQuadratic()
Tensor< 2, dim, Number > w(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
unsigned int global_dof_index
void add(size_type row, size_type column, const std::string &name)
static ::ExceptionBase & ExcBlockIndexMismatch(size_type arg1, size_type arg2)
void clear(bool really_clean=false)
unsigned int size() const
void reinit_edge_flux(const MGLevelObject< BlockSparsityPattern > &sparsity)
void reinit(const BlockSparsityPattern &sparsity)
const value_type & block_up(size_type i) const
void add(type entry, const std::string &name)
Add a new data object.
unsigned int size() const
Number of stored data objects.
#define DEAL_II_NAMESPACE_OPEN
void reinit(const BlockSparsityPattern &sparsity)
AnyData flux_matrices_up
The DG flux from the lower level to a level.
const value_type & block_down(size_type i) const
static ::ExceptionBase & ExcNotImplemented()
void resize(const unsigned int new_minlevel, const unsigned int new_maxlevel)
void clear_object(AnyData &)
Clear one of the matrix objects.
unsigned int size() const
std::pair< unsigned int, size_type > global_to_local(const size_type i) const
const BlockIndices & get_column_indices() const
void Tvmult_add(VectorType &w, const VectorType &v) const
const std::string & name(const unsigned int i) const
Name of object at index.
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)