aboutsummaryrefslogtreecommitdiff
path: root/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h')
-rw-r--r--src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h b/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h
index 24be556..d2990df 100644
--- a/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h
+++ b/src/GeneralizedPolynomial-Uniform/InterpLocalUniform.h
@@ -20,16 +20,16 @@ typedef int bool;
/******************************************************************************/
/* number of integers in the range [x,y] inclusive */
-#define how_many_in_range(x,y) ((y) - (x) + 1)
+#define HOW_MANY_IN_RANGE(x,y) ((y) - (x) + 1)
/* is the integer x even/odd? */
-#define is_even(x) (((x) & 0x1) == 0)
-#define is_odd (x) (((x) & 0x1) != 0)
+#define IS_EVEN(x) (((x) & 0x1) == 0)
+#define IS_ODD (x) (((x) & 0x1) != 0)
/* round floating-point value to nearest integer */
/* ... result is expressed as floating point! */
/* ... needs <math.h> for floor() */
-#define jt_round(x) floor((x) + 0.5)
+#define JT_ROUND(x) floor((x) + 0.5)
/******************************************************************************/
@@ -149,6 +149,25 @@ struct Jacobian_info
CCTK_INT Jacobian_part_stride;
};
+/**************************************/
+
+/*
+ * 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)
+
+/* x > maximum allowable x in grid */
+#define MOLECULE_POSN_ERROR_X_GT_MAX (INT_MIN + 1)
+
+/* 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)
+
/******************************************************************************/
/*