diff options
Diffstat (limited to 'src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h')
-rw-r--r-- | src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h b/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h index d2990df..851378a 100644 --- a/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h +++ b/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h @@ -70,11 +70,17 @@ typedef int bool; */ #define MAX_N_DIMS 3 +/* a "boundary" is the combination of a dimension and a min/max "side" */ +#define MAX_N_BOUNDARIES (2*MAX_N_DIMS) + /* * if molecule_family_string is a C string specifying a molecule family * (i.e. value associated with the "molecule_family" key in the parameter * table), we must have * strlen(molecule_family_string) <= MAX_MOLECULE_FAMILY_STRLEN + * n.b. exceeding this won't cause a buffer overflow, it will "just" + * cause the string to be truncated (and probably not recognized + * by the interpolator) */ #define MAX_MOLECULE_FAMILY_STRLEN 20 @@ -103,12 +109,15 @@ enum molecule_family * other compile-time settings */ -/* default for each element of out_of_range_tolerance[] */ -/* FIXME: this is based on C "double", which may not match CCTK_REAL */ -#define OUT_OF_RANGE_TOLERANCE_DEFAULT (10000.0*DBL_EPSILON) +/* default for each element of boundary_off_centering_tolerance[] */ +#define BOUNDARY_OFF_CENTER_TOL_DEFAULT 999.0 + +/* default for each element of boundary_extrapolation_tolerance[] */ +#define BOUNDARY_EXTRAP_TOL_DEFAULT 1.0e-10 -/* CCTK_VWarn() severity level for error messages */ -#define ERROR_MSG_SEVERITY_LEVEL 1 +/* CCTK_VWarn() severity level for error/warning messages */ +#define ERROR_MSG_SEVERITY_LEVEL 0 +#define WARNING_MSG_SEVERITY_LEVEL 1 /******************************************************************************/ @@ -122,6 +131,7 @@ enum molecule_family struct error_flags { int error_pt; + int error_ibndry; int error_axis; int error_end; }; @@ -153,20 +163,16 @@ struct Jacobian_info /* * error codes for LocalInterp_molecule_posn() - * ... these are defined in terms of INT_MIN from <limits.h> */ /* x < minimum allowable x in grid */ -#define MOLECULE_POSN_ERROR_X_LT_MIN (INT_MIN + 0) +#define MOLECULE_POSN_ERROR_X_LT_MIN (-1) /* x > maximum allowable x in grid */ -#define MOLECULE_POSN_ERROR_X_GT_MAX (INT_MIN + 1) +#define MOLECULE_POSN_ERROR_X_GT_MAX (-2) /* grid is smaller than molecule */ -#define MOLECULE_POSN_ERROR_GRID_TINY (INT_MIN + 2) - -/* is a given integer an error code? */ -#define IS_MOLECULE_POSN_ERROR_CODE(x) (x <= MOLECULE_POSN_ERROR_GRID_TINY) +#define MOLECULE_POSN_ERROR_GRID_TINY (-3) /******************************************************************************/ @@ -216,11 +222,12 @@ int LocalInterp_ILU_Hermite(int N_dims, int LocalInterp_molecule_posn(fp grid_origin, fp grid_delta, int grid_i_min, int grid_i_max, int molecule_size, - fp out_of_range_tolerance_min, - fp out_of_range_tolerance_max, + fp boundary_off_centering_tolerance_min, + fp boundary_off_centering_tolerance_max, + fp boundary_extrapolation_tolerance_min, + fp boundary_extrapolation_tolerance_max, fp x, - fp *x_rel, - int *molecule_m_min, int *molecule_m_max); + int* i_center, fp* x_rel); /* functions in util.c */ void LocalInterp_zero_int_array(int N, CCTK_INT array[]); |