[MOAB-dev] r5527 - MOAB/trunk/src

iulian at mcs.anl.gov iulian at mcs.anl.gov
Fri May 18 16:51:19 CDT 2012


Author: iulian
Date: 2012-05-18 16:51:19 -0500 (Fri, 18 May 2012)
New Revision: 5527

Modified:
   MOAB/trunk/src/GeomTopoTool.cpp
Log:
add more debug info when the topological tests are failing

for example, Takeda1.h5m has an edge that is oriented the wrong way. 
Our convention is that the orientation of mesh edges in an edge set is the same,
 and that
mesh edges are oriented along the geometry edge, in order.


Modified: MOAB/trunk/src/GeomTopoTool.cpp
===================================================================
--- MOAB/trunk/src/GeomTopoTool.cpp	2012-05-18 19:05:02 UTC (rev 5526)
+++ MOAB/trunk/src/GeomTopoTool.cpp	2012-05-18 21:51:19 UTC (rev 5527)
@@ -1309,7 +1309,7 @@
   return MB_SUCCESS;
 }
 
-#define  RETFALSE(a) { std::cout<<a<<"\n"; return false; }
+#define  RETFALSE(a, b) { std::cout<<a<<"\n"; mdbImpl->list_entity(b); return false; }
 bool GeomTopoTool::check_model()
 {
   // vertex sets should have one node
@@ -1321,20 +1321,20 @@
     Range nodes;
     rval = mdbImpl->get_entities_by_handle(vSet, nodes);
     if (MB_SUCCESS!=rval)
-      RETFALSE(" failed to get nodes from vertex set ")
+      RETFALSE(" failed to get nodes from vertex set ", vSet);
     if (nodes.size()!=1)
-      RETFALSE(" number of nodes is different from 1 ")
+      RETFALSE(" number of nodes is different from 1 ", vSet)
     EntityType type = mdbImpl->type_from_handle(nodes[0]);
     if (type != MBVERTEX)
-      RETFALSE(" entity in vertex set is not a node ")
+      RETFALSE(" entity in vertex set is not a node ", nodes[0])
     // get all parents, and see if they belong to geomRanges[1]
     Range edges;
     rval = mdbImpl->get_parent_meshsets(vSet, edges);
     if (MB_SUCCESS!=rval)
-      RETFALSE(" can't get parent edges for a node set ")
+      RETFALSE(" can't get parent edges for a node set ", vSet)
     Range notEdges = subtract(edges, geomRanges[1] );
     if (!notEdges.empty())
-      RETFALSE(" some parents of a node set are not geo edges ")
+      RETFALSE(" some parents of a node set are not geo edges ", notEdges[0])
   }
 
   // edges to be formed by continuous chain of mesh edges, oriented correctly
@@ -1344,10 +1344,10 @@
     std::vector<EntityHandle> mesh_edges;
     rval = mdbImpl->get_entities_by_type(edge, MBEDGE, mesh_edges);
     if (MB_SUCCESS!=rval)
-      RETFALSE(" can't get mesh edges from edge set")
+      RETFALSE(" can't get mesh edges from edge set", edge)
     int num_edges = (int)mesh_edges.size();
     if (num_edges==0)
-      RETFALSE(" no mesh edges in edge set ")
+      RETFALSE(" no mesh edges in edge set ", edge)
     EntityHandle firstNode;
     EntityHandle currentNode; // will also hold the last node in chain of edges


More information about the moab-dev mailing list