aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@1c20744c-e24a-42ec-9533-f5004cb800e5>2003-06-11 16:50:04 +0000
committertradke <tradke@1c20744c-e24a-42ec-9533-f5004cb800e5>2003-06-11 16:50:04 +0000
commit4ad96b2f952bb9ddc07eaa276719ec7983cd239c (patch)
treea4e3f36edf23891cc820a1614f2460903863477c
parent0ee2c445d50bfdd8034823ee2eac437436fc7043 (diff)
Fixed the stencil range in warning messages about out-of-bound interpolation points.
This closes PR CactusPUGH/1527. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHInterp/trunk@63 1c20744c-e24a-42ec-9533-f5004cb800e5
-rw-r--r--src/Operator.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/Operator.c b/src/Operator.c
index a405ef5..45c6dad 100644
--- a/src/Operator.c
+++ b/src/Operator.c
@@ -1040,16 +1040,15 @@ static int CheckOutOfBounds (const cGH *GH, const char *coord_system_name,
const int *dims, const CCTK_REAL *const *coords)
{
int i, p, point, out_of_bounds, retval;
- CCTK_REAL *origin, *delta, *delta_inv, *below, *offset;
+ CCTK_REAL *origin, *delta, *delta_inv, *below;
char *msg;
msg = malloc (100 + N_dims*(10 + 4*30));
- origin = malloc (5 * N_dims * sizeof (CCTK_REAL));
+ origin = malloc (4 * N_dims * sizeof (CCTK_REAL));
delta = origin + 1*N_dims;
delta_inv = origin + 2*N_dims;
below = origin + 3*N_dims;
- offset = origin + 4*N_dims;
/* get the global origin and delta of the coordinate system */
for (i = 0; i < N_dims; i++)
@@ -1071,7 +1070,7 @@ static int CheckOutOfBounds (const cGH *GH, const char *coord_system_name,
/* loop over all dimensions */
for (i = 0; i < N_dims; i++)
{
- /* closest grid point for stencil */
+ /* grid point of the lower-left stencil point */
point = floor ((coords[i][p] - origin[i]) * delta_inv[i]
- 0.5 * (order - 1));
@@ -1080,27 +1079,24 @@ static int CheckOutOfBounds (const cGH *GH, const char *coord_system_name,
/* physical coordinate of that grid point */
below[i] = origin[i] + point * delta[i];
-
- /* offset from that grid point, in fractions of grid points */
- offset[i] = (coords[i][p] - below[i]) * delta_inv[i];
}
/* check bounds */
if (out_of_bounds)
{
/* put all information into a single message string for output */
- sprintf (msg, "Interpolation stencil out of bounds at grid point [%f",
- (double) coords[0][p]);
+ sprintf (msg, "Interpolation stencil out of bounds at interpolation "
+ "coordinate [%f", (double) coords[0][p]);
for (i = 1; i < N_dims; i++)
{
sprintf (msg, "%s, %f", msg, (double) coords[i][p]);
}
sprintf (msg, "%s]\nrange would be min/max [%f / %f", msg,
- (double) below[0], (double) (below[0] + offset[0]));
+ (double) below[0], (double) (below[0] + order*delta[0]));
for (i = 1; i < N_dims; i++)
{
sprintf (msg, "%s, %f / %f", msg,
- (double) below[i], (double) (below[i] + offset[i]));
+ (double) below[i], (double) (below[i] + order*delta[i]));
}
sprintf (msg, "%s]\ngrid is min/max [%f / %f", msg,
(double) origin[0], (double) (origin[0] + (dims[0]-1)*delta[0]));