]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Revert the order of checks for a) max. number of iterations, and b)
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 19 Nov 2001 14:44:55 +0000 (14:44 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 19 Nov 2001 14:44:55 +0000 (14:44 +0000)
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

deal.II/lac/source/solver_control.cc

index a21c2f6cdee4f359d4ef6850d4ce092934f910fb..0ea571cd3c32fc75f60eca9ce704e991206d298c 100644 (file)
@@ -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;
 }

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.