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

wilsonp at mcs.anl.gov wilsonp at mcs.anl.gov
Thu Feb 21 06:33:01 CST 2008


Author: wilsonp
Date: 2008-02-21 06:33:01 -0600 (Thu, 21 Feb 2008)
New Revision: 1604

Modified:
   MOAB/trunk/tools/dagmc/DagMC.cpp
   MOAB/trunk/tools/dagmc/DagMC.hpp
Log:
Resolved inconsistency from two parallel changes.
1) introduction of two distance tolerances
2) moving parameter input to host application input file

This commit adds support for two distance tolerances to the
methods for setting parameters through the host input file.



Modified: MOAB/trunk/tools/dagmc/DagMC.cpp
===================================================================
--- MOAB/trunk/tools/dagmc/DagMC.cpp	2008-02-21 02:48:22 UTC (rev 1603)
+++ MOAB/trunk/tools/dagmc/DagMC.cpp	2008-02-21 12:33:01 UTC (rev 1604)
@@ -45,8 +45,9 @@
 
 DagMC::DagMC(MBInterface *mb_impl) 
     : mbImpl(mb_impl), obbTree(mb_impl), 
+      discardDistTol(1e-8),
+      addDistTol(1e-6), 
       facetingTolerance(0.001), 
-      addDistTol(1e-6), discardDistTol(1e-8),
       moabMCNPSourceCell(0), moabMCNPUseDistLimit(false)
 {
   options[0] = Option( "source_cell",        "source cell ID, or zero if unknown", "0" );
@@ -232,7 +233,8 @@
 
 }
 void DagMC::set_settings(int source_cell, int use_cad, int use_dist_limit,
-			 double distance_tolerance) {
+			 double add_distance_tolerance, 
+			 double discard_distance_tolerance) {
   moabMCNPSourceCell = source_cell;
   if (moabMCNPSourceCell < 0) {
     std::cerr << "Invalid source_cell = " << moabMCNPSourceCell << std::endl;
@@ -241,14 +243,22 @@
 
   std::cout << "Set Source Cell = " << moabMCNPSourceCell << std::endl;
 
-  distanceTolerance = distance_tolerance;
-  if (distanceTolerance <= 0 || distanceTolerance > 1) {
-    std::cerr << "Invalid distance_tolerance = " << distanceTolerance << std::endl;
+  addDistTol = add_distance_tolerance;
+  if (addDistTol <= 0 || addDistTol > 1) {
+    std::cerr << "Invalid add_distance_tolerance = " << addDistTol << std::endl;
     exit(2);
   }
 
-  std::cout << "Set distance tolerance = " << distanceTolerance << std::endl;
+  std::cout << "Set distance tolerance 1 = " << addDistTol << std::endl;
 
+  discardDistTol = discard_distance_tolerance;
+  if (discardDistTol <= 0 || discardDistTol > 1) {
+    std::cerr << "Invalid add_distance_tolerance = " << discardDistTol << std::endl;
+    exit(2);
+  }
+
+  std::cout << "Set distance tolerance 2 = " << discardDistTol << std::endl;
+
   moabMCNPUseDistLimit = !!(use_dist_limit);
 
   std::cout << "Turned " << (moabMCNPUseDistLimit?"ON":"OFF") << " distance limit." << std::endl;

Modified: MOAB/trunk/tools/dagmc/DagMC.hpp
===================================================================
--- MOAB/trunk/tools/dagmc/DagMC.hpp	2008-02-21 02:48:22 UTC (rev 1603)
+++ MOAB/trunk/tools/dagmc/DagMC.hpp	2008-02-21 12:33:01 UTC (rev 1604)
@@ -97,7 +97,8 @@
   void write_settings( FILE* filp, bool with_description = true );
   void parse_settings();
   void set_settings(int source_cell, int use_cad, int use_dist_limit,
-		    double distance_tolerance);
+		    double add_distance_tolerance,
+		    double discard_distance_tolerance);
 
   char *get_spec_reflect();
   char *get_white_reflect();




More information about the moab-dev mailing list