aboutsummaryrefslogtreecommitdiff
path: root/src/Interpolate.c
diff options
context:
space:
mode:
authortradke <tradke@1c20744c-e24a-42ec-9533-f5004cb800e5>2002-12-19 11:11:59 +0000
committertradke <tradke@1c20744c-e24a-42ec-9533-f5004cb800e5>2002-12-19 11:11:59 +0000
commit66f121529563e2a05fb30e9f804d6974c48829b8 (patch)
treefb841fe65f5d98bab0772ec64f5661837f82ada1 /src/Interpolate.c
parent785e9f161dab8e277ca0457c554f580b5b916dc1 (diff)
Moved check for interpolation points with a stencil outside of the grid
up from the local interpolation code into the global interpolator. This means for the interpolation of local arrays, points are allowed to be shifted back into the grid. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHInterp/trunk@35 1c20744c-e24a-42ec-9533-f5004cb800e5
Diffstat (limited to 'src/Interpolate.c')
-rw-r--r--src/Interpolate.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Interpolate.c b/src/Interpolate.c
index a097abf..146b61c 100644
--- a/src/Interpolate.c
+++ b/src/Interpolate.c
@@ -283,7 +283,10 @@ int PUGHInterp_Interpolate (int order,
void *const out_arrays[])
{
int retval;
- int i, a, n, out_of_bounds, shift;
+ int i, a, n, shift;
+#if 0
+ int out_of_bounds;
+#endif
int max_dims[MAXDIM], point[MAXDIM];
CCTK_REAL delta_inv[MAXDIM];
CCTK_REAL below[MAXDIM];
@@ -359,8 +362,10 @@ int PUGHInterp_Interpolate (int order,
/* loop over all points to interpolate at */
for (n = 0; n < num_points; n++)
{
+#if 0
/* reset the out-of-bounds flag */
out_of_bounds = 0;
+#endif
/* loop over all dimensions */
for (i = 0; i < num_dims; i++)
@@ -369,8 +374,10 @@ int PUGHInterp_Interpolate (int order,
point[i] = floor ((coord[num_dims*n + i] - origin[i]) * delta_inv[i]
- 0.5 * (order - 1));
+#if 0
/* test bounds */
out_of_bounds |= point[i] < 0 || point[i]+order >= dims[i];
+#endif
/* if beyond lower bound shift the grid point to the right */
shift = point[i];
@@ -413,6 +420,7 @@ if (n == PUGHInterp_verbose_debug_n)
}
#endif /* PUGHINTERP_VERBOSE_DEBUG */
+#if 0
/* check bounds */
if (out_of_bounds)
{
@@ -447,6 +455,7 @@ if (n == PUGHInterp_verbose_debug_n)
continue;
}
+#endif
/*
* *** compute the interpolation coefficients according to the order ***