aboutsummaryrefslogtreecommitdiff
path: root/src/config.hh
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-04-13 12:56:11 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-04-13 12:56:11 +0000
commitb99d0f7d3d2bce81d366425c05655a4841a5bc7c (patch)
treee767941a0f08ff520b23f94f1ba606a02c79104b /src/config.hh
parent4265da68c76732bd5c15c0c56f41d770a59aaa86 (diff)
move floating-point configuration to new header file src/config.hh
and change everyone else to #include this git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@500 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/config.hh')
-rw-r--r--src/config.hh33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/config.hh b/src/config.hh
new file mode 100644
index 0000000..efe7e4b
--- /dev/null
+++ b/src/config.hh
@@ -0,0 +1,33 @@
+// config.hh -- compile-time configuration for AHFinderDirect
+// $Id$
+
+#ifdef CCTK_VARIABLE_REAL
+ // CCTK_REAL is defined
+ typedef CCTK_REAL fp;
+#else
+ // we must be doing a test compilation outside of Cactus
+ // FIXME: this is just a hack until my Cactus problem report #725
+ // is acted on and Cactus defines these
+ #define CCTK_REAL_CTYPE_FLOAT 4
+ #define CCTK_REAL_CTYPE_DOUBLE 8
+ #define CCTK_REAL_CTYPE_LONG_DOUBLE 16
+
+ typedef double fp;
+ #define CCTK_REAL_CTYPE CCTK_REAL_CTYPE_DOUBLE
+#endif
+
+// scanf(3) formats for reading fp values
+#if (CCTK_REAL_CTYPE == CCTK_REAL_CTYPE_FLOAT)
+ #define FP_SCANF_FORMAT "%f"
+#elif (CCTK_REAL_CTYPE == CCTK_REAL_CTYPE_DOUBLE)
+ #define FP_SCANF_FORMAT "%lf"
+#else
+ #error "don't know scanf(3) format for this CCTK_REAL!"
+#endif
+
+// FIXME: another hack
+#ifdef FINITE_DIFF_ORDER
+ // someone (probably a Makefile) has already defined this ==> leave it alone
+#else
+ #define FINITE_DIFF_ORDER 4
+#endif