From: David Wells Date: Sat, 25 Jun 2016 21:31:35 +0000 (-0400) Subject: Fix a sign error in step-25. X-Git-Tag: v8.5.0-rc1~952^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fccd87dce8ba75ed5226a2a9d69bf81ba1c8544;p=dealii.git Fix a sign error in step-25. Credit for this fix belongs to Anup Basak, who mentioned it on the mailing list in March 2016. Even with the sign error the Newton solver converged to the right solution: changing the sign only altered the solution in the fifth decimal place. The fixed version now only requires three, instead of four, Newton steps in 2D. --- diff --git a/examples/step-25/step-25.cc b/examples/step-25/step-25.cc index 9ce719834d..5ee224cf58 100644 --- a/examples/step-25/step-25.cc +++ b/examples/step-25/step-25.cc @@ -353,7 +353,7 @@ namespace Step25 SparseMatrix tmp_matrix (sparsity_pattern); compute_nl_matrix (old_solution, solution, tmp_matrix); - system_matrix.add (-std::pow(time_step*theta,2), tmp_matrix); + system_matrix.add (std::pow(time_step*theta,2), tmp_matrix); // Then, we compute the right-hand side vector $-F_h(U^{n,l})$. //