diff options
author | schnetter <schnetter@d60812e6-3970-4df4-986e-c251b06effeb> | 2005-11-02 00:37:03 +0000 |
---|---|---|
committer | schnetter <schnetter@d60812e6-3970-4df4-986e-c251b06effeb> | 2005-11-02 00:37:03 +0000 |
commit | 95ec587a0c1567950f0f2b02e1a734e0cbaa5f21 (patch) | |
tree | d7cbce64780502d54e8ce4c53897d21b65de389f | |
parent | f46fc115af008bc85b9b3d860d7890fd30a12a55 (diff) |
Calculate the index ranges for the local reduction correctly. PUGH's
GA->extras->ownership already takes periodic boundaries (and grid
staggering) into account. The previous code thus corrected twice for
periodic boundaries, and thus reduced over too few grid points.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHReduce/trunk@76 d60812e6-3970-4df4-986e-c251b06effeb
-rw-r--r-- | src/ReduceGA.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/ReduceGA.c b/src/ReduceGA.c index c1aeabb..29ddd07 100644 --- a/src/ReduceGA.c +++ b/src/ReduceGA.c @@ -231,29 +231,13 @@ static int ReduceGridArrays (const cGH *GH, GA = ((pGA ***) PUGH_pGH (GH)->variables)[input_array_variable_indices[0]][0]; data = GA->data; - /* set lower bounds to zero and increment max subscript to use < instead of <= */ - for ( i=0; i < dim; i++) - { - min_array_subscript[i] = 0; - input_array_dims[i] = GA->extras->lnsize[i]; - } - - /* Fix subscripts for staggering */ + /* calculate index ranges */ for ( i=0; i < dim; i++) { /* get the start- and endpoint to iterate over in this dimension */ min_array_subscript[i] = GA->extras->ownership[GA->stagger[i]][0][i]; array_lsh[i] = GA->extras->ownership[GA->stagger[i]][1][i]; - - /* get the number of points in this dimension (excluding ghostzones) */ - if (GA->connectivity->perme[i]) - { - array_lsh[i] -= 2*GA->extras->nghostzones[i]; - } - if (GA->stagger[i]) - { - array_lsh[i]--; - } + input_array_dims[i] = GA->extras->lnsize[i]; } /* Create the parameter table if it is not there and add the bounds to it */ |