aboutsummaryrefslogtreecommitdiff
path: root/src/molecule_posn.c
diff options
context:
space:
mode:
authorjthorn <jthorn@0f49ee68-0e4f-0410-9b9c-b2c123ded7ef>2006-08-31 10:29:10 +0000
committerjthorn <jthorn@0f49ee68-0e4f-0410-9b9c-b2c123ded7ef>2006-08-31 10:29:10 +0000
commitb5dd1cb0a2ed48bad1927428a7b43e7750b627e9 (patch)
treeea722520c0ef34e2405bc5b747dee2e76990c502 /src/molecule_posn.c
parent0dcdb06d4a61d4d877db975bf969f031616472d9 (diff)
Change the local interpolator to return the new error code
CCTK_ERROR_INTERP_DELTA_X_ZERO if the grid spacing is zero along one or more axes; previously it would return the generic "I got a NaN/infinity or other non-finite value" error code CCTK_ERROR_INTERP_COORD_NAN for this case. *** IMPORTANT *** This change requires a cvs-update of the Cactus flesh (more accurately, the file src/include/cctk_Interp.h in the flesh ) in order to define the new error code. If you don't do this cvs update, AEILocalInterp won't compile. git-svn-id: http://svn.aei.mpg.de/numrel/AEIThorns/AEILocalInterp/trunk@42 0f49ee68-0e4f-0410-9b9c-b2c123ded7ef
Diffstat (limited to 'src/molecule_posn.c')
-rw-r--r--src/molecule_posn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/molecule_posn.c b/src/molecule_posn.c
index 5343795..553a176 100644
--- a/src/molecule_posn.c
+++ b/src/molecule_posn.c
@@ -175,6 +175,8 @@ static const char *rcsid = "$Header$";
if the grid is smaller than the molecule
MOLECULE_POSN_ERROR_NAN
if we encounter a NaN or other non-finite floating-point value
+ MOLECULE_POSN_ERROR_DX_ZERO
+ if grid_delta == 0.0
@endreturndesc
@@*/
int AEILocalInterp_molecule_posn(fp grid_origin, fp grid_delta,
@@ -234,9 +236,9 @@ if ( !finite(boundary_off_centering_tolerance_min)
|| !finite(boundary_extrapolation_tolerance_max) )
then return MOLECULE_POSN_ERROR_NAN;
-/* ditto if the grid spacing is zero (we'll need to divide by it)! */
+/* is the grid spacing zero (we'll need to divide by it)? */
if (grid_delta == 0.0)
- then return MOLECULE_POSN_ERROR_NAN;
+ then return MOLECULE_POSN_ERROR_DX_ZERO;
/* molecule radia (inherently positive) in +/- directions */