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

wilsonp at engr.wisc.edu wilsonp at engr.wisc.edu
Mon May 24 12:46:09 CDT 2010


Author: wilsonp
Date: 2010-05-24 12:46:09 -0500 (Mon, 24 May 2010)
New Revision: 3945

Modified:
   MOAB/trunk/tools/dagmc/DagMC.cpp
   MOAB/trunk/tools/dagmc/DagMC.hpp
Log:
Updated handling of default tolerances.
* calling application can now query DAGMC for defaults
* changed default [add|discard]_distance_tolerance from 0.001 to
   - add_distance_tolerance = 1e-6
   - discard_distance_tolerance = 1e-8

Now report name of tolerance to terminal.  Instead of reporting
"distance tolerance 1" and "distance tolerance 2", we now report
"add distance tolerane" and "discard distance tolerance".  We had
wanted to insulate users from this, but it may be important as
we deal with user problems.




Modified: MOAB/trunk/tools/dagmc/DagMC.cpp
===================================================================
--- MOAB/trunk/tools/dagmc/DagMC.cpp	2010-05-24 17:15:28 UTC (rev 3944)
+++ MOAB/trunk/tools/dagmc/DagMC.cpp	2010-05-24 17:46:09 UTC (rev 3945)
@@ -95,11 +95,11 @@
 {
     // This is the correct place to uniquely define default values for the dagmc settings
   options[0] = Option( "source_cell",        "source cell ID, or zero if unknown", "0" );
-  options[1] = Option( "discard_distance_tolerance", "positive real value", "0.001" );
+  options[1] = Option( "discard_distance_tolerance", "positive real value", "1e-8" );
   options[2] = Option( "use_distance_limit", "one to enable distance limit optimization, zero otherwise", "0" );
   options[3] = Option( "use_cad", "one to ray-trace to cad, zero for just facets", "0" );
   options[4] = Option( "faceting_tolerance", "graphics faceting tolerance", "0.001" );
-  options[5] = Option( "add_distance_tolerance", "positive real value", "0.001" );
+  options[5] = Option( "add_distance_tolerance", "positive real value", "1e-6" );
 
     // call parse settings to initialize default values for settings from options
   parse_settings();
@@ -366,15 +366,15 @@
     exit(2);
   }
 
-  std::cout << "Set distance tolerance 1 = " << addDistTol << std::endl;
+  std::cout << "Set add distance tolerance = " << addDistTol << std::endl;
 
   discardDistTol = discard_distance_tolerance;
   if (discardDistTol <= 0 || discardDistTol > 1) {
-    std::cerr << "Invalid add_distance_tolerance = " << discardDistTol << std::endl;
+    std::cerr << "Invalid discard_distance_tolerance = " << discardDistTol << std::endl;
     exit(2);
   }
 
-  std::cout << "Set distance tolerance 2 = " << discardDistTol << std::endl;
+  std::cout << "Set discard distance tolerance = " << discardDistTol << std::endl;
 
   useDistLimit = !!(use_dist_limit);
 
@@ -387,8 +387,21 @@
 
 }
 
+void DagMC::get_settings(int *source_cell, int *use_cad, int *use_dist_limit,
+			 double *discard_distance_tolerance) {
 
+  *source_cell = sourceCell;
 
+  *discard_distance_tolerance = discardDistTol;
+
+  *use_dist_limit = !!(useDistLimit);
+
+  *use_cad = !!(useCAD);


More information about the moab-dev mailing list