16 #ifndef dealii__mg_matrix_h 17 #define dealii__mg_matrix_h 19 #include <deal.II/lac/vector.h> 20 #include <deal.II/lac/pointer_matrix.h> 21 #include <deal.II/lac/sparse_matrix.h> 22 #include <deal.II/multigrid/mg_base.h> 23 #include <deal.II/base/mg_level_object.h> 24 #include <deal.II/base/std_cxx11/shared_ptr.h> 26 DEAL_II_NAMESPACE_OPEN
41 template <
typename VectorType = Vector<
double> >
55 template <
typename MatrixType>
62 template <
typename MatrixType>
71 virtual void vmult (
const unsigned int level, VectorType &dst,
const VectorType &src)
const;
72 virtual void vmult_add (
const unsigned int level, VectorType &dst,
const VectorType &src)
const;
73 virtual void Tvmult (
const unsigned int level, VectorType &dst,
const VectorType &src)
const;
74 virtual void Tvmult_add (
const unsigned int level, VectorType &dst,
const VectorType &src)
const;
97 template <
typename MatrixType,
typename number>
106 const unsigned int col = 0,
118 void select_block (
const unsigned int row,
119 const unsigned int col);
124 virtual void vmult (
const unsigned int level,
131 virtual void vmult_add (
const unsigned int level,
138 virtual void Tvmult (
const unsigned int level,
145 virtual void Tvmult_add (
const unsigned int level,
171 template <
typename VectorType>
172 template <
typename MatrixType>
180 (new_pointer_matrix_base(p[level], VectorType()));
184 template <
typename VectorType>
185 template <
typename MatrixType>
193 template <
typename VectorType>
199 template <
typename VectorType>
204 return *matrices[level];
208 template <
typename VectorType>
212 const VectorType &src)
const 214 matrices[level]->vmult(dst, src);
218 template <
typename VectorType>
222 const VectorType &src)
const 224 matrices[level]->vmult_add(dst, src);
228 template <
typename VectorType>
232 const VectorType &src)
const 234 matrices[level]->Tvmult(dst, src);
238 template <
typename VectorType>
242 const VectorType &src)
const 244 matrices[level]->Tvmult_add(dst, src);
248 template <
typename VectorType>
253 return sizeof(*this) + matrices->memory_consumption();
260 template <
typename MatrixType,
typename number>
263 const unsigned int col,
266 matrix (p, typeid(*this).name()),
273 template <
typename MatrixType,
typename number>
281 template <
typename MatrixType,
typename number>
285 const unsigned int bcol)
292 template <
typename MatrixType,
typename number>
302 m[level].block(
row,
col).vmult(dst, src);
306 template <
typename MatrixType,
typename number>
316 m[level].block(
row,
col).vmult_add(dst, src);
320 template <
typename MatrixType,
typename number>
330 m[level].block(
row,
col).Tvmult(dst, src);
334 template <
typename MatrixType,
typename number>
344 m[level].block(
row,
col).Tvmult_add(dst, src);
347 DEAL_II_NAMESPACE_CLOSE
unsigned int max_level() const
MGMatrixSelect(const unsigned int row=0, const unsigned int col=0, MGLevelObject< MatrixType > *matrix=0)
virtual void vmult_add(const unsigned int level, Vector< number > &dst, const Vector< number > &src) const
virtual void Tvmult(const unsigned int level, Vector< number > &dst, const Vector< number > &src) const
void select_block(const unsigned int row, const unsigned int col)
void set_matrix(MGLevelObject< MatrixType > *M)
virtual void vmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const
unsigned int min_level() const
SmartPointer< MGLevelObject< MatrixType >, MGMatrixSelect< MatrixType, number > > matrix
#define Assert(cond, exc)
const PointerMatrixBase< VectorType > & operator[](unsigned int level) const
virtual void Tvmult_add(const unsigned int level, VectorType &dst, const VectorType &src) const
void initialize(const MGLevelObject< MatrixType > &M)
virtual void vmult(const unsigned int level, VectorType &dst, const VectorType &src) const
virtual void Tvmult(const unsigned int level, VectorType &dst, const VectorType &src) const
virtual void vmult(const unsigned int level, Vector< number > &dst, const Vector< number > &src) const
virtual void Tvmult_add(const unsigned int level, Vector< number > &dst, const Vector< number > &src) const
std::size_t memory_consumption() const