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

iulian at mcs.anl.gov iulian at mcs.anl.gov
Fri Jun 3 10:40:55 CDT 2011


Author: iulian
Date: 2011-06-03 10:40:53 -0500 (Fri, 03 Jun 2011)
New Revision: 4940

Modified:
   MOAB/trunk/src/GeomTopoTool.cpp
   MOAB/trunk/src/moab/GeomTopoTool.hpp
   MOAB/trunk/test/gttool_test.cpp
Log:
add a method on GeomTopoTool for checking the model consistency
for example:
  vertex sets need to have one node inside
  edge sets need to be ordered with mesh edges chained 
  edge ends need to be in children vertex sets
  face/edge senses need to be consistent with the embedded mesh entities
  face skins are indeed forming the boundary edges
 
more checks might need to be added:
  can we build edge loops?
  face/region checks are not done yet



Modified: MOAB/trunk/src/GeomTopoTool.cpp
===================================================================
--- MOAB/trunk/src/GeomTopoTool.cpp	2011-06-03 03:30:59 UTC (rev 4939)
+++ MOAB/trunk/src/GeomTopoTool.cpp	2011-06-03 15:40:53 UTC (rev 4940)
@@ -1059,6 +1059,8 @@
 // this would be a deep copy, into a new geom topo tool
   // sets will be duplicated, but entities not
   // modelSet will be a new one
+  // if the original set was null (root), a new model set will be created for
+  // original model, and its entities will be the original g sets
 GeomTopoTool * GeomTopoTool::duplicate_model()
 {
   // will
@@ -1181,10 +1183,202 @@
         return NULL;
     }
   }
+  // if the original root model set for this model is 0 (root set), then create
+  // a new set and put all the old sets in the new model set
+  // in this way, the existing gtt remains valid (otherwise, the modelSet would contain all the
+  // gsets, the old ones and the new ones; the root set contains everything)
+  if (modelSet==0)
+  {
+    rval = mdbImpl->create_meshset(MESHSET_SET, modelSet);
+    if (MB_SUCCESS != rval)
+      return NULL;
+    // add to this new set all previous sets (which are still in ranges)
+    for (int dim=0; dim<4; dim++)
+    {
+      rval = mdbImpl->add_entities(modelSet, geomRanges[dim]);
+      if (MB_SUCCESS != rval)
+        return NULL;
+    }
 
+  }
+
   return newgtt;
 }
 
+#define  RETFALSE(a) { std::cout<<a<<"\n"; return false; }
+bool GeomTopoTool::check_model()
+{
+  // vertex sets should have one node
+  Range::iterator rit;
+  ErrorCode rval;
+  for (rit = geomRanges[0].begin(); rit!=geomRanges[0].end(); rit++)
+  {
+    EntityHandle vSet = *rit;
+    Range nodes;
+    rval = mdbImpl->get_entities_by_handle(vSet, nodes);
+    if (MB_SUCCESS!=rval)


More information about the moab-dev mailing list