]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Check for starting vector being a solution already.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 25 Apr 1999 22:14:27 +0000 (22:14 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 25 Apr 1999 22:14:27 +0000 (22:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@1203 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/solver_gmres.h

index 450b7ad2e5985ba95d3c56a428523abdbe3f8b3b..5db3b45de1e61ef4aadf8c076d798ab49804c496 100644 (file)
@@ -225,6 +225,19 @@ SolverGMRES<Matrix,Vector>::solve (const Matrix& A,
        };
  
       double rho = v.l2_norm();
+
+                                      // check the residual here as
+                                      // well since it may be that
+                                      // we got the exact (or an almost
+                                      // exact) solution vector at
+                                      // the outset. if we wouldn't
+                                      // check here, the next scaling
+                                      // operation would produce
+                                      // garbage
+      iteration_state = control().check (accumulated_iterations, rho);
+      if (iteration_state != SolverControl::iterate)
+       break;
+      
       gamma(0) = rho;
       
       v.scale (1./rho);

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.