]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Increase step number at the start of the loop, since otherwise the
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 14 Nov 2001 13:29:48 +0000 (13:29 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 14 Nov 2001 13:29:48 +0000 (13:29 +0000)
increment would have been forgotten upon break-down.

git-svn-id: https://svn.dealii.org/trunk@5197 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/solver_bicgstab.h

index fbe4991e17c59ec3f528342c4727f38e54cbc893..6211d1b1e3292c04157c6f77f782bd2e7837c709 100644 (file)
@@ -308,6 +308,8 @@ SolverBicgstab<VECTOR>::iterate(const MATRIX& A,
   
   do
     {
+      ++step;
+      
       rhobar = r*rbar;
       beta   = rhobar * alpha / (rho * omega);
       rho    = rhobar;
@@ -322,7 +324,7 @@ SolverBicgstab<VECTOR>::iterate(const MATRIX& A,
 
       if (std::fabs(alpha) > 1.e10)
        return true;
-    
+      
       s.equ(1., r, -alpha, v);
       precondition.vmult(z,s);
       A.vmult(t,z);
@@ -336,7 +338,7 @@ SolverBicgstab<VECTOR>::iterate(const MATRIX& A,
       else
        res = r.l2_norm();
       
-      state = control().check(++step, res);
+      state = control().check(step, res);
       print_vectors(step, *Vx, r, y);
     }
   while (state == SolverControl::iterate);
@@ -371,9 +373,10 @@ SolverBicgstab<VECTOR>::solve(const MATRIX &A,
   
   do 
     {
-      if (step)
+      if (step != 0)
        deallog << "Restart step " << step << std::endl;
-      if (start(A) == SolverControl::success) break;  
+      if (start(A) == SolverControl::success)
+       break;
       state = iterate(A, precondition);
     }
   while (state);

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.