[MOAB-dev] r4333 - in MOAB/trunk/src: . moab

bmsmith6 at wisc.edu bmsmith6 at wisc.edu
Tue Dec 7 11:21:27 CST 2010


Author: bmsmith
Date: 2010-12-07 11:21:27 -0600 (Tue, 07 Dec 2010)
New Revision: 4333

Modified:
   MOAB/trunk/src/OrientedBoxTreeTool.cpp
   MOAB/trunk/src/moab/OrientedBoxTreeTool.hpp
Log:
Changes to ray_intersect_sets:
-Add ability to search behind the origin for intersections. This is useful
for particle tracking through overlaps.
-Add ability to avoid returning facets, specified in a vector. This is
useful for avoiding facets that have previously been intersected.
-Use the plucker_ray_tri_intersect test to prevent particles from leaking
between topologically adjacent facets. It consistently identifies edge
and node intersections.
-If an edge/node intersection is found, check to make sure that it
actually pierces the boundary of the volume.
-Add a new mode to add_intersections that is optimized for DagMC. It
returns 1 intersection in the forward direction with correct orientation.
If it exists, it will return 1 intersection in the reverse direction with
correct orientation and within a distance limit.

-These options are triggered by passing pointers. The existing behavior
should be unchanged.


Modified: MOAB/trunk/src/OrientedBoxTreeTool.cpp
===================================================================
--- MOAB/trunk/src/OrientedBoxTreeTool.cpp	2010-12-07 16:44:44 UTC (rev 4332)
+++ MOAB/trunk/src/OrientedBoxTreeTool.cpp	2010-12-07 17:21:27 UTC (rev 4333)
@@ -25,6 +25,7 @@
 #include "moab/Range.hpp"
 #include "moab/CN.hpp"
 #include "moab/GeomUtil.hpp"
+#include "moab/GeomTopoTool.hpp"
 #include "MBTagConventions.hpp"
 #include <iostream>
 #include <iomanip>
@@ -38,6 +39,137 @@
 
 namespace moab {
 
+/**\brief Determine if a ray-edge/node intersection is glancing or piercing.
+ *        This function avoids asking for upward adjacencies to prevent their
+ *        creation.
+ *\param tri           The intersected triangle
+ *\param ray_direction The direction of the ray
+ *\param int_type      The type of intersection (EDGE0, EDGE1, NODE2, ...)
+ *\param close_tris    Vector of triangles in the neighborhood of the intersection
+ *\param close_senses  Vector of surface senses for tris in the neighborhood of
+ *                     the intersection 
+ *\return              True if piercing, false otherwise.
+ */
+bool edge_node_intersect(const EntityHandle                tri,
+                         const CartVect&                   ray_direction,
+                         const GeomUtil::intersection_type int_type,
+                         const std::vector<EntityHandle>&  close_tris,
+                         const std::vector<int>&           close_senses,
+                         const Interface*                  MBI ) {
+
+  // get the node of the triangle
+  const EntityHandle* conn;
+  int len;
+  ErrorCode rval = MBI->get_connectivity( tri, conn, len );
+  if(MB_SUCCESS!=rval || 3!=len) return MB_FAILURE;
+
+  // get adjacent tris (and keep their corresponding senses)
+  std::vector<EntityHandle> adj_tris;
+  std::vector<int>          adj_senses;
+
+  // node intersection
+  if(GeomUtil::NODE0==int_type || GeomUtil::NODE1==int_type || GeomUtil::NODE2==int_type) {
+ 
+    // get the intersected node
+    EntityHandle node;
+    if     (GeomUtil::NODE0==int_type) node = conn[0];
+    else if(GeomUtil::NODE1==int_type) node = conn[1];


More information about the moab-dev mailing list