[MOAB-dev] r1666 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Fri Mar 14 15:07:51 CDT 2008


Author: kraftche
Date: 2008-03-14 15:07:51 -0500 (Fri, 14 Mar 2008)
New Revision: 1666

Modified:
   MOAB/trunk/MBWriteUtil.cpp
Log:
Don't fail if asked for the coordinates for an empty MBRange of vertices.
We do sometimes want to write files with no vertices (e.g. just a kD-tree)
and it is easier to code individual writers if we don't need a special
case for that.  Fixes one error in parallel read & broadcast of kd-tree.


Modified: MOAB/trunk/MBWriteUtil.cpp
===================================================================
--- MOAB/trunk/MBWriteUtil.cpp	2008-03-14 20:01:17 UTC (rev 1665)
+++ MOAB/trunk/MBWriteUtil.cpp	2008-03-14 20:07:51 UTC (rev 1666)
@@ -80,8 +80,16 @@
     return MB_FAILURE;
 
   // there should be some entities
-  if(entities.empty())
-    return MB_FAILURE;
+  //if(entities.empty())
+  //  return MB_FAILURE;
+  // The above necessitates annoying special cases for files 
+  // w/out vertices (e.g. a kD-tree).  Return NULL array
+  // pointers instead. - kraftcheck, 3-14-08
+  if (entities.empty()) {
+    arrays.clear();
+    arrays.resize( num_arrays, NULL );
+    return MB_SUCCESS;
+  }
 
   // memory should already be allocated for us
   int tmp_num_arrays = 0;




More information about the moab-dev mailing list