]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
treat lucky breakdown in GMRES and FGMRES
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 9 Oct 2012 22:08:00 +0000 (22:08 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 9 Oct 2012 22:08:00 +0000 (22:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@27040 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/include/deal.II/lac/solver_gmres.h

index 414c76aae946840d642d4de5f1e8dde6be1e77a0..34da06468cecc215b4e74d0a784f6efe67ae65a0 100644 (file)
@@ -87,6 +87,10 @@ DoFHandler, in particular removal of specializations.
 <h3>Specific improvements</h3>
 
 <ol>
+<li> Fixed: handle lucky breakdowns in GMRES/FGMRES.
+<br>
+(Bärbel Jansse, Timo Heister, 2012/10/09)
+
 <li> Fixed: GridTools::find_cells_adjacent_to_vertex got into
 trouble with anisotropically refined meshes. This is now fixed.
 <br>
index 2ca953ca831d701365b3a0226aedb645c4ae9a60..0d6c63aa62ef69c984397117a550f8b6195fc712 100644 (file)
@@ -706,8 +706,9 @@ SolverGMRES<VECTOR>::solve (const MATRIX         &A,
 
           const double s = vv.l2_norm();
           h(inner_iteration+1) = s;
-          //s=0 is a lucky breakdown. Handle this somehow decently
-          if(s!=0)
+          //s=0 is a lucky breakdown, the solver will reach convergence,
+         //but we must not divide by zero here.
+          if (numbers::is_finite(1./s))
             vv *= 1./s;
 
                                            /*  Transformation into
@@ -907,7 +908,11 @@ SolverFGMRES<VECTOR>::solve (
 
       for (unsigned int j=0;j<basis_size;++j)
         {
-          v(j,x).equ(1./a, *aux);
+         if (numbers::is_finite(1./a)) // treat lucky breakdown
+           v(j,x).equ(1./a, *aux);
+         else
+           v(j,x) = 0.;
+         
 
           precondition.vmult(z(j,x), v[j]);
           A.vmult(*aux, z[j]);

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.