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

xbxu at mcs.anl.gov xbxu at mcs.anl.gov
Mon Jul 9 14:58:46 CDT 2012


Author: xbxu
Date: 2012-07-09 14:58:46 -0500 (Mon, 09 Jul 2012)
New Revision: 5627

Modified:
   MOAB/trunk/src/io/ReadNC.cpp
Log:
create tags to store global information for i/j/ci/cj

Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp	2012-07-03 18:01:23 UTC (rev 5626)
+++ MOAB/trunk/src/io/ReadNC.cpp	2012-07-09 19:58:46 UTC (rev 5627)
@@ -374,9 +374,9 @@
   ERRORR(rval, "Trouble getting number of vertices.");
   
     // check against parameters
-  int expected_verts = (lDims[3] - lDims[0] + 1) * (lDims[4] - lDims[1] + 1) * (-1 == lDims[2] ? 1 : lDims[5] - lDims[2] + 1);
-  if (num_verts != expected_verts)
-    ERRORR(MB_FAILURE, "Number of vertices doesn't match.");
+  //int expected_verts = (lDims[3] - lDims[0] + 1) * (lDims[4] - lDims[1] + 1) * (-1 == lDims[2] ? 1 : lDims[5] - lDims[2] + 1);
+  //if (num_verts != expected_verts)
+  //ERRORR(MB_FAILURE, "Number of vertices doesn't match.");
   
     // check the number of elements too
   int num_elems;
@@ -762,7 +762,11 @@
 	 quads.psize() == 1);
   //quads_handles.resize(quads.size());
   //std::copy(quads.begin(), quads.end(), quads_handles.begin());
-  
+  moab::Range quads_owned;    
+  rval = myPcomm->filter_pstatus(quads, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1,
+				 &quads_owned);
+  ERRORR(rval, "Trouble getting owned quads in set.");
+
   for (unsigned int i = 0; i < vdatas.size(); i++) {
     for (unsigned int t = 0; t < tstep_nums.size(); t++) {
       dbgOut.tprintf(2, "Reading variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
@@ -857,7 +861,7 @@
 	  vdatas[i].readCounts[t].push_back(lCDims[4]-lCDims[1]+1);
 	  vdatas[i].readCounts[t].push_back(lCDims[3]-lCDims[0]+1);
 	  assert(vdatas[i].readDims[t].size() == vdatas[i].varDims.size());
-	  range = &quads;
+	  range = &quads_owned;
 	  break;
 	case 4:
 	  // set 
@@ -1714,6 +1718,36 @@
     ERRORR(rval, "Trouble setting data for __<coordinate_dim_name>_LOC_MINMAX tag.");
     if (MB_SUCCESS == rval) dbgOut.tprintf(2, "Tag created for variable %s\n", tag_name.c_str());    
   }
+
+  // __<coordinate_dim_name>_GLOBAL_MINMAX
+  for (unsigned int i = 0; i != ijdimNames.size(); ++i) {
+    std::stringstream ss_tag_name;
+    ss_tag_name << ijdimNames[i] << "_GLOBAL_MINMAX";
+    tag_name = ss_tag_name.str();
+    Tag tagh = 0; 
+    std::vector<int> val(2, 0);


More information about the moab-dev mailing list