]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a comment about iteration 0. 7703/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sat, 9 Feb 2019 17:48:16 +0000 (18:48 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 12 Feb 2019 07:51:15 +0000 (08:51 +0100)
include/deal.II/lac/precondition.h

index 7d21d2cc0c95bbf49538be62f6da72a2afd6e1c8..900c474fc7a60418c9746cf56dce803f326e3332 100644 (file)
@@ -1950,12 +1950,17 @@ namespace internal
       VectorUpdatesRange<Number>(upd, rhs.size());
 
       // swap vectors x^{n+1}->x^{n}, given the updates in the function above
-      if (iteration_index == 1)
+      if (iteration_index == 0)
+        {
+          // nothing to do here because we can immediately write into the
+          // solution vector without remembering any of the other vectors
+        }
+      else if (iteration_index == 1)
         {
           solution.swap(temp_vector1);
           solution_old.swap(temp_vector1);
         }
-      else if (iteration_index > 1)
+      else
         solution.swap(solution_old);
     }
 
@@ -1985,12 +1990,17 @@ namespace internal
       VectorUpdatesRange<Number>(upd, rhs.local_size());
 
       // swap vectors x^{n+1}->x^{n}, given the updates in the function above
-      if (iteration_index == 1)
+      if (iteration_index == 0)
+        {
+          // nothing to do here because we can immediately write into the
+          // solution vector without remembering any of the other vectors
+        }
+      else if (iteration_index == 1)
         {
           solution.swap(temp_vector1);
           solution_old.swap(temp_vector1);
         }
-      else if (iteration_index > 1)
+      else
         solution.swap(solution_old);
     }
 

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.