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

xbxu at mcs.anl.gov xbxu at mcs.anl.gov
Wed Jul 25 14:42:36 CDT 2012


Author: xbxu
Date: 2012-07-25 14:42:36 -0500 (Wed, 25 Jul 2012)
New Revision: 5638

Modified:
   MOAB/trunk/src/io/ReadNC.cpp
Log:
fix the serial build

Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp	2012-07-25 18:44:37 UTC (rev 5637)
+++ MOAB/trunk/src/io/ReadNC.cpp	2012-07-25 19:42:36 UTC (rev 5638)
@@ -3002,14 +3002,21 @@
     }
   }
   std::string tag_name = "COORDS";
-  void * val = &coords[0];
-  int val_len = coords.size();
   Tag tagh = 0; 
   rval = mbImpl->tag_get_handle(tag_name.c_str(), 3, MB_TYPE_DOUBLE, tagh, MB_TAG_DENSE|MB_TAG_CREAT);
   ERRORR(rval, "Trouble creating COORDS tag.");
-  rval = mbImpl->tag_set_by_ptr(tagh, &file_set, 1, &val, &val_len);
-  ERRORR(rval, "Trouble setting data for COORDS tag.");
   
+  void *data;
+  int count;
+#ifdef USE_MPI
+  rval = mbImpl->tag_iterate(tagh, ents_owned.begin(), ents_owned.end(), count, data);
+#else
+  rval = mbImpl->tag_iterate(tagh, ents.begin(), ents.end(), count, data);
+#endif
+  ERRORR(rval, "Failed to get COORDS tag iterator.");
+  assert(count == (int)numOwnedEnts);
+  double* quad_data = (double*)data;
+  std::copy(coords.begin(), coords.end(), quad_data);
   return MB_SUCCESS;
 }
 



More information about the moab-dev mailing list