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;
99 template <
typename MatrixType,
typename number>
108 const unsigned int col = 0,
121 const unsigned int col);
126 virtual void vmult (
const unsigned int level,
133 virtual void vmult_add (
const unsigned int level,
140 virtual void Tvmult (
const unsigned int level,
147 virtual void Tvmult_add (
const unsigned int level,
173 template <
typename VectorType>
174 template <
typename MatrixType>
182 (new_pointer_matrix_base(p[level], VectorType()));
187 template <
typename VectorType>
188 template <
typename MatrixType>
197 template <
typename VectorType>
204 template <
typename VectorType>
209 return *matrices[level];
214 template <
typename VectorType>
218 const VectorType &src)
const 220 matrices[level]->vmult(dst, src);
225 template <
typename VectorType>
229 const VectorType &src)
const 231 matrices[level]->vmult_add(dst, src);
236 template <
typename VectorType>
240 const VectorType &src)
const 242 matrices[level]->Tvmult(dst, src);
247 template <
typename VectorType>
251 const VectorType &src)
const 253 matrices[level]->Tvmult_add(dst, src);
258 template <
typename VectorType>
262 return matrices.min_level();
267 template <
typename VectorType>
271 return matrices.max_level();
276 template <
typename VectorType>
281 return sizeof(*this) + matrices->memory_consumption();
288 template <
typename MatrixType,
typename number>
291 const unsigned int col,
294 matrix (p, typeid(*this).name()),
301 template <
typename MatrixType,
typename number>
310 template <
typename MatrixType,
typename number>
314 const unsigned int bcol)
322 template <
typename MatrixType,
typename number>
332 m[level].block(row, col).vmult(dst, src);
337 template <
typename MatrixType,
typename number>
347 m[level].block(row, col).vmult_add(dst, src);
352 template <
typename MatrixType,
typename number>
362 m[level].block(row, col).Tvmult(dst, src);
367 template <
typename MatrixType,
typename number>
377 m[level].block(row, col).Tvmult_add(dst, src);
380 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 unsigned int get_maxlevel() const
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
static ::ExceptionBase & ExcNotInitialized()
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 unsigned int get_minlevel() 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