From: Wolfgang Bangerth Date: Mon, 19 Nov 2001 14:44:55 +0000 (+0000) Subject: Revert the order of checks for a) max. number of iterations, and b) X-Git-Tag: v8.0.0~18617 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb0e34abc69b92aa94440f118f05967e74e6647f;p=dealii.git Revert the order of checks for a) max. number of iterations, and b) target residual. The reason is that it happens that we converge on the very last allowed iteration, most often if the system has only 5 or so equations, and we converge in the fifth iteration. git-svn-id: https://svn.dealii.org/trunk@5212 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/solver_control.cc b/deal.II/lac/source/solver_control.cc index a21c2f6cde..0ea571cd3c 100644 --- a/deal.II/lac/source/solver_control.cc +++ b/deal.II/lac/source/solver_control.cc @@ -110,6 +110,14 @@ SolverControl::check (const unsigned int step, deallog << "Starting value " << check_value << std::endl; } + if (check_value <= tol) + { + if (m_log_result) + deallog << "Convergence step " << step + << " value " << check_value << std::endl; + lcheck = success; + return success; + } if ((step >= maxsteps) || #ifdef HAVE_ISNAN @@ -131,14 +139,6 @@ SolverControl::check (const unsigned int step, return failure; } - if (check_value <= tol) - { - if (m_log_result) - deallog << "Convergence step " << step - << " value " << check_value << std::endl; - lcheck = success; - return success; - } lcheck = iterate; return iterate; }