diff options
author | schnetter <> | 2002-09-25 13:49:00 +0000 |
---|---|---|
committer | schnetter <> | 2002-09-25 13:49:00 +0000 |
commit | 2fa5508433b6112d92820d72b60eac704eb829fd (patch) | |
tree | 97ad3e4d47a332592047641058e1b86f8a921391 /Carpet/CarpetLib/src/th.cc | |
parent | b0fafc198e4a2ca84d29d2f8817726f73a4c6779 (diff) |
Changed the variable types for the time from int to real. This allows
Changed the variable types for the time from int to real. This allows
more flexibility for time interpolation.
The time interpolators now accept an explicit argument for the current
time, instead of using the current time from the time hierarchy. This
allows arbitrary current times, which are necessary for the
intermediate time steps for time interpolators. The times that are
interpolated _from_ still come from the time hierarchy.
darcs-hash:20020925134915-07bb3-26927a425ca5c0b52a2ca02bc54673c4b9e1781e.gz
Diffstat (limited to 'Carpet/CarpetLib/src/th.cc')
-rw-r--r-- | Carpet/CarpetLib/src/th.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Carpet/CarpetLib/src/th.cc b/Carpet/CarpetLib/src/th.cc index 7d22c8829..7dc292585 100644 --- a/Carpet/CarpetLib/src/th.cc +++ b/Carpet/CarpetLib/src/th.cc @@ -6,7 +6,7 @@ copyright : (C) 2000 by Erik Schnetter email : schnetter@astro.psu.edu - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/th.cc,v 1.7 2002/05/05 22:17:03 schnetter Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/th.cc,v 1.8 2002/09/25 15:49:17 schnetter Exp $ ***************************************************************************/ @@ -20,9 +20,12 @@ ***************************************************************************/ #include <assert.h> +#include <math.h> #include <iostream> +#include "cctk.h" + #include "defs.hh" #include "dggh.hh" @@ -33,7 +36,7 @@ using namespace std; // Constructors -th::th (dimgeneric_gh* h, const int basedelta) +th::th (dimgeneric_gh* h, const CCTK_REAL basedelta) : h(h), delta(basedelta) { h->add(this); } @@ -49,7 +52,7 @@ void th::recompose () { deltas.resize(h->reflevels()); for (int rl=0; rl<h->reflevels(); ++rl) { const int old_mglevels = times[rl].size(); - int mgtime; + CCTK_REAL mgtime; // Select default time if (old_mglevels==0 && rl==0) { mgtime = 0; @@ -64,7 +67,8 @@ void th::recompose () { if (rl==0 && ml==0) { deltas[rl][ml] = delta; } else if (ml==0) { - assert (deltas[rl-1][ml] % h->reffact == 0); +// assert (deltas[rl-1][ml] % h->reffact == 0); + assert (fabs(fmod(deltas[rl-1][ml], h->reffact)) < 1e-10); deltas[rl][ml] = deltas[rl-1][ml] / h->reffact; } else { deltas[rl][ml] = deltas[rl][ml-1] * h->mgfact; |