[MOAB-dev] r5954 - in MOAB/trunk: src src/moab test/parallel tools/mbcslam

iulian at mcs.anl.gov iulian at mcs.anl.gov
Wed Jan 23 22:58:21 CST 2013


Author: iulian
Date: 2013-01-23 22:58:21 -0600 (Wed, 23 Jan 2013)
New Revision: 5954

Modified:
   MOAB/trunk/src/GeomUtil.cpp
   MOAB/trunk/src/moab/GeomUtil.hpp
   MOAB/trunk/test/parallel/par_intx_sph.cpp
   MOAB/trunk/tools/mbcslam/Intx2Mesh.cpp
   MOAB/trunk/tools/mbcslam/Intx2Mesh.hpp
   MOAB/trunk/tools/mbcslam/Intx2MeshInPlane.cpp
   MOAB/trunk/tools/mbcslam/Intx2MeshInPlane.hpp
   MOAB/trunk/tools/mbcslam/Intx2MeshOnSphere.cpp
   MOAB/trunk/tools/mbcslam/Intx2MeshOnSphere.hpp
Log:
implement the second intersecion algorithm, element based.
it is simpler than the locate points algorithms, it involves only 2 collective calls
before intersection is performed on each proc.
introduce some utilities for box overlapping, in GeomUtil
a contiguous departure mesh is sent to processors;
global id of "arrival" (euler) mesh is used to identify the mesh 


Modified: MOAB/trunk/src/GeomUtil.cpp
===================================================================
--- MOAB/trunk/src/GeomUtil.cpp	2013-01-23 00:46:39 UTC (rev 5953)
+++ MOAB/trunk/src/GeomUtil.cpp	2013-01-24 04:58:21 UTC (rev 5954)
@@ -1379,7 +1379,54 @@
   return closest % closest < tolerance * tolerance;
 }
 
+bool boxes_overlap( const CartVect & box_min1, const CartVect & box_max1,
+    const CartVect & box_min2, const CartVect & box_max2, double tolerance)
+{
 
+  for (int k=0; k<3; k++)
+  {
+    double b1min=box_min1[k], b1max=box_max1[k];
+    double b2min=box_min2[k], b2max=box_max2[k];
+    if ( b1min - tolerance > b2max)
+      return false;
+    if (b2min - tolerance > b1max )
+      return false;
+  }
+  return true;
+}
+
+// see if boxes formed by 2 lists of "CartVect"s overlap
+bool bounding_boxes_overlap (const CartVect * list1, int num1, const CartVect * list2, int num2,
+      double tolerance)
+{
+  assert(num1>=1 && num2>=1);
+  CartVect box_min1=list1[0], box_max1=list1[0];
+  CartVect box_min2=list2[0], box_max2=list2[0];
+  for (int i=1; i<num1; i++)
+  {
+    for (int k=0; k<3; k++)
+    {
+      double val=list1[i][k];
+      if (box_min1[k] > val)
+        box_min1[k] = val;
+      if (box_max1[k] < val)
+        box_max1[k]=val;
+    }
+  }
+  for (int i=1; i<num2; i++)
+  {
+    for (int k=0; k<3; k++)
+    {
+      double val=list2[i][k];
+      if (box_min2[k] > val)
+        box_min2[k] = val;
+      if (box_max2[k] < val)
+        box_max2[k]=val;


More information about the moab-dev mailing list