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

wilsonp at engr.wisc.edu wilsonp at engr.wisc.edu
Wed May 26 15:37:48 CDT 2010


Author: wilsonp
Date: 2010-05-26 15:37:47 -0500 (Wed, 26 May 2010)
New Revision: 3965

Modified:
   MOAB/trunk/tools/dagmc/DagMC.cpp
   MOAB/trunk/tools/dagmc/DagMC.hpp
Log:
Use faceting tolerance as the tolerance to determine whether a boundary case
should be tested during point membership.  If the current point is within
faceting tolerance of a boundary, assume that it is a boundary case.

Need to ensure that faceting tolerance is known in more circumstances.  When
reading a CGM geometry a faceting tolerance can be provided and passed to the
load_file routine as an option.  This will tag the resultant MOAB mesh with 
the faceting tolerance.  We now read the faceting tolerance from the mesh and
use that as the assumed value.

Now also allow the calling application to query the faceting tolerance along
with other settings.




Modified: MOAB/trunk/tools/dagmc/DagMC.cpp
===================================================================
--- MOAB/trunk/tools/dagmc/DagMC.cpp	2010-05-26 20:04:27 UTC (rev 3964)
+++ MOAB/trunk/tools/dagmc/DagMC.cpp	2010-05-26 20:37:47 UTC (rev 3965)
@@ -388,7 +388,7 @@
 }
 
 void DagMC::get_settings(int *source_cell, int *use_cad, int *use_dist_limit,
-			 double *discard_distance_tolerance) {
+			 double *discard_distance_tolerance, double *facet_tol) {
 
   *source_cell = sourceCell;
 
@@ -398,6 +398,8 @@
 
   *use_cad = !!(useCAD);
 
+  *facet_tol = facetingTolerance;
+
 }
 
 
@@ -589,6 +591,7 @@
 {
   ErrorCode rval;
   const double epsilon = discardDistTol;
+  const double boundary_epsilon = facetingTolerance;
 
     // Get OBB Tree for volume
   assert(volume - setOffset < rootSets.size());
@@ -603,7 +606,7 @@
   
     // Check for on-boundary case
   diff = closest - point;
-  if (diff%diff <= epsilon*epsilon) {
+  if (diff%diff <= boundary_epsilon*boundary_epsilon) {
     return boundary_case( volume, result, u, v, w, facet, surface );
   }
   
@@ -910,7 +913,7 @@
 }
 
 ErrorCode DagMC::load_file(const char* cfile,
-			     const double facet_tolerance)
+			   const double facet_tolerance)
 {
   ErrorCode rval;
   
@@ -931,7 +934,12 @@
   char options[120] = "CGM_ATTRIBS=yes;FACET_DISTANCE_TOLERANCE=";
   strcat(options,facetTolStr);


More information about the moab-dev mailing list