diff options
-rw-r--r-- | src/InterpLocalUniform.h | 3 | ||||
-rw-r--r-- | src/molecule_posn.c | 6 | ||||
-rw-r--r-- | src/template.c | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/InterpLocalUniform.h b/src/InterpLocalUniform.h index bb412d0..61a4cf4 100644 --- a/src/InterpLocalUniform.h +++ b/src/InterpLocalUniform.h @@ -178,6 +178,9 @@ struct Jacobian_info /* someone passed us a NaN or other non-finite floating-point number */ #define MOLECULE_POSN_ERROR_NAN (-4) +/* grid spacing $\Delta x$ is zero in at least one axis */ +#define MOLECULE_POSN_ERROR_DX_ZERO (-5) + /******************************************************************************/ /* 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 */ diff --git a/src/template.c b/src/template.c index fcb198b..fe7a267 100644 --- a/src/template.c +++ b/src/template.c @@ -977,6 +977,9 @@ if (debug > 0) case MOLECULE_POSN_ERROR_NAN: this_axis_status = CCTK_ERROR_INTERP_COORD_NAN; break; + case MOLECULE_POSN_ERROR_DX_ZERO: + this_axis_status = CCTK_ERROR_INTERP_DELTA_X_ZERO; + break; default: CCTK_VWarn(BUG_MSG_SEVERITY_LEVEL, __LINE__, __FILE__, CCTK_THORNSTRING, |