]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make sure we back out of the steepest decent if the gradient is
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 1 Aug 2009 02:18:37 +0000 (02:18 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 1 Aug 2009 02:18:37 +0000 (02:18 +0000)
zero. This happens, for example, in bits/distorted_cells_06 without
this hunk.

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

deal.II/deal.II/source/grid/grid_tools.cc

index b328ca0fd2475d002e73fe33d90ec0151d116956..97e7977728a1ce5c8e35bc68c741d371396af375 100644 (file)
@@ -1541,6 +1541,18 @@ namespace internal
                       step_length);
              }
 
+                                            // sometimes, the
+                                            // (unprojected) gradient
+                                            // is perpendicular to
+                                            // the manifold, but we
+                                            // can't go there if
+                                            // respect_manifold==true. in
+                                            // that case, gradient=0,
+                                            // and we simply need to
+                                            // quite the loop here
+           if (gradient.norm() == 0)
+             break;
+           
                                             // so we need to go in
                                             // direction -gradient. the
                                             // optimal value of the

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.