From: Timo Heister Date: Wed, 11 Feb 2015 17:15:41 +0000 (-0500) Subject: Merge pull request #515 from bangerth/terminate-loop-and-error-message X-Git-Tag: v8.3.0-rc1~483 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bb584cdebb7a7a78bd1435aecf4b30eeed0c62a;p=dealii.git Merge pull request #515 from bangerth/terminate-loop-and-error-message Terminate a loop in a timely manner. In StraightBoundary::normal_vector(), we currently have a loop that could run forever. This is not useful. Rather, terminate it after at most 10 iterations and if it fails output some guidance to what the reason may be. --- 2bb584cdebb7a7a78bd1435aecf4b30eeed0c62a diff --cc source/grid/tria_boundary.cc index e296a5f215,61c0ea8f5e..e32916554f --- a/source/grid/tria_boundary.cc +++ b/source/grid/tria_boundary.cc @@@ -628,8 -629,16 +629,16 @@@ normal_vector (const typename Triangula for (unsigned int k=0; k delta_xi = -invert(H) * J; + const Tensor<1,facedim> delta_xi = -invert(H) * J; xi += delta_xi; + ++iteration; + + Assert (iteration<10, + ExcMessage("The Newton iteration to find the reference point " + "did not converge in 10 iterations. Do you have a " + "deformed cell? (See the glossary for a definition " + "of what a deformed cell is. You may want to output " + "the vertices of your cell.")); if (delta_xi.norm() < eps) break;