aboutsummaryrefslogtreecommitdiff
path: root/src/rotatingsymmetry180.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rotatingsymmetry180.c')
-rw-r--r--src/rotatingsymmetry180.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/rotatingsymmetry180.c b/src/rotatingsymmetry180.c
index 216dc78..c26c576 100644
--- a/src/rotatingsymmetry180.c
+++ b/src/rotatingsymmetry180.c
@@ -14,6 +14,8 @@
#include "Slab.h"
+#include "rotatingsymmetry180.h"
+
int BndRot180VI (cGH const * restrict const cctkGH,
@@ -288,17 +290,22 @@ int BndRot180VI (cGH const * restrict const cctkGH,
parity = parities[0] * parities[1];
assert (abs(parity) == 1);
if (parity == -1) {
+ int imin[3], imax[3];
int i, j, k;
+ for (d=0; d<3; ++d) {
+ imin[d] = xferinfo[d].dst.off;
+ imax[d] = xferinfo[d].dst.off + xferinfo[d].dst.len;
+ imin[d] -= cctk_lbnd[d];
+ imax[d] -= cctk_lbnd[d];
+ if (imin[d] < 0) imin[d] = 0;
+ if (imax[d] >= cctk_lsh[d]) imax[d] = cctk_lsh[d];
+ }
assert (group.dim == 3);
assert (group.vartype == CCTK_VARIABLE_REAL);
- for (k=0; k<xferinfo[2].dst.len; ++k) {
- for (j=0; j<xferinfo[1].dst.len; ++j) {
- for (i=0; i<xferinfo[0].dst.len; ++i) {
- const int ind
- = CCTK_GFINDEX3D(cctkGH,
- xferinfo[0].dst.off + i - cctk_lbnd[0],
- xferinfo[1].dst.off + j - cctk_lbnd[1],
- xferinfo[2].dst.off + k - cctk_lbnd[2]);
+ for (k=imin[0]; k<imax[2]; ++k) {
+ for (j=imin[1]; j<imax[1]; ++j) {
+ for (i=imin[2]; i<imax[0]; ++i) {
+ const int ind = CCTK_GFINDEX3D(cctkGH, i, j, k);
((CCTK_REAL *) varptr) [ind] *= -1;
}
}