[MOAB-dev] r1214 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Wed Jul 18 14:23:46 CDT 2007


Author: kraftche
Date: 2007-07-18 14:23:46 -0500 (Wed, 18 Jul 2007)
New Revision: 1214

Modified:
   MOAB/trunk/WriteVtk.cpp
Log:
fix inefficiency in previous commit : closure of elements code belongs outside entityset loop

Modified: MOAB/trunk/WriteVtk.cpp
===================================================================
--- MOAB/trunk/WriteVtk.cpp	2007-07-18 19:14:54 UTC (rev 1213)
+++ MOAB/trunk/WriteVtk.cpp	2007-07-18 19:23:46 UTC (rev 1214)
@@ -171,22 +171,22 @@
       nodes.merge( node_i, elem_i );
       elems.merge( elem_i, set_i );
       std::copy( set_i, a.end(), std::back_inserter(sets) );
-    
-      for (MBRange::const_iterator e = elems.begin(); e != elems.end(); ++e)
-      {
-        const MBEntityHandle* conn;
-        int conn_len;
-        rval = mbImpl->get_connectivity( *e, conn, conn_len );
-        if (MB_SUCCESS != rval) return rval;
-
-        for (int i = 0; i < conn_len; ++i)
-          nodes.insert( conn[i] );
-      }
       
       a.clear();
       rval = mbImpl->get_child_meshsets( set, a );
       std::copy( a.begin(), a.end(), std::back_inserter(sets) );
     }
+    
+    for (MBRange::const_iterator e = elems.begin(); e != elems.end(); ++e)
+    {
+      const MBEntityHandle* conn;
+      int conn_len;
+      rval = mbImpl->get_connectivity( *e, conn, conn_len );
+      if (MB_SUCCESS != rval) return rval;
+
+      for (int i = 0; i < conn_len; ++i)
+        nodes.insert( conn[i] );
+    }
   }
 
   if (nodes.empty())




More information about the moab-dev mailing list