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

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue Mar 15 19:46:57 CDT 2011


Author: kraftche
Date: 2011-03-15 19:46:56 -0500 (Tue, 15 Mar 2011)
New Revision: 4600

Modified:
   MOAB/trunk/src/io/WriteHDF5.cpp
Log:
change I made in r4598 was wrong.  do it the right way

Modified: MOAB/trunk/src/io/WriteHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/WriteHDF5.cpp	2011-03-16 00:31:59 UTC (rev 4599)
+++ MOAB/trunk/src/io/WriteHDF5.cpp	2011-03-16 00:46:56 UTC (rev 4600)
@@ -1239,11 +1239,17 @@
       unsigned char flags;
       rval = writeUtil->get_entity_list_pointers( j, i, &ptr, which_data, &len, &flags );
       if (MB_SUCCESS != rval) return rval;
-      if (which_data == WriteUtilIface::CONTENTS && !(flags&MESHSET_ORDERED) && len > 2) {
+      if (which_data == WriteUtilIface::CONTENTS && !(flags&MESHSET_ORDERED)) {
         bool compacted;
         remaining.clear();
-        rval = range_to_blocked_list( ptr, len/2, remaining, compacted );
-        if (MB_SUCCESS != rval) return rval;
+        if (len == 0) {
+          compacted = false;
+        }
+        else {
+          assert(!(len%2));
+          rval = range_to_blocked_list( ptr, len/2, remaining, compacted );
+          if (MB_SUCCESS != rval) return rval;
+        }
         if (compacted) {
           rhint = ranged->insert( rhint, *j );
           set_sizes->push_back( remaining.size() );
@@ -2740,7 +2746,7 @@
     CHK_MB_ERR_0(rval);
     
       // check if can and should compress as ranges
-    if (!(flags&MESHSET_ORDERED) && contents_length_set > 2)
+    if (!(flags&MESHSET_ORDERED) && contents_length_set)
     {
       set_contents.clear();
       rval = iFace->get_entities_by_handle( *iter, set_contents, false );



















More information about the moab-dev mailing list