#ifndef dealii__mg_matrix_h
#define dealii__mg_matrix_h
-#include <deal.II/lac/vector.h>
-#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/base/mg_level_object.h>
+#include <deal.II/lac/linear_operator.h>
#include <deal.II/lac/sparse_matrix.h>
+#include <deal.II/lac/vector.h>
#include <deal.II/multigrid/mg_base.h>
-#include <deal.II/base/mg_level_object.h>
#include <memory>
{
/**
* Multilevel matrix. This matrix stores an MGLevelObject of
- * PointerMatrixBase objects. It implements the interface defined in
- * MGMatrixBase, so that it can be used as a matrix in Multigrid.
+ * LinearOpetors. It implements the interface defined in MGMatrixBase, so
+ * that it can be used as a matrix in Multigrid.
*
* @author Guido Kanschat
* @date 2002, 2010
/**
* Access matrix on a level.
*/
- const PointerMatrixBase<VectorType> &operator[] (unsigned int level) const;
+ const LinearOperator<VectorType> &operator[] (unsigned int level) const;
virtual void vmult (const unsigned int level, VectorType &dst, const VectorType &src) const;
virtual void vmult_add (const unsigned int level, VectorType &dst, const VectorType &src) const;
*/
std::size_t memory_consumption () const;
private:
- MGLevelObject<std::shared_ptr<PointerMatrixBase<VectorType> > > matrices;
+ MGLevelObject<LinearOperator<VectorType> > matrices;
};
}
{
matrices.resize(p.min_level(), p.max_level());
for (unsigned int level=p.min_level(); level <= p.max_level(); ++level)
- matrices[level] = std::shared_ptr<PointerMatrixBase<VectorType> >
- (new_pointer_matrix_base(p[level], VectorType()));
+ matrices[level] = linear_operator<VectorType>(p[level]);
}
template <typename VectorType>
inline
- const PointerMatrixBase<VectorType> &
+ const LinearOperator<VectorType> &
Matrix<VectorType>::operator[] (unsigned int level) const
{
- return *matrices[level];
+ return matrices[level];
}
VectorType &dst,
const VectorType &src) const
{
- matrices[level]->vmult(dst, src);
+ matrices[level].vmult(dst, src);
}
VectorType &dst,
const VectorType &src) const
{
- matrices[level]->vmult_add(dst, src);
+ matrices[level].vmult_add(dst, src);
}
VectorType &dst,
const VectorType &src) const
{
- matrices[level]->Tvmult(dst, src);
+ matrices[level].Tvmult(dst, src);
}
VectorType &dst,
const VectorType &src) const
{
- matrices[level]->Tvmult_add(dst, src);
+ matrices[level].Tvmult_add(dst, src);
}