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

wilsonp at mcs.anl.gov wilsonp at mcs.anl.gov
Thu Oct 25 15:49:11 CDT 2007


Author: wilsonp
Date: 2007-10-25 15:49:11 -0500 (Thu, 25 Oct 2007)
New Revision: 1343

Modified:
   MOAB/trunk/tools/dagmc/DagMC.cpp
   MOAB/trunk/tools/dagmc/DagMC.hpp
Log:

Added tests in surface_sense() to handle implicit complement handle as a special case.



Modified: MOAB/trunk/tools/dagmc/DagMC.cpp
===================================================================
--- MOAB/trunk/tools/dagmc/DagMC.cpp	2007-10-25 18:48:16 UTC (rev 1342)
+++ MOAB/trunk/tools/dagmc/DagMC.cpp	2007-10-25 20:49:11 UTC (rev 1343)
@@ -198,7 +198,7 @@
               << "need an ACIS-based install of CGM." << std::endl;
   }
 #endif  
-    
+
   facetingTolerance = strtod( options[4].value.c_str(), 0 );
   if (facetingTolerance <= 0) {
     std::cerr << "Invalid faceting_tolerance = " << facetingTolerance << std::endl;
@@ -713,6 +713,13 @@
                            const MBEntityHandle* surfaces,
                            int* senses_out )
 {
+
+  /* The sense tags do not reference the implicit complement handle.
+     All surfaces that interact with the implicit complement should have
+     a null handle in the direction of the implicit complement. */
+  if (volume == impl_compl_handle)
+    volume = (MBEntityHandle) 0;
+
   std::vector<MBEntityHandle> surf_volumes( 2*num_surfaces );
   MBErrorCode rval = moab_instance()->tag_get_data( sense_tag(), surfaces, num_surfaces, &surf_volumes[0] );
   if (MB_SUCCESS != rval)  return rval;
@@ -741,6 +748,12 @@
                                   MBEntityHandle surface,
                                   int& sense_out )
 {
+  /* The sense tags do not reference the implicit complement handle.
+     All surfaces that interact with the implicit complement should have
+     a null handle in the direction of the implicit complement. */
+  if (volume == impl_compl_handle)
+    volume = (MBEntityHandle) 0;
+
     // get sense of surfaces wrt volumes
   MBEntityHandle surf_volumes[2];
   MBErrorCode rval = moab_instance()->tag_get_data( sense_tag(), &surface, 1, surf_volumes );
@@ -1417,7 +1430,7 @@
                                   bool is_geom) 
 {
   MBErrorCode rval = MB_SUCCESS;
-  
+
     // surf/vol offsets are just first handles
   setOffset = (*surfs.begin() < *vols.begin() ? *surfs.begin() : *vols.begin());
   setOffset = (impl_compl_handle < setOffset ? impl_compl_handle : setOffset);
@@ -1461,7 +1474,7 @@
   moab_instance()->tag_set_data(idTag, &impl_compl_handle, 1, &max_id);
   
 
-
+ 
 #ifdef CGM
   if (is_geom) {
     geomEntities.resize(rootSets.size());
@@ -1716,6 +1729,3 @@
   
   
 }                                                    
-
-  
-

Modified: MOAB/trunk/tools/dagmc/DagMC.hpp
===================================================================
--- MOAB/trunk/tools/dagmc/DagMC.hpp	2007-10-25 18:48:16 UTC (rev 1342)
+++ MOAB/trunk/tools/dagmc/DagMC.hpp	2007-10-25 20:49:11 UTC (rev 1343)
@@ -126,8 +126,8 @@
 
   MBErrorCode get_angle(MBEntityHandle surf, 
                         double xxx, double yyy, double zzz, double *ang);
-  
 
+
     // get the corners of the OBB for a given volume
   MBErrorCode getobb(MBEntityHandle volume, double minPt[3], double maxPt[3]);
 




More information about the moab-dev mailing list