]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
allow flexible levels
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 28 Sep 2011 05:10:06 +0000 (05:10 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 28 Sep 2011 05:10:06 +0000 (05:10 +0000)
git-svn-id: https://svn.dealii.org/trunk@24455 0785d39b-7218-0410-832d-ea1e28bc413d

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

index a01ae3d75f6507791c623c6892cc70be4c67922e..6bec9ed8f088be69d3f08d5dbba18bd7b1c65ac1 100644 (file)
@@ -257,7 +257,20 @@ class SmootherRelaxation : public MGLevelObject<RELAX>, public MGSmoother<VECTOR
     template <class MATRIX2>
     void initialize (const MGLevelObject<MATRIX2>& matrices,
                     const typename RELAX::AdditionalData & additional_data = typename RELAX::AdditionalData());
-
+    
+                                    /**
+                                     * Initialize matrices and
+                                     * additional data for each
+                                     * level.
+                                     *
+                                     * If minimal or maximal level of
+                                     * the two objects differ, the
+                                     * greatest common range is
+                                     * utilized. This way, smoothing
+                                     * can be restricted to certain
+                                     * levels even if the matrix was
+                                     * generated for all levels.
+                                     */
     template <class MATRIX2, class DATA>
     void initialize (const MGLevelObject<MATRIX2>& matrices,
                     const MGLevelObject<DATA>& additional_data);
@@ -785,13 +798,8 @@ namespace mg
     const MGLevelObject<MATRIX2>& m,
     const MGLevelObject<DATA>& data)
   {
-    const unsigned int min = m.get_minlevel();
-    const unsigned int max = m.get_maxlevel();
-    
-    Assert (data.get_minlevel() == min,
-           ExcDimensionMismatch(data.get_minlevel(), min));
-    Assert (data.get_maxlevel() == max,
-           ExcDimensionMismatch(data.get_maxlevel(), max));
+    const unsigned int min = std::max(m.get_minlevel(), data.get_minlevel());
+    const unsigned int max = std::min(m.get_maxlevel(), data.get_maxlevel());
     
     this->resize(min, max);
     

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.