diff options
Diffstat (limited to 'src/Interpolate.c')
-rw-r--r-- | src/Interpolate.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Interpolate.c b/src/Interpolate.c index e5c3685..9bf6267 100644 --- a/src/Interpolate.c +++ b/src/Interpolate.c @@ -266,7 +266,8 @@ CCTK_FILEVERSION(CactusBase_LocalInterp_Interpolate_c) @returntype int @returndesc 0 - successful interpolation - -1 - in case of any errors + negative in case of any errors (eg. the negative total number + of out-of-bounds interpolation points) @endreturndesc @@*/ int LocalInterp_Interpolate (int order, @@ -358,7 +359,7 @@ int LocalInterp_Interpolate (int order, memset (point, 0, sizeof (point)); /* loop over all points to interpolate at */ - for (n = 0; n < num_points; n++) + for (n = retval = 0; n < num_points; n++) { /* reset the out-of-bounds flag */ out_of_bounds = 0; @@ -462,6 +463,10 @@ if (n == LocalInterp_verbose_debug_n) CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, "Internal error: %d dimensions aren't supported", num_dims); } + + /* the negative total number of out-of-bounds points will be returned */ + retval--; + continue; } |