]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Shortcut in smoother. Fix typo.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 13 Jun 2013 14:20:12 +0000 (14:20 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 13 Jun 2013 14:20:12 +0000 (14:20 +0000)
git-svn-id: https://svn.dealii.org/trunk@29817 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/multigrid/mg_smoother.h
deal.II/source/fe/mapping_q1.cc

index bbfbfcedff69061d66f2a4368984c5c088c71a93..f1c6d05e39c1e5c9bd47a8ce2787c038897a06c1 100644 (file)
@@ -1230,8 +1230,13 @@ MGSmootherPrecondition<MATRIX, PRECONDITIONER, VECTOR>::smooth(
         {
           if (this->debug > 0)
             deallog << 'T';
-          matrices[level].Tvmult(*r,u);
-          r->sadd(-1.,1.,rhs);
+          if (i == 0 && u.all_zero())
+            *r = rhs;
+          else
+            {
+              matrices[level].Tvmult(*r,u);
+              r->sadd(-1.,1.,rhs);
+            }
           if (this->debug > 2)
             deallog << ' ' << r->l2_norm() << ' ';
           smoothers[level].Tvmult(*d, *r);
@@ -1242,8 +1247,13 @@ MGSmootherPrecondition<MATRIX, PRECONDITIONER, VECTOR>::smooth(
         {
           if (this->debug > 0)
             deallog << 'N';
-          matrices[level].vmult(*r,u);
-          r->sadd(-1.,rhs);
+          if (i == 0 && u.all_zero())
+            *r = rhs;
+          else
+            {
+              matrices[level].vmult(*r,u);
+              r->sadd(-1.,rhs);
+            }
           if (this->debug > 2)
             deallog << ' ' << r->l2_norm() << ' ';
           smoothers[level].vmult(*d, *r);
index e141e0a3a673923b21320bc9c46ce08ce636c8cc..f6e575d7a1d750398ef49c92c1969d3b61de002c 100644 (file)
@@ -961,7 +961,7 @@ namespace internal
                   case 1:
                     // in 1d, we don't have access to any of the data.aux
                     // fields (because it has only dim-1 components), but we
-                    // can still compute the boundary form simply by simply
+                    // can still compute the boundary form by simply
                     // looking at the number of the face
                     boundary_forms[i][0] = (face_no == 0 ?
                                             -1 : +1);

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.