diff options
Diffstat (limited to 'src/Operator.c')
-rw-r--r-- | src/Operator.c | 47 |
1 files changed, 7 insertions, 40 deletions
diff --git a/src/Operator.c b/src/Operator.c index 90a15be..fc6e2cf 100644 --- a/src/Operator.c +++ b/src/Operator.c @@ -771,44 +771,7 @@ static int GetLocalCoords (cGH *GH, CCTK_REAL *range_min, *range_max; CCTK_REAL *origin, *delta; CCTK_REAL *proc_coords; -#define FUDGE 0.00001 - - -#if 0 - /* TR 03/05/01 - Following flipperoni code was commented out because it doesn't seem - to be used anywhere. - By this we can also get rid of USING the grid::domain parameter. - */ - - /* Do a fliperooni in octant mode */ - /* This flips the sign around the origin only */ - /* if the left side (cx0) is bigger than the position to interpolate at */ - /* BoxInBox needs this for interpolating onto grids */ - if (CCTK_Equals (domain, "octant")) - { - for (point = 0; point < num_points; point++) - { - tmp = 0; - for (dim = 0; dim < extras->dim; dim++) - { - if (coords[dim][point] <= GH->cctk_origin_space[dim]) - { - tmp = 1; /* mark flipping */ - break; - } - } -/*** FIXME *** really change input arrays here ??? */ - if (tmp) - { - for (dim = 0; dim < extras->dim; dim++) - { - coords[dim][point] = fabs (coords[dim][point]); - } - } - } - } -#endif +#define FUDGE 0.0 /* get GH extension handles for PUGHInterp and PUGH */ myGH = (pughInterpGH *) CCTK_GHExtension (GH, "PUGHInterp"); @@ -856,8 +819,12 @@ static int GetLocalCoords (cGH *GH, for (dim = 0; dim < extras->dim; dim++) { /* compute the coordinate ranges */ - range_min[dim] = origin[dim] + (extras->lb[proc][dim] - FUDGE)*delta[dim]; - range_max[dim] = origin[dim] + (extras->ub[proc][dim] + FUDGE)*delta[dim]; + /* TODO: use bbox instead -- but the bboxes of other processors + are now known */ + int const has_lower = extras->lb[proc][dim] == 0; + int const has_upper = extras->ub[proc][dim] == GH->cctk_gsh[dim]-1; + range_min[dim] = origin[dim] + (extras->lb[proc][dim] + (!has_lower) * (extras->nghostzones[dim]-0.5) - FUDGE)*delta[dim]; + range_max[dim] = origin[dim] + (extras->ub[proc][dim] - (!has_upper) * (extras->nghostzones[dim]-0.5) + FUDGE)*delta[dim]; } /* and now which point will be processed by what processor */ |