aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2012-02-05 21:57:12 -0500
committerErik Schnetter <schnetter@cct.lsu.edu>2012-02-05 21:57:12 -0500
commit85fb011585f4cf62689579fd0b275bec468db681 (patch)
treeca973813be4ea20ac177f40b91aa132faed92321 /Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
parentb359f16e96b3aa6b984037e778bce128b66adaf1 (diff)
CarpetLib: Allow larger errors in single precision
Allow larger prolongation errors in single precision.
Diffstat (limited to 'Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc')
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
index f3d717d77..7ddecd992 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
@@ -94,21 +94,24 @@ namespace CarpetLib {
if (tested) return;
tested = true;
- static_assert (ncoeffs == sizeof coeffs_t::coeffs / sizeof *coeffs_t::coeffs,
- "coefficient array has wrong size");
+ static_assert
+ (ncoeffs == sizeof coeffs_t::coeffs / sizeof *coeffs_t::coeffs,
+ "coefficient array has wrong size");
// Test all orders
bool error = false;
for (int n=0; n<=ORDER; ++n) {
RT res = RT(0.0);
for (ptrdiff_t i=imin; i<imax; ++i) {
- RT const x = RT(CCTK_REAL(i) + 0.5);
+ RT const x = RT(i) + RT(0.5);
RT const y = ipow (x, n);
res += get(i) * y;
}
RT const x0 = RT(0.25) + di * RT(0.5);
RT const y0 = ipow (x0, n);
- if (not (good::abs (res - y0) < 1.0e-12)) {
+ // Allow losing 3 digits:
+ CCTK_REAL const eps = RT(1.0e+3) * numeric_limits<RT>::epsilon();
+ if (not (good::abs (res - y0) < eps)) {
RT rt;
ostringstream buf;
buf << "Error in prolongate_3d_cc_rf2::coeffs_3d_cc_rf2\n"