[MOAB-dev] r5723 - MOAB/trunk/src
iulian at mcs.anl.gov
iulian at mcs.anl.gov
Thu Aug 30 14:14:08 CDT 2012
Author: iulian
Date: 2012-08-30 14:14:08 -0500 (Thu, 30 Aug 2012)
New Revision: 5723
Modified:
MOAB/trunk/src/ScdInterface.cpp
Log:
periodicity bug in getting the right vertex for edges/faces that wrap around
Modified: MOAB/trunk/src/ScdInterface.cpp
===================================================================
--- MOAB/trunk/src/ScdInterface.cpp 2012-08-29 22:03:24 UTC (rev 5722)
+++ MOAB/trunk/src/ScdInterface.cpp 2012-08-30 19:14:08 UTC (rev 5723)
@@ -520,8 +520,14 @@
// get the vertices making up this entity
EntityHandle verts[4];
for (int ind = 0; ind < 2*dim; ind++) {
- verts[ind] = get_vertex(i+subconnect[dim-1][dir][ind][0],
- j+subconnect[dim-1][dir][ind][1],
+ int i1=i+subconnect[dim-1][dir][ind][0];
+ int j1=j+subconnect[dim-1][dir][ind][1];
+ // if periodic in i and i1 is boxDims[3]+1, wrap around
+ if (locallyPeriodic[0] && i1==boxDims[3]+1) i1=boxDims[0];
+ // if periodic in j and j1 is boxDims[4]+1, wrap around
+ if (locallyPeriodic[1] && j1==boxDims[4]+1) j1=boxDims[1];
+ verts[ind] = get_vertex(i1,
+ j1,
k+subconnect[dim-1][dir][ind][2]);
if (!verts[ind]) return MB_FAILURE;
}
More information about the moab-dev
mailing list