From: Martin Kronbichler Date: Sat, 9 Feb 2019 17:48:16 +0000 (+0100) Subject: Add a comment about iteration 0. X-Git-Tag: v9.1.0-rc1~338^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75eec859751d6275780b23015c6943087acbc5ed;p=dealii.git Add a comment about iteration 0. --- diff --git a/include/deal.II/lac/precondition.h b/include/deal.II/lac/precondition.h index 7d21d2cc0c..900c474fc7 100644 --- a/include/deal.II/lac/precondition.h +++ b/include/deal.II/lac/precondition.h @@ -1950,12 +1950,17 @@ namespace internal VectorUpdatesRange(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(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); }