diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-07-15 12:35:05 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-07-15 12:35:05 -0500 |
commit | 233bd6eaf47ceec23b66417ea681f30fb7c6af0e (patch) | |
tree | 0ee3e5ce21b6c22ec47425da46c9080c0377f67f /Carpet/Carpet/src/Restrict.cc | |
parent | 0b4edd1b5724db036f7fd10d880df2dc1ceb07bd (diff) |
Carpet: Small clean-up to handling time fuzz
Small clean-up to the code that handles accumulated floating point errors
in the physical time of the refinement levels.
Diffstat (limited to 'Carpet/Carpet/src/Restrict.cc')
-rw-r--r-- | Carpet/Carpet/src/Restrict.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Carpet/Carpet/src/Restrict.cc b/Carpet/Carpet/src/Restrict.cc index fbe9f59af..0c66308a8 100644 --- a/Carpet/Carpet/src/Restrict.cc +++ b/Carpet/Carpet/src/Restrict.cc @@ -76,7 +76,9 @@ namespace Carpet { const CCTK_REAL time1 = vtt.at(m)->time (0, reflevel, mglevel); const CCTK_REAL time2 = (cgh->cctk_time - cctk_initial_time) / delta_time; - assert (abs(time1 - time2) / (abs(time1) + abs(time2) + abs(cgh->cctk_delta_time)) < 1e-12); + const CCTK_REAL eps = 1.0e-12; + assert (abs(time1 - time2) <= + eps * (abs(time1) + abs(time2) + abs(cgh->cctk_delta_time))); for (int v = 0; v < (int)arrdata.at(group).at(m).data.size(); ++v) { ggf *const gv = arrdata.at(group).at(m).data.at(v); |