aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/th.hh
diff options
context:
space:
mode:
authorschnetter <>2002-09-25 13:49:00 +0000
committerschnetter <>2002-09-25 13:49:00 +0000
commit2fa5508433b6112d92820d72b60eac704eb829fd (patch)
tree97ad3e4d47a332592047641058e1b86f8a921391 /Carpet/CarpetLib/src/th.hh
parentb0fafc198e4a2ca84d29d2f8817726f73a4c6779 (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.hh')
-rw-r--r--Carpet/CarpetLib/src/th.hh22
1 files changed, 12 insertions, 10 deletions
diff --git a/Carpet/CarpetLib/src/th.hh b/Carpet/CarpetLib/src/th.hh
index 0affc5e5f..61d489d6a 100644
--- a/Carpet/CarpetLib/src/th.hh
+++ b/Carpet/CarpetLib/src/th.hh
@@ -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.hh,v 1.7 2002/06/07 20:20:43 schnetter Exp $
+ $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/th.hh,v 1.8 2002/09/25 15:49:17 schnetter Exp $
***************************************************************************/
@@ -27,6 +27,8 @@
#include <iostream>
#include <vector>
+#include "cctk.h"
+
#include "defs.hh"
#include "dggh.hh"
@@ -52,14 +54,14 @@ public: // should be readonly
private:
- int delta; // time step
- vector<vector<int> > times; // current times
- vector<vector<int> > deltas; // time steps
+ CCTK_REAL delta; // time step
+ vector<vector<CCTK_REAL> > times; // current times
+ vector<vector<CCTK_REAL> > deltas; // time steps
public:
// Constructors
- th (dimgeneric_gh* h, const int basedelta);
+ th (dimgeneric_gh* h, const CCTK_REAL basedelta);
// Destructors
~th ();
@@ -68,13 +70,13 @@ public:
void recompose ();
// Time management
- int get_time (const int rl, const int ml) const {
+ CCTK_REAL get_time (const int rl, const int ml) const {
assert (rl>=0 && rl<h->reflevels());
assert (ml>=0 && ml<h->mglevels(rl,0));
return times[rl][ml];
}
- void set_time (const int rl, const int ml, const int t) {
+ void set_time (const int rl, const int ml, const CCTK_REAL t) {
assert (rl>=0 && rl<h->reflevels());
assert (ml>=0 && ml<h->mglevels(rl,0));
times[rl][ml] = t;
@@ -84,19 +86,19 @@ public:
set_time(rl,ml, get_time(rl,ml) + get_delta(rl,ml));
}
- int get_delta (const int rl, const int ml) const {
+ CCTK_REAL get_delta (const int rl, const int ml) const {
assert (rl>=0 && rl<h->reflevels());
assert (ml>=0 && ml<h->mglevels(rl,0));
return deltas[rl][ml];
}
- void set_delta (const int rl, const int ml, const int dt) {
+ void set_delta (const int rl, const int ml, const CCTK_REAL dt) {
assert (rl>=0 && rl<h->reflevels());
assert (ml>=0 && ml<h->mglevels(rl,0));
deltas[rl][ml] = dt;
}
- int time (const int tl, const int rl, const int ml) const {
+ CCTK_REAL time (const int tl, const int rl, const int ml) const {
assert (rl>=0 && rl<h->reflevels());
assert (ml>=0 && ml<h->mglevels(rl,0));
return get_time(rl, ml) + tl * get_delta(rl, ml);