[MOAB-dev] r5691 - MOAB/trunk/src/moab/point_locater

rhl6856 at mcs.anl.gov rhl6856 at mcs.anl.gov
Mon Aug 13 11:49:48 CDT 2012


Author: rhl6856
Date: 2012-08-13 11:49:48 -0500 (Mon, 13 Aug 2012)
New Revision: 5691

Modified:
   MOAB/trunk/src/moab/point_locater/bvh_tree.hpp
Log:
a bit more liberal use of tolerance in find alg. also added improved heuristic for choosing branch

Modified: MOAB/trunk/src/moab/point_locater/bvh_tree.hpp
===================================================================
--- MOAB/trunk/src/moab/point_locater/bvh_tree.hpp	2012-08-10 16:03:29 UTC (rev 5690)
+++ MOAB/trunk/src/moab/point_locater/bvh_tree.hpp	2012-08-13 16:49:48 UTC (rev 5691)
@@ -666,7 +666,9 @@
 		}
 		return 0;
 	}
-	if( node.Lmax < node.Rmin){
+        //the extra tol here considers the case where
+        //0 < Rmin - Lmax < 2tol
+	if( (node.Lmax+tol) < (node.Rmin-tol)){
 		if( point[ node.dim] <= (node.Lmax + tol)){            	
         		return _find_point( point, node.child, tol);
         	}else if( point[ node.dim] >= (node.Rmin - tol)){            	
@@ -691,9 +693,11 @@
 	 * sought point. This results in less overall traversal, and the correct
 	 * cell is identified more quickly.
 	 */
-	const Entity_handle result =  _find_point( point, node.child, tol);
+	bool dir = (point[ node.dim] - node.Rmin) <= 
+					(node.Lmax - point[ node.dim]);
+	const Entity_handle result =  _find_point( point, node.child+dir, tol);
 	if( result == 0 ){ 
-		return _find_point( point, node.child+1, tol);
+		return _find_point( point, node.child+(1-dir), tol);
 	}
 	return result;
 }



More information about the moab-dev mailing list