[MOAB-dev] r4843 - in MOAB/trunk: src src/moab test

iulian at mcs.anl.gov iulian at mcs.anl.gov
Wed May 18 14:07:20 CDT 2011


Author: iulian
Date: 2011-05-18 14:07:20 -0500 (Wed, 18 May 2011)
New Revision: 4843

Modified:
   MOAB/trunk/src/GeomTopoTool.cpp
   MOAB/trunk/src/moab/GeomTopoTool.hpp
   MOAB/trunk/test/gttool_test.cpp
Log:
use the senses of old model for duplicated model
correct edge sets


Modified: MOAB/trunk/src/GeomTopoTool.cpp
===================================================================
--- MOAB/trunk/src/GeomTopoTool.cpp	2011-05-18 18:19:49 UTC (rev 4842)
+++ MOAB/trunk/src/GeomTopoTool.cpp	2011-05-18 19:07:20 UTC (rev 4843)
@@ -763,8 +763,9 @@
 {
   ErrorCode rval;
   if (!sense2Tag && create) {
+    EntityHandle def_val[2] = {0, 0};
     rval = mdbImpl->tag_create(GEOM_SENSE_2_TAG_NAME, 2 * sizeof(EntityHandle),
-        MB_TAG_SPARSE, MB_TYPE_HANDLE, sense2Tag, 0, true);
+        MB_TAG_SPARSE, MB_TYPE_HANDLE, sense2Tag, def_val, true);
     if (MB_SUCCESS != rval && (MB_ALREADY_ALLOCATED != rval || !sense2Tag))
       return MB_FAILURE;
   }
@@ -1086,11 +1087,12 @@
   for (int dim=0; dim<4; dim++)
   {
     int gid = 0;
+    unsigned int set_options = ( (1!=dim) ? MESHSET_SET : MESHSET_ORDERED );
     for (Range::iterator it=geomRanges[dim].begin(); it!=geomRanges[dim].end(); it++)
     {
       EntityHandle set=*it;
       EntityHandle newSet;
-      rval = mdbImpl->create_meshset(MESHSET_SET, newSet);
+      rval = mdbImpl->create_meshset(set_options, newSet);
       if (MB_SUCCESS!=rval)
         return NULL;
       relate[set] = newSet;
@@ -1105,13 +1107,27 @@
       rval = mdbImpl->tag_set_data(gidTag, &newSet, 1, &gid);
       if (MB_SUCCESS!=rval)
         return NULL;
-      Range ents;
-      rval = mdbImpl->get_entities_by_handle(set, ents);
-      if (MB_SUCCESS!=rval)
-        return NULL;
-      rval = mdbImpl->add_entities(newSet, ents);
-      if (MB_SUCCESS!=rval)
-        return NULL;
+      if (dim==1)
+      {
+        // the entities are ordered, we need to retrieve them ordered, and set them ordered
+        std::vector<EntityHandle> mesh_edges;
+        rval = mdbImpl->get_entities_by_handle(set, mesh_edges);
+        if (MB_SUCCESS!=rval)
+          return NULL;
+        rval = mdbImpl->add_entities(newSet, &(mesh_edges[0]), (int)mesh_edges.size());
+        if (MB_SUCCESS!=rval)
+          return NULL;
+      }


More information about the moab-dev mailing list