aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Cartoon2DBC.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Cartoon2DBC.c b/src/Cartoon2DBC.c
index 7653424..027e9f7 100644
--- a/src/Cartoon2DBC.c
+++ b/src/Cartoon2DBC.c
@@ -160,6 +160,7 @@ int BndCartoon2DVI(const cGH *cctkGH, int tensortype, int prolongtype, int vi)
dj = lnx;
/* y = 0 */
+ assert (ny % 2 == 1);
j = ny/2;
/* make sure that the input data is synced */
@@ -169,10 +170,19 @@ int BndCartoon2DVI(const cGH *cctkGH, int tensortype, int prolongtype, int vi)
for (k = 0; k < lnz; k++)
/* y-direction: as many zombies as the evolution stencil needs */
+#if 0
for (jj = 1, dj = jj*lnx; jj <= ny/2; jj++, dj = jj*lnx)
+#else
+ for (jj = 0, dj = jj*lnx; jj <= ny/2; jj++, dj = jj*lnx)
+#endif
/* x-direction: zombie for x < 0, including upper boundary for extrapol */
+#if 0
for (i = -s; i < lnx; i++) {
+#else
+ for (i = 0; i < lnx; i++)
+ if (! (i > s && jj == 0)) {
+#endif
/* index into linear memory */
ijk = CCTK_GFINDEX3D(cctkGH,i,j,k);
@@ -182,7 +192,11 @@ int BndCartoon2DVI(const cGH *cctkGH, int tensortype, int prolongtype, int vi)
/* compute coordinates (could also use Cactus grid function) */
x = lx0 + dx0 * i;
+#if 0
y = (dj) ? dy0 * jj : 0;
+#else
+ y = dy0 * jj;
+#endif
rho = sqrt(x*x + y*y);
/* compute rotation matrix
@@ -280,8 +294,10 @@ int BndCartoon2DVI(const cGH *cctkGH, int tensortype, int prolongtype, int vi)
return(-1);
}
+#if 0
/* what a neat way to hack out the zombies for x < 0, y = 0 */
if (dj == 0) {i -= s; ijk -= s; dj = jj*lnx;}
+#endif
}
/* syncs needed after interpolation (actually only for x direction) */