[MOAB-dev] r3953 - MOAB/trunk/src/io

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


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

Modified:
   MOAB/trunk/src/io/ReadCCMIO.cpp
   MOAB/trunk/src/io/ReadCCMIO.hpp
Log:
Was storing face handles in range after construction, when I should have
been storing in vector (since types are mixed, order in range will be
different than creation order).



Modified: MOAB/trunk/src/io/ReadCCMIO.cpp
===================================================================
--- MOAB/trunk/src/io/ReadCCMIO.cpp	2010-05-25 16:28:44 UTC (rev 3952)
+++ MOAB/trunk/src/io/ReadCCMIO.cpp	2010-05-25 16:54:54 UTC (rev 3953)
@@ -506,12 +506,13 @@
   for (i = 0; i < num_cells; i++) cell_topo_types[dum_ints[i]] = 0;
 
     // now read the cell topo types for real, reusing cell_topo_types
-  CCMIOReadOpt1i(&error, cellID, "CellTopologyType", &dum_ints[0],
+  std::vector<int> topo_types(num_cells);
+  CCMIOReadOpt1i(&error, cellID, "CellTopologyType", &topo_types[0],
                  CCMIOINDEXC(kCCMIOStart), CCMIOINDEXC(kCCMIOEnd));
   CHKCCMERR(error, "Failed to get cell topo types.");
   std::map<int,int>::iterator mit;
-  for (i = 0, mit = cell_topo_types.begin(); i < num_cells; i++) 
-    mit->second = dum_ints[i];
+  for (i = 0; i < num_cells; i++) 
+    cell_topo_types[dum_ints[i]] = topo_types[i];
   
   return MB_SUCCESS;
 }
@@ -903,7 +904,7 @@
                  farray, CCMIOINDEXC(kCCMIOStart), CCMIOINDEXC(kCCMIOEnd));
   CHKCCMERR(error, "Trouble reading face connectivity.");
 
-  Range face_handles;
+  std::vector<EntityHandle> face_handles;
   ErrorCode rval = make_faces(farray, vert_map, face_handles, num_faces);
   CHKERR(rval, NULL);
 
@@ -916,17 +917,17 @@
   CHKCCMERR(error, "Trouble reading face cells.");
 
   int *tmp_ptr = face_cells;
-  for (Range::iterator rit = face_handles.begin(); rit != face_handles.end(); rit++) {
+  for (unsigned int i = 0; i < face_handles.size(); i++) {
 #ifdef TUPLE_LIST
     short forward = 1, reverse = -1;
-    face_map.push_back(&forward, tmp_ptr++, &(*rit), NULL);
+    face_map.push_back(&forward, tmp_ptr++, &face_handles[i], NULL);
     if (2 == num_sides)
-      face_map.push_back(&reverse, tmp_ptr++, &(*rit), NULL);
+      face_map.push_back(&reverse, tmp_ptr++, &face_handles[i], NULL);
 #else
-    face_map[*tmp_ptr].push_back(*rit);
+    face_map[*tmp_ptr].push_back(face_handles[i]);
     sense_map[*tmp_ptr++].push_back(1);
     if (2 == num_sides) {
-      face_map[*tmp_ptr].push_back(*rit);
+      face_map[*tmp_ptr].push_back(face_handles[i]);
       sense_map[*tmp_ptr++].push_back(-1);


More information about the moab-dev mailing list