From 75eec859751d6275780b23015c6943087acbc5ed Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Sat, 9 Feb 2019 18:48:16 +0100 Subject: [PATCH] Add a comment about iteration 0. --- include/deal.II/lac/precondition.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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); } -- 2.39.5