]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-28: fix a bug with the first mesh cycle. 8024/head
authorDavid Wells <drwells@email.unc.edu>
Tue, 7 May 2019 02:18:33 +0000 (22:18 -0400)
committerDavid Wells <drwells@email.unc.edu>
Tue, 7 May 2019 02:37:05 +0000 (22:37 -0400)
Previously the first cycle converged in a single iteration since the
error is calculated to be zero.

examples/step-28/step-28.cc

index e2d277abe0bad58ceb6e49a57c97dd4097031b5a..20ee55437f786d59acbf494eef088baaf05f4d04 100644 (file)
@@ -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)

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.