From: David Wells Date: Tue, 7 May 2019 02:18:33 +0000 (-0400) Subject: step-28: fix a bug with the first mesh cycle. X-Git-Tag: v9.1.0-rc1~118^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8024%2Fhead;p=dealii.git step-28: fix a bug with the first mesh cycle. Previously the first cycle converged in a single iteration since the error is calculated to be zero. --- diff --git a/examples/step-28/step-28.cc b/examples/step-28/step-28.cc index e2d277abe0..20ee55437f 100644 --- a/examples/step-28/step-28.cc +++ b/examples/step-28/step-28.cc @@ -1570,7 +1570,9 @@ namespace Step28 boost::io::ios_flags_saver restore_flags(std::cout); std::cout << std::setprecision(12) << std::fixed; - double k_eff_old = k_eff; + // We calculate the error below by the change in k_eff (i.e., the + // difference between k_eff_old, + double k_eff_old = 0.0; for (unsigned int cycle = 0; cycle < parameters.n_refinement_cycles; ++cycle)