]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Cleanup: Use LinearOperator instead of PointerMatrix
authorMatthias Maier <tamiko@43-1.org>
Thu, 13 Jul 2017 17:57:53 +0000 (12:57 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 13 Jul 2017 19:43:04 +0000 (14:43 -0500)
include/deal.II/multigrid/mg_smoother.h

index fbb7bd685d79f44ee96c3414360ecb3cfa4709db..8ff6c6609ab1a78952798c8051e466742d97631d 100644 (file)
 
 
 #include <deal.II/base/config.h>
+#include <deal.II/base/mg_level_object.h>
 #include <deal.II/base/smartpointer.h>
-#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/lac/linear_operator.h>
 #include <deal.II/lac/vector_memory.h>
 #include <deal.II/multigrid/mg_base.h>
-#include <deal.II/base/mg_level_object.h>
 #include <vector>
 
 DEAL_II_NAMESPACE_OPEN
@@ -395,7 +395,7 @@ private:
   /**
    * Pointer to the matrices.
    */
-  MGLevelObject<PointerMatrix<MatrixType, VectorType> > matrices;
+  MGLevelObject<LinearOperator<VectorType> > matrices;
 
 };
 
@@ -547,7 +547,7 @@ private:
   /**
    * Pointer to the matrices.
    */
-  MGLevelObject<PointerMatrix<MatrixType, VectorType> > matrices;
+  MGLevelObject<LinearOperator<VectorType> > matrices;
 
 };
 
@@ -786,7 +786,7 @@ MGSmootherRelaxation<MatrixType, RelaxationType, VectorType>::clear ()
   unsigned int i=matrices.min_level(),
                max_level=matrices.max_level();
   for (; i<=max_level; ++i)
-    matrices[i]=nullptr;
+    matrices[i] = LinearOperator<VectorType>();
 }
 
 
@@ -805,7 +805,7 @@ MGSmootherRelaxation<MatrixType, RelaxationType, VectorType>::initialize
 
   for (unsigned int i=min; i<=max; ++i)
     {
-      matrices[i] = &m[i];
+      matrices[i] = linear_operator<VectorType>(m[i]);
       smoothers[i].initialize(m[i], data);
     }
 }
@@ -830,7 +830,7 @@ MGSmootherRelaxation<MatrixType, RelaxationType, VectorType>::initialize
 
   for (unsigned int i=min; i<=max; ++i)
     {
-      matrices[i] = &m[i];
+      matrices[i] = linear_operator<VectorType>(m[i]);
       smoothers[i].initialize(m[i], data[i]);
     }
 }
@@ -989,7 +989,7 @@ MGSmootherPrecondition<MatrixType, PreconditionerType, VectorType>::clear ()
   unsigned int i=matrices.min_level(),
                max_level=matrices.max_level();
   for (; i<=max_level; ++i)
-    matrices[i]=nullptr;
+    matrices[i]=LinearOperator<VectorType>();
 }
 
 
@@ -1009,7 +1009,7 @@ MGSmootherPrecondition<MatrixType, PreconditionerType, VectorType>::initialize
 
   for (unsigned int i=min; i<=max; ++i)
     {
-      matrices[i] = &m[i];
+      matrices[i] = linear_operator<VectorType>(m[i]);
       smoothers[i].initialize(m[i], data);
     }
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.