16 #ifndef dealii_mg_matrix_h 17 #define dealii_mg_matrix_h 19 #include <deal.II/base/mg_level_object.h> 20 #include <deal.II/lac/linear_operator.h> 21 #include <deal.II/lac/sparse_matrix.h> 22 #include <deal.II/lac/vector.h> 23 #include <deal.II/multigrid/mg_base.h> 27 DEAL_II_NAMESPACE_OPEN
42 template <
typename VectorType = Vector<
double> >
56 template <
typename MatrixType>
63 template <
typename MatrixType>
77 virtual void vmult (
const unsigned int level, VectorType &dst,
const VectorType &src)
const;
78 virtual void vmult_add (
const unsigned int level, VectorType &dst,
const VectorType &src)
const;
79 virtual void Tvmult (
const unsigned int level, VectorType &dst,
const VectorType &src)
const;
80 virtual void Tvmult_add (
const unsigned int level, VectorType &dst,
const VectorType &src)
const;
105 template <
typename MatrixType,
typename number>
114 const unsigned int col = 0,
127 const unsigned int col);
132 virtual void vmult (
const unsigned int level,
139 virtual void vmult_add (
const unsigned int level,
146 virtual void Tvmult (
const unsigned int level,
153 virtual void Tvmult_add (
const unsigned int level,
179 template <
typename VectorType>
180 template <
typename MatrixType>
198 template <
typename VectorType>
203 matrices.resize(0,0);
208 template <
typename VectorType>
209 template <
typename MatrixType>
218 template <
typename VectorType>
223 return matrices[level];
228 template <
typename VectorType>
232 const VectorType &src)
const 234 matrices[level].vmult(dst, src);
239 template <
typename VectorType>
243 const VectorType &src)
const 245 matrices[level].vmult_add(dst, src);
250 template <
typename VectorType>
254 const VectorType &src)
const 256 matrices[level].Tvmult(dst, src);
261 template <
typename VectorType>
265 const VectorType &src)
const 267 matrices[level].Tvmult_add(dst, src);
272 template <
typename VectorType>
276 return matrices.min_level();
281 template <
typename VectorType>
285 return matrices.max_level();
290 template <
typename VectorType>
295 return sizeof(*this) + matrices->memory_consumption();
302 template <
typename MatrixType,
typename number>
305 const unsigned int col,
308 matrix (p, typeid(*this).name()),
315 template <
typename MatrixType,
typename number>
324 template <
typename MatrixType,
typename number>
328 const unsigned int bcol)
336 template <
typename MatrixType,
typename number>
346 m[level].block(row, col).vmult(dst, src);
351 template <
typename MatrixType,
typename number>
361 m[level].block(row, col).vmult_add(dst, src);
366 template <
typename MatrixType,
typename number>
376 m[level].block(row, col).Tvmult(dst, src);
381 template <
typename MatrixType,
typename number>
391 m[level].block(row, col).Tvmult_add(dst, src);
394 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
const LinearOperator< VectorType > & operator[](unsigned int level) const
SmartPointer< MGLevelObject< MatrixType >, MGMatrixSelect< MatrixType, number > > matrix
#define Assert(cond, exc)
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