From: Matthias Maier Date: Thu, 13 Jul 2017 17:57:47 +0000 (-0500) Subject: Cleanup: Use LinearOperator instead of PointerMatrix X-Git-Tag: v9.0.0-rc1~1423^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f230dda3b01e5949956c7ad4dda5e3121e4b812a;p=dealii.git Cleanup: Use LinearOperator instead of PointerMatrix --- diff --git a/include/deal.II/multigrid/mg_matrix.h b/include/deal.II/multigrid/mg_matrix.h index a717e34e88..3d01770e18 100644 --- a/include/deal.II/multigrid/mg_matrix.h +++ b/include/deal.II/multigrid/mg_matrix.h @@ -16,11 +16,11 @@ #ifndef dealii__mg_matrix_h #define dealii__mg_matrix_h -#include -#include +#include +#include #include +#include #include -#include #include @@ -33,8 +33,8 @@ namespace mg { /** * 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 @@ -72,7 +72,7 @@ namespace mg /** * Access matrix on a level. */ - const PointerMatrixBase &operator[] (unsigned int level) const; + const LinearOperator &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; @@ -86,7 +86,7 @@ namespace mg */ std::size_t memory_consumption () const; private: - MGLevelObject > > matrices; + MGLevelObject > matrices; }; } @@ -184,8 +184,7 @@ namespace mg { 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 > - (new_pointer_matrix_base(p[level], VectorType())); + matrices[level] = linear_operator(p[level]); } @@ -212,10 +211,10 @@ namespace mg template inline - const PointerMatrixBase & + const LinearOperator & Matrix::operator[] (unsigned int level) const { - return *matrices[level]; + return matrices[level]; } @@ -226,7 +225,7 @@ namespace mg VectorType &dst, const VectorType &src) const { - matrices[level]->vmult(dst, src); + matrices[level].vmult(dst, src); } @@ -237,7 +236,7 @@ namespace mg VectorType &dst, const VectorType &src) const { - matrices[level]->vmult_add(dst, src); + matrices[level].vmult_add(dst, src); } @@ -248,7 +247,7 @@ namespace mg VectorType &dst, const VectorType &src) const { - matrices[level]->Tvmult(dst, src); + matrices[level].Tvmult(dst, src); } @@ -259,7 +258,7 @@ namespace mg VectorType &dst, const VectorType &src) const { - matrices[level]->Tvmult_add(dst, src); + matrices[level].Tvmult_add(dst, src); }