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

hongjun at mcs.anl.gov hongjun at mcs.anl.gov
Wed Jul 14 12:23:59 CDT 2010


Author: hongjun
Date: 2010-07-14 12:23:59 -0500 (Wed, 14 Jul 2010)
New Revision: 4053

Modified:
   MOAB/trunk/src/io/WriteVtk.cpp
Log:
o bug fixed, "get_connectivity" function needs vector storage allocated as an argument


Modified: MOAB/trunk/src/io/WriteVtk.cpp
===================================================================
--- MOAB/trunk/src/io/WriteVtk.cpp	2010-07-13 18:24:22 UTC (rev 4052)
+++ MOAB/trunk/src/io/WriteVtk.cpp	2010-07-14 17:23:59 UTC (rev 4053)
@@ -196,13 +196,12 @@
     
     for (Range::const_iterator e = elems.begin(); e != elems.end(); ++e)
     {
-      const EntityHandle* conn;
-      int conn_len;
-      rval = mbImpl->get_connectivity( *e, conn, conn_len );
+      std::vector<EntityHandle> connect;
+      rval = mbImpl->get_connectivity( &(*e), 1, connect );
       if (MB_SUCCESS != rval) return rval;
 
-      for (int i = 0; i < conn_len; ++i)
-        nodes.insert( conn[i] );
+      for (int i = 0; i < connect.size(); ++i)
+	nodes.insert( connect[i] );
     }
   }
 
@@ -256,12 +255,14 @@
   {
     EntityType type = mbImpl->type_from_handle(*i);
     if (!VtkUtil::get_vtk_type(type, CN::VerticesPerEntity(type))) continue;
-    const EntityHandle* conn;
-    int conn_len;
-    rval = mbImpl->get_connectivity( *i, conn, conn_len );
+    
+    std::vector<EntityHandle> connect;
+    rval = mbImpl->get_connectivity( &(*i), 1, connect );
+    
     if (MB_SUCCESS != rval)
       return rval;
-    num_uses += conn_len;
+
+    num_uses += connect.size();
   }
   stream << "CELLS " << num_elems << ' ' << num_uses << std::endl;
   
@@ -275,9 +276,10 @@
     EntityType type = TYPE_FROM_HANDLE(*i);
 
       // Get element connectivity
-    const EntityHandle* conn;
-    int conn_len;
-    rval = mbImpl->get_connectivity( *i, conn, conn_len );
+    std::vector<EntityHandle> connect;
+    rval = mbImpl->get_connectivity( &(*i), 1, connect );
+    int conn_len = connect.size();


More information about the moab-dev mailing list