[MOAB-dev] r5021 - MOAB/trunk/tools/dagmc

sjackson at cae.wisc.edu sjackson at cae.wisc.edu
Fri Jun 17 12:37:48 CDT 2011


Author: sjackson
Date: 2011-06-17 12:37:44 -0500 (Fri, 17 Jun 2011)
New Revision: 5021

Modified:
   MOAB/trunk/tools/dagmc/DagMC.cpp
   MOAB/trunk/tools/dagmc/DagMC.hpp
   MOAB/trunk/tools/dagmc/pt_vol_test.cc
   MOAB/trunk/tools/dagmc/test_geom.cc
Log:
* Change DagMC's point-in-volume test functions to take arrays for
  coordinate data
* Update documentation and tests for these functions

Modified: MOAB/trunk/tools/dagmc/DagMC.cpp
===================================================================
--- MOAB/trunk/tools/dagmc/DagMC.cpp	2011-06-16 22:05:52 UTC (rev 5020)
+++ MOAB/trunk/tools/dagmc/DagMC.cpp	2011-06-17 17:37:44 UTC (rev 5021)
@@ -688,8 +688,7 @@
     // "on_boundary" result of the PMT. This avoids a test that uses proximity 
     // (a tolerance).
     int result;
-    rval = point_in_volume( next_vol, point[0], point[1], point[2], result, dir[0], dir[1], dir[2],
-                            history ? &(history->prev_facets) : NULL );
+    rval = point_in_volume( next_vol, point, result, dir, history );
     if(MB_SUCCESS != rval) return rval;
     if(1==result) exit_idx = 0;
 
@@ -736,10 +735,10 @@
 }
 
 ErrorCode DagMC::point_in_volume(const EntityHandle volume, 
-                                 const double x, const double y, const double z,
+                                 const double xyz[3],
                                  int& result,
-				 double u, double v, double w,
-				 std::vector<EntityHandle>* prev_facets) {
+                                 const double *uvw,
+                                 const RayHistory *history) {
   // take some stats that are independent of nps
   if(counting) ++n_pt_in_vol_calls;
 
@@ -758,8 +757,15 @@
   facets.clear();
   dirs.clear();
 
-  // if uvw is not given, use random
-  if( -1>u || 1<u || -1>v || 1<v || -1>w || 1<w || (0==u && 0==v && 0==w) ) {
+  // if uvw is not given or is full of zeros, use a random direction
+  double u = 0, v = 0, w = 0;
+
+  if( uvw ){
+    u = uvw[0]; v=uvw[1], w=uvw[2];
+  }
+
+  if( u == 0 && v == 0 && w == 0 )
+  { 
     u = rand();
     v = rand();
     w = rand();
@@ -769,7 +775,6 @@
     w /= magnitude;
   }
 
-  const double ray_origin[]    = { x, y, z };


More information about the moab-dev mailing list