]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Check reduced residual for equality as well.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 27 Jul 2001 12:00:26 +0000 (12:00 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 27 Jul 2001 12:00:26 +0000 (12:00 +0000)
git-svn-id: https://svn.dealii.org/trunk@4861 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/solver_control.cc

index 3660cfd05d9e421e693af5105ce817cb159ae1bf..9894feaa8b3dffd58004d53ba1e58def59835829 100644 (file)
@@ -216,13 +216,20 @@ SolverControl::State
 ReductionControl::check (const unsigned int step,
                         const double check_value)
 {
+                                  // if this is the first time we
+                                  // come here, then store the
+                                  // residual for later comparisons
   if (step==0)
     {
       initial_val = check_value;
       reduced_tol = check_value * reduce;
     };
 
-  if (check_value < reduced_tol)
+                                  // check whether desired reduction
+                                  // has been achieved. also check
+                                  // for equality in case initial
+                                  // residual already was zero
+  if (check_value <= reduced_tol)
     {
       if (_log_result)
        deallog << "Convergence step " << step

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.