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

tautges at mcs.anl.gov tautges at mcs.anl.gov
Sun Jun 29 21:36:04 CDT 2008


Author: tautges
Date: 2008-06-29 21:36:03 -0500 (Sun, 29 Jun 2008)
New Revision: 1961

Modified:
   MOAB/trunk/tools/mbcoupler/MBCoupler.cpp
Log:
- moved a return statement to get rid of a false positive on locating local point
- testing return value of natural coords function to decide whether the pt was located in the element


Modified: MOAB/trunk/tools/mbcoupler/MBCoupler.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/MBCoupler.cpp	2008-06-30 01:59:45 UTC (rev 1960)
+++ MOAB/trunk/tools/mbcoupler/MBCoupler.cpp	2008-06-30 02:36:03 UTC (rev 1961)
@@ -254,6 +254,10 @@
   MBErrorCode result = nat_param(xyz, entities, nat_coords);
   if (MB_SUCCESS != result) return result;
 
+    // if we didn't find any ents and we're looking locally, nothing more to do
+  if (entities.empty() && !tl) 
+    return result;
+  
     // grow if we know we'll exceed size
   if (mappedPts->n+entities.size() >= mappedPts->max)
     tuple_list_grow(mappedPts);
@@ -425,11 +429,8 @@
       //test to find out in which hex the point is
 		
       // get natural coordinates
-    MBElemUtil::nat_coords_trilinear_hex(&coords_vert[0], MBCartVect(xyz), 
-                                         tmp_nat_coords, 1e-10);
-    if (-1.0 <= tmp_nat_coords[0] && tmp_nat_coords[0] <= 1.0 &&
-        -1.0 <= tmp_nat_coords[1] && tmp_nat_coords[1] <= 1.0 &&
-        -1.0 <= tmp_nat_coords[2] && tmp_nat_coords[2] <= 1.0) {
+    if (MBElemUtil::nat_coords_trilinear_hex(&coords_vert[0], MBCartVect(xyz), 
+                                             tmp_nat_coords, 1e-10)) {
       entities.push_back(*iter);
       nat_coords.push_back(tmp_nat_coords);
       return MB_SUCCESS;




More information about the moab-dev mailing list