]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add mg::Matrix::reset() and MGCoarseGridApplySmoother::clear() 4444/head
authorDenis Davydov <davydden@gmail.com>
Tue, 30 May 2017 09:42:09 +0000 (11:42 +0200)
committerDenis Davydov <davydden@gmail.com>
Tue, 30 May 2017 09:57:05 +0000 (11:57 +0200)
include/deal.II/multigrid/mg_coarse.h
include/deal.II/multigrid/mg_matrix.h

index b14c4c74c16e53634b70495e0633a6cbff47cd3f..0fc198aac069bf7dd0973c7e2a0268668107d497 100644 (file)
@@ -47,6 +47,11 @@ public:
    */
   MGCoarseGridApplySmoother (const MGSmootherBase<VectorType> &coarse_smooth);
 
+  /**
+   * Clear the pointer.
+   */
+  void clear ();
+
   /**
    * Initialize new data.
    */
@@ -329,6 +334,15 @@ MGCoarseGridApplySmoother<VectorType>::initialize (const MGSmootherBase<VectorTy
     (&coarse_smooth_,typeid(*this).name());
 }
 
+
+template<class VectorType>
+void
+MGCoarseGridApplySmoother<VectorType>::clear()
+{
+  coarse_smooth = nullptr;
+}
+
+
 template<class VectorType>
 void
 MGCoarseGridApplySmoother<VectorType>::operator() (const unsigned int level,
index ec6c7b7eac1e1e4580ce81026710acdb2eaabcfb..a717e34e883bb8af8a7f80057d1801330e218f4f 100644 (file)
@@ -64,6 +64,11 @@ namespace mg
     void
     initialize(const MGLevelObject<MatrixType> &M);
 
+    /**
+     * Reset the object.
+     */
+    void reset();
+
     /**
      * Access matrix on a level.
      */
@@ -185,6 +190,16 @@ namespace mg
 
 
 
+  template <typename VectorType>
+  inline
+  void
+  Matrix<VectorType>::reset ()
+  {
+    matrices.resize(0,0);
+  }
+
+
+
   template <typename VectorType>
   template <typename MatrixType>
   inline

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.