From 95ec587a0c1567950f0f2b02e1a734e0cbaa5f21 Mon Sep 17 00:00:00 2001 From: schnetter Date: Wed, 2 Nov 2005 00:37:03 +0000 Subject: 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 --- src/ReduceGA.c | 20 ++------------------ 1 file 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 */ -- cgit v1.2.3