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.
for (unsigned int k=0; k<spacedim; ++k)
H[i][j] += grad_F[i][k] * grad_F[j][k];
- const Point<facedim> 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;
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