[MOAB-dev] r4991 - in MOAB/trunk: src tools/dagmc

sjackson at cae.wisc.edu sjackson at cae.wisc.edu
Mon Jun 13 16:36:48 CDT 2011


Author: sjackson
Date: 2011-06-13 16:36:47 -0500 (Mon, 13 Jun 2011)
New Revision: 4991

Modified:
   MOAB/trunk/src/GeomTopoTool.cpp
   MOAB/trunk/tools/dagmc/DagMC.cpp
   MOAB/trunk/tools/dagmc/test_geom.cc
Log:
Fix a bug that prevented DagMC from loading .sat files

Because GeomTopoTool sets a default value for the GEOM_SENSE_2 tag,
DagMC needs to look up the handle for that tag after file loading
is finished to prevent a default value conflict.  All tag handle
lookups done by DagMC are moved after the file loading phase,
which is a somewhat more logical time to perform them anyway.

Modify GeomTopoTool.cpp to return detailed error values instead of
MB_FAILURE in places where such values are already available.

Modified: MOAB/trunk/src/GeomTopoTool.cpp
===================================================================
--- MOAB/trunk/src/GeomTopoTool.cpp	2011-06-13 20:51:27 UTC (rev 4990)
+++ MOAB/trunk/src/GeomTopoTool.cpp	2011-06-13 21:36:47 UTC (rev 4991)
@@ -263,7 +263,9 @@
       trees.clear();
     for (Range::iterator j = tmp_surfs.begin(); j != tmp_surfs.end(); ++j) {
       rval = get_root(*j, root);
-      if (MB_SUCCESS != rval || !root)
+      if (MB_SUCCESS != rval )
+        return rval;
+      if(!root)
         return MB_FAILURE;
       trees.insert(root);
     }
@@ -578,7 +580,7 @@
     EntityHandle sense_data[2] = { 0, 0 };
     rval = mdbImpl->tag_get_data(sense2Tag, &entity, 1, sense_data);
     if (MB_TAG_NOT_FOUND != rval && MB_SUCCESS != rval)
-      return MB_FAILURE;
+      return rval;
 
     if (0 == sense) {
       if (0 != sense_data[0] && wrt_entity != sense_data[0])
@@ -645,7 +647,7 @@
     EntityHandle sense_data[2] = { 0, 0 };
     rval = mdbImpl->tag_get_data(sense2Tag, &entity, 1, sense_data);
     if (MB_TAG_NOT_FOUND != rval && MB_SUCCESS != rval)
-      return MB_FAILURE;
+      return rval;
     if ((wrt_entity == sense_data[0]) && (wrt_entity == sense_data[1]))
       sense = 0;
     else if (wrt_entity == sense_data[0])
@@ -766,7 +768,7 @@
     rval = mdbImpl->tag_get_handle(GEOM_SENSE_2_TAG_NAME, 2,
         MB_TYPE_HANDLE, sense2Tag, flags, def_val);
     if (MB_SUCCESS != rval)
-      return MB_FAILURE;
+      return rval;
   }
   return MB_SUCCESS;
 }
@@ -781,11 +783,11 @@
     rval = mdbImpl->tag_get_handle(GEOM_SENSE_N_ENTS_TAG_NAME,
                                    0, MB_TYPE_HANDLE, senseNEntsTag, flags);
     if (MB_SUCCESS != rval)
-      return MB_FAILURE;
+      return rval;
     rval = mdbImpl->tag_get_handle(GEOM_SENSE_N_SENSES_TAG_NAME,
                                    0, MB_TYPE_INTEGER, senseNSensesTag, flags);
     if (MB_SUCCESS != rval)


More information about the moab-dev mailing list