From 1bbb51e1eb07986f2eb6fad44ada52a4151c1201 Mon Sep 17 00:00:00 2001 From: tradke Date: Fri, 1 Aug 2003 16:18:29 +0000 Subject: Return the (negative) total number of out-of-bounds interpolation points as the status code of CCTK_InterpLocal(). git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/LocalInterp/trunk@171 df1f8a13-aa1d-4dd4-9681-27ded5b42416 --- src/Interpolate.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/Interpolate.c') 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; } -- cgit v1.2.3