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

xbxu at mcs.anl.gov xbxu at mcs.anl.gov
Wed Jul 25 10:24:06 CDT 2012


Author: xbxu
Date: 2012-07-25 10:24:06 -0500 (Wed, 25 Jul 2012)
New Revision: 5636

Modified:
   MOAB/trunk/src/io/ReadNC.cpp
Log:
compute the coorinate of last node in i direction

Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp	2012-07-19 14:58:03 UTC (rev 5635)
+++ MOAB/trunk/src/io/ReadNC.cpp	2012-07-25 15:24:06 UTC (rev 5636)
@@ -447,11 +447,7 @@
   ERRORR(rval, "Couldn't get vertex coordinate arrays.");
 
   int i, j, k, il, jl, kl, itmp;
-  int dil;
-  if (!locallyPeriodic[0] && globallyPeriodic[0] && lDims[3] > gDims[3])
-    dil = lDims[3] - lDims[0];
-  else
-    dil = lDims[3] - lDims[0] + 1;
+  int dil = lDims[3] - lDims[0] + 1;
   int djl = lDims[4] - lDims[1] + 1;
   int di = gDims[3] - gDims[0] + 1;
   int dj = gDims[4] - gDims[1] + 1;
@@ -1767,7 +1763,7 @@
   else {
     if (!locallyPeriodic[0] && globallyPeriodic[0] && lDims[3] > gDims[3]) {
       // globally periodic and I'm the last proc, get fewer vertex coords than vertices in i
-      ilVals.resize(lDims[3] - lDims[0]);
+      ilVals.resize(lDims[3] - lDims[0]+1);
       ilCVals.resize(lDims[3] - lDims[0]);
       lCDims[3] = lDims[3]-1;
     }
@@ -1817,11 +1813,11 @@
       if (!locallyPeriodic[0] && globallyPeriodic[0] && lDims[3] > gDims[3]) {
 	std::vector<double> tilVals(ilVals.size()-1, 0.0);
 	rval = read_coordinate(iName.c_str(), lDims[0], lDims[3]-1, tilVals);
-	double dif = (tilVals[1] - tilVals[0])/2;
+	double dif = tilVals[1] - tilVals[0];
 	std::size_t i;
 	for (i = 0; i != tilVals.size(); ++i)
 	  ilVals[i] = tilVals[i];
-	ilVals[i] = tilVals[i-1] + dif;
+	ilVals[i] = ilVals[i-1]+dif;
       }
       else {
 	rval = read_coordinate(iName.c_str(), lDims[0], lDims[3], ilVals);
@@ -2127,7 +2123,7 @@
   else {
     if (!locallyPeriodic[0] && globallyPeriodic[0] && lDims[3] > gDims[3]) {
       // globally periodic and I'm the last proc, get fewer vertex coords than vertices in i
-      ilVals.resize(lDims[3] - lDims[0]);
+      ilVals.resize(lDims[3] - lDims[0]+1);
       ilCVals.resize(lDims[3] - lDims[0]);
       lCDims[3] = lDims[3]-1;
     }
@@ -2174,14 +2170,11 @@
   


More information about the moab-dev mailing list