diff options
Diffstat (limited to 'src/Reduction.c')
-rw-r--r-- | src/Reduction.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Reduction.c b/src/Reduction.c index 7ca59a0..77476eb 100644 --- a/src/Reduction.c +++ b/src/Reduction.c @@ -366,7 +366,7 @@ int PUGH_ReductionGVs (const cGH *GH, static int ReductionGA (const cGH *GH, int vindex, int proc, CCTK_REAL *outval, reduction_fn_t reduction_fn) { - int i, stagger_index, num_points, dir_points, retval; + int i, num_points, dir_points, retval; pGA *GA; const void *data; int *from, *to, *iterator, *points_per_dim; @@ -388,12 +388,9 @@ static int ReductionGA (const cGH *GH, int vindex, int proc, CCTK_REAL *outval, points_per_dim[0] = 1; for (i = 0; i < GA->connectivity->dim; i++) { - /* find out whether the variable is staggered */ - stagger_index = CCTK_StaggerDirIndex (i, GA->stagger); - /* get the start- and endpoint to iterate over in this dimension */ - from[i] = GA->extras->ownership[stagger_index][0][i]; - to[i] = GA->extras->ownership[stagger_index][1][i]; + from[i] = GA->extras->ownership[GA->stagger[i]][0][i]; + to[i] = GA->extras->ownership[GA->stagger[i]][1][i]; /* get the number of points in this dimension (excluding ghostzones) */ dir_points = GA->extras->nsize[i]; @@ -401,7 +398,7 @@ static int ReductionGA (const cGH *GH, int vindex, int proc, CCTK_REAL *outval, { dir_points -= 2*GA->extras->nghostzones[i]; } - if (stagger_index) + if (GA->stagger[i]) { dir_points--; } |