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

iulian at mcs.anl.gov iulian at mcs.anl.gov
Thu Aug 2 12:07:38 CDT 2012


Author: iulian
Date: 2012-08-02 12:07:38 -0500 (Thu, 02 Aug 2012)
New Revision: 5652

Modified:
   MOAB/trunk/tools/mbcoupler/Coupler.cpp
   MOAB/trunk/tools/mbcoupler/ElemUtil.cpp
   MOAB/trunk/tools/mbcoupler/ElemUtil.hpp
Log:
temporary fix for out-of-natural-space problem noticed by Ryan
if the computed natural parameters are outside the natural space, by more
than given epsilon (default 1.e-10), skip over that element and look for another one.
This epsilon refers to natural, parametric space, while it should be more like an absolute error in
physical space.
natural space for a hex will be [-1-eps, 1+eps]^3, while for a tetra the conditions are:
 inside [-eps, 1+eps] ^3 box, and
  xi1+xi2+xi3 < 1+eps


Modified: MOAB/trunk/tools/mbcoupler/Coupler.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/Coupler.cpp	2012-08-01 17:26:46 UTC (rev 5651)
+++ MOAB/trunk/tools/mbcoupler/Coupler.cpp	2012-08-02 17:07:38 UTC (rev 5652)
@@ -1,7 +1,6 @@
 #include "Coupler.hpp"
 #include "moab/ParallelComm.hpp"
 #include "moab/AdaptiveKDTree.hpp"
-#include "moab/GeomUtil.hpp"
 #include "ElemUtil.hpp"
 #include "moab/CN.hpp"
 #include "iMesh_extensions.h"
@@ -686,6 +685,9 @@
             " is not converging inside hex " << mbImpl->id_from_handle(eh) << "\n";
         continue; // it is possible that the point is outside, so it will not converge
       }
+      // I am not sure this check is necessary, but still do it
+      if (!spcHex->inside_nat_space(tmp_nat_coords, epsilon))
+        continue;
 
     }
     else
@@ -712,6 +714,8 @@
         catch (Element::Map::EvaluationError) {
           continue;
         }
+        if (!hexmap.inside_nat_space(tmp_nat_coords, epsilon))
+          continue;
       }
       else if (etype == MBTET){
         Element::LinearTet tetmap(coords_vert);
@@ -721,6 +725,8 @@
         catch (Element::Map::EvaluationError) {
           continue;
         }
+        if (!tetmap.inside_nat_space(tmp_nat_coords, epsilon))
+          continue;
       }
       else {
         std::cout << "Entity not Hex or Tet" << std::endl;

Modified: MOAB/trunk/tools/mbcoupler/ElemUtil.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/ElemUtil.cpp	2012-08-01 17:26:46 UTC (rev 5651)
+++ MOAB/trunk/tools/mbcoupler/ElemUtil.cpp	2012-08-02 17:07:38 UTC (rev 5652)
@@ -123,8 +123,6 @@
 {
   return LinearHexMap( corner_coords ).solve_inverse( x, xi, tol );
 }
-
-


More information about the moab-dev mailing list