]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
make MGLevelObject<RELAX> a base class of mg::SmootherRelaxation
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 May 2011 03:06:21 +0000 (03:06 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 May 2011 03:06:21 +0000 (03:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@23736 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/multigrid/mg_smoother.h

index 623e6594c0cd60caefce641154dfad7122305e1b..98e4317fa7065e08b3954daeed21dfa9cdc75d47 100644 (file)
@@ -230,7 +230,7 @@ namespace mg
  * @date 2003, 2009, 2010
  */
 template<class RELAX, class VECTOR>
-class SmootherRelaxation : public MGSmoother<VECTOR>
+class SmootherRelaxation : public MGLevelObject<RELAX>, public MGSmoother<VECTOR>
 {
   public:
                                     /**
@@ -280,11 +280,6 @@ class SmootherRelaxation : public MGSmoother<VECTOR>
 //     void initialize (const MGLevelObject<MatrixBlock<MATRIX2> >& matrices,
 //                  const typename RELAX::AdditionalData & additional_data = typename RELAX::AdditionalData());
 
-                                    /**
-                                     * Empty all vectors.
-                                     */
-    void clear ();
-
                                     /**
                                      * The actual smoothing method.
                                      */
@@ -296,13 +291,6 @@ class SmootherRelaxation : public MGSmoother<VECTOR>
                                      * Memory used by this object.
                                      */
     std::size_t memory_consumption () const;
-
-  private:
-                                    /**
-                                     * Object containing relaxation
-                                     * methods.
-                                     */
-    MGLevelObject<RELAX> smoothers;
 };
 }
 
@@ -761,14 +749,6 @@ namespace mg
   {}
   
   
-  template <class RELAX, class VECTOR>
-  inline void
-  SmootherRelaxation<RELAX, VECTOR>::clear ()
-  {
-    smoothers.clear();
-  }
-  
-  
   template <class RELAX, class VECTOR>
   template <class MATRIX2>
   inline void
@@ -779,10 +759,10 @@ namespace mg
     const unsigned int min = m.get_minlevel();
     const unsigned int max = m.get_maxlevel();
     
-    smoothers.resize(min, max);
+    this->resize(min, max);
     
     for (unsigned int i=min;i<=max;++i)
-      smoothers[i].initialize(m[i], data);
+      (*this)[i].initialize(m[i], data);
   }
 
   
@@ -801,10 +781,10 @@ namespace mg
     Assert (data.get_maxlevel() == max,
            ExcDimensionMismatch(data.get_maxlevel(), max));
     
-    smoothers.resize(min, max);
+    this->resize(min, max);
     
     for (unsigned int i=min;i<=max;++i)
-      smoothers[i].initialize(m[i], data[i]);
+      (*this)[i].initialize(m[i], data[i]);
   }
 
   
@@ -815,7 +795,7 @@ namespace mg
     VECTOR& u,
     const VECTOR& rhs) const
   {
-    unsigned int maxlevel = smoothers.get_maxlevel();
+    unsigned int maxlevel = this->get_maxlevel();
     unsigned int steps2 = this->steps;
 
     if (this->variable)
@@ -830,9 +810,9 @@ namespace mg
     for (unsigned int i=0; i<steps2; ++i)
       {
        if (T)
-         smoothers[level].Tstep(u, rhs);
+         (*this)[level].Tstep(u, rhs);
        else
-         smoothers[level].step(u, rhs);
+         (*this)[level].step(u, rhs);
        if (this->symmetric)
          T = !T;
       }
@@ -846,7 +826,8 @@ namespace mg
   memory_consumption () const
   {
     return sizeof(*this)
-      + smoothers.memory_consumption()
+      -sizeof(MGLevelObject<RELAX>)
+      + MGLevelObject<RELAX>::memory_consumption()
       + this->mem->memory_consumption();
   }
 }

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.