diff options
author | Erik Schnetter <schnetter@aei.mpg.de> | 2005-08-09 08:49:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@aei.mpg.de> | 2005-08-09 08:49:00 +0000 |
commit | c7dc46fa15685b2dbeaf9fe92fb207bb5911d313 (patch) | |
tree | 35e07770a6e6e972605bd7f6326b28d79a610b2f /Carpet/Carpet/src/Restrict.cc | |
parent | 20491415a0f46d48ba0471bf9aeefe59668f59a9 (diff) |
Carpet: Correct problems with negative time steps
When converting from physicsl time steps (delta_time) to Carpet's time
steps (th::delta_time), do not divide by abs(delta_time), but by
delta_time instead.
When evolving backwards in time while initialising three time levels,
change the sign of the physical time steps only, not the sign of
Carpet's time steps.
darcs-hash:20050809084940-891bb-2517b1568696c71278a98db6261515817a90247a.gz
Diffstat (limited to 'Carpet/Carpet/src/Restrict.cc')
-rw-r--r-- | Carpet/Carpet/src/Restrict.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Carpet/Carpet/src/Restrict.cc b/Carpet/Carpet/src/Restrict.cc index 78a3857b1..42d4d8720 100644 --- a/Carpet/Carpet/src/Restrict.cc +++ b/Carpet/Carpet/src/Restrict.cc @@ -92,8 +92,8 @@ namespace Carpet { const CCTK_REAL time1 = vtt.at(m)->time (0, reflevel, mglevel); const CCTK_REAL time2 - = (cgh->cctk_time - cctk_initial_time) / fabs(delta_time); - assert (fabs(time1 - time2) / (fabs(time1) + fabs(time2) + fabs(cgh->cctk_delta_time)) < 1e-12); + = (cgh->cctk_time - cctk_initial_time) / delta_time; + assert (abs(time1 - time2) / (abs(time1) + abs(time2) + abs(cgh->cctk_delta_time)) < 1e-12); for (int v = 0; v < arrdata.at(group).at(m).data.size(); ++v) { ggf *const gv = arrdata.at(group).at(m).data.at(v); |