[MOAB-dev] r4356 - MOAB/trunk/tools/mbcoupler

acaceres at mcs.anl.gov acaceres at mcs.anl.gov
Mon Dec 13 13:03:33 CST 2010


Author: acaceres
Date: 2010-12-13 13:03:33 -0600 (Mon, 13 Dec 2010)
New Revision: 4356

Modified:
   MOAB/trunk/tools/mbcoupler/ElemUtil.cpp
Log:
Infinite-loop bug fix: break out of newton loop after 50 iterations


Modified: MOAB/trunk/tools/mbcoupler/ElemUtil.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/ElemUtil.cpp	2010-12-13 17:10:05 UTC (rev 4355)
+++ MOAB/trunk/tools/mbcoupler/ElemUtil.cpp	2010-12-13 19:03:33 UTC (rev 4356)
@@ -444,7 +444,12 @@
     CartVect xi = x0;
     CartVect delta = evaluate(xi) - x;
     Matrix3 J;
+
+    int iters=0;
     while (delta % delta > error_tol_sqr) {
+      if(++iters>50)
+        throw Map::EvaluationError();
+
       J = jacobian(xi);
       det = J.determinant();
       if (det < std::numeric_limits<double>::epsilon())




































More information about the moab-dev mailing list