[MOAB-dev] r3951 - in MOAB/trunk: src/io tools

tautges at mcs.anl.gov tautges at mcs.anl.gov
Tue May 25 11:03:11 CDT 2010


Author: tautges
Date: 2010-05-25 11:03:11 -0500 (Tue, 25 May 2010)
New Revision: 3951

Modified:
   MOAB/trunk/src/io/ReadCCMIO.cpp
   MOAB/trunk/tools/size.cpp
Log:
Account for default material sets with index = 0 in CCMIO.

Fix bug in size evaluating meshes with polyhedra.



Modified: MOAB/trunk/src/io/ReadCCMIO.cpp
===================================================================
--- MOAB/trunk/src/io/ReadCCMIO.cpp	2010-05-25 15:02:33 UTC (rev 3950)
+++ MOAB/trunk/src/io/ReadCCMIO.cpp	2010-05-25 16:03:11 UTC (rev 3951)
@@ -349,7 +349,7 @@
     int mindex;
     CCMIOError error = kCCMIONoErr;
     CCMIOGetEntityIndex(&error, next, &mindex);
-    assert(mindex > 0 && mindex <= (int)newNeusets.size()+1);
+    assert(mindex >= 0 && mindex <= (int)newNeusets.size()+1);
     std::map<int,EntityHandle>::iterator mit = newNeusets.find(mindex);
     if (mit == newNeusets.end()) 
         // no actual faces for this neuset; continue to next
@@ -489,13 +489,13 @@
     // first, do a dummy read to see if we even have topo types in this mesh
   int dum_int;
   CCMIOReadOpt1i(&error, cellID, "CellTopologyType", &dum_int,
-                 CCMIOINDEXC(kCCMIOStart), CCMIOINDEXC(kCCMIOStart));
+                 CCMIOINDEXC(kCCMIOStart), CCMIOINDEXC(kCCMIOStart)+1);
   if (kCCMIONoErr != error) return MB_SUCCESS;
   
     // ok, we have topo types; first get the map node
   std::vector<int> dum_ints(num_cells);
   CCMIOReadCells(&error, cellID, &mapID, &dum_ints[0],
-                 CCMIOINDEXC(kCCMIOStart), CCMIOINDEXC(kCCMIOStart));
+                 CCMIOINDEXC(kCCMIOStart), CCMIOINDEXC(kCCMIOStart)+1);
   CHKCCMERR(error, "Failed to get the map node.");
 
     // now read the map

Modified: MOAB/trunk/tools/size.cpp
===================================================================
--- MOAB/trunk/tools/size.cpp	2010-05-25 15:02:33 UTC (rev 3950)
+++ MOAB/trunk/tools/size.cpp	2010-05-25 16:03:11 UTC (rev 3951)
@@ -146,9 +146,14 @@
     {
       rval = mb.get_connectivity( &*i, 1, conn, true );
       if (MB_SUCCESS != rval) return rval;
+      if (type == MBPOLYHEDRON) {
+        std::vector<EntityHandle> dum_conn(conn);
+        conn.clear();
+        rval = mb.get_adjacencies(&dum_conn[0], dum_conn.size(), 0, false, conn, Interface::UNION);
+        if (MB_SUCCESS != rval) return rval;
+      }
       coords.resize( 3*conn.size() );
       rval = mb.get_coords( &conn[0], conn.size(), &coords[0] );
-      if (MB_SUCCESS != rval) return rval;
       stats.stats[type].add( measure( type, conn.size(), &coords[0] ) );
       
       if (type != MBEDGE)



More information about the moab-dev mailing list