aboutsummaryrefslogtreecommitdiff
path: root/src/GeneralizedPolynomial-Uniform/template.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/GeneralizedPolynomial-Uniform/template.c')
-rw-r--r--src/GeneralizedPolynomial-Uniform/template.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/GeneralizedPolynomial-Uniform/template.c b/src/GeneralizedPolynomial-Uniform/template.c
index ac1d98e..0bb409b 100644
--- a/src/GeneralizedPolynomial-Uniform/template.c
+++ b/src/GeneralizedPolynomial-Uniform/template.c
@@ -945,37 +945,46 @@ int pt;
/* is the interpolation point out-of-range? */
#if (N_DIMS >= 1)
- if ((center_i == INT_MIN) || (center_i == INT_MAX))
+ if (IS_MOLECULE_POSN_ERROR_CODE(center_i))
then {
+ if (center_i == MOLECULE_POSN_ERROR_GRID_TINY)
+ then return CCTK_ERROR_INTERP_GRID_TOO_TINY;
if (error_flags != NULL)
then {
error_flags->error_pt = pt;
error_flags->error_axis = X_AXIS;
- error_flags->error_end = (center_i > 0) ? +1 : -1;
+ error_flags->error_end
+ = (center_i == MOLECULE_POSN_ERROR_X_GT_MAX) ? +1 : -1;
}
return CCTK_ERROR_INTERP_POINT_X_RANGE; /*** ERROR RETURN ***/
}
#endif
#if (N_DIMS >= 2)
- if ((center_j == INT_MIN) || (center_j == INT_MAX))
+ if (IS_MOLECULE_POSN_ERROR_CODE(center_j))
then {
+ if (center_j == MOLECULE_POSN_ERROR_GRID_TINY)
+ then return CCTK_ERROR_INTERP_GRID_TOO_TINY;
if (error_flags != NULL)
then {
error_flags->error_pt = pt;
error_flags->error_axis = Y_AXIS;
- error_flags->error_end = (center_j > 0) ? +1 : -1;
+ error_flags->error_end
+ = (center_j == MOLECULE_POSN_ERROR_X_GT_MAX) ? +1 : -1;
}
return CCTK_ERROR_INTERP_POINT_X_RANGE; /*** ERROR RETURN ***/
}
#endif
#if (N_DIMS >= 3)
- if ((center_k == INT_MIN) || (center_k == INT_MAX))
+ if (IS_MOLECULE_POSN_ERROR_CODE(center_k))
then {
+ if (center_k == MOLECULE_POSN_ERROR_GRID_TINY)
+ then return CCTK_ERROR_INTERP_GRID_TOO_TINY;
if (error_flags != NULL)
then {
error_flags->error_pt = pt;
error_flags->error_axis = Z_AXIS;
- error_flags->error_end = (center_k > 0) ? +1 : -1;
+ error_flags->error_end
+ = (center_k == MOLECULE_POSN_ERROR_X_GT_MAX) ? +1 : -1;
}
return CCTK_ERROR_INTERP_POINT_X_RANGE; /*** ERROR RETURN ***/
}