diff options
author | schnetter <> | 2001-06-12 12:56:00 +0000 |
---|---|---|
committer | schnetter <> | 2001-06-12 12:56:00 +0000 |
commit | 8867059a4180017e191773894b66fc36521168b9 (patch) | |
tree | 27cc2b6bbfdf277b797d883a5770679de6dcff05 /Carpet/CarpetLib/src/th.hh | |
parent | 2de5b11b0a7bfb67d2ac1be8b74edcd024698617 (diff) |
Introduced abstraction classes that have no <dim> parameter. This
Introduced abstraction classes that have no <dim> parameter. This
will make it easier to adapte the driver to support multiple
dimensions at once.
darcs-hash:20010612125655-07bb3-1cba35eb867eca1234b3a40bd7a5641b64776c50.gz
Diffstat (limited to 'Carpet/CarpetLib/src/th.hh')
-rw-r--r-- | Carpet/CarpetLib/src/th.hh | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/Carpet/CarpetLib/src/th.hh b/Carpet/CarpetLib/src/th.hh index 7abb657a5..444b0d1f0 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.3 2001/03/27 22:26:31 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/th.hh,v 1.4 2001/06/12 14:57:00 schnetter Exp $ ***************************************************************************/ @@ -28,29 +28,27 @@ #include <vector> #include "defs.hh" -#include "gh.hh" +#include "dggh.hh" using namespace std; // Forward declaration -template<int D> class th; +class th; // Output -template<int D> -ostream& operator<< (ostream& os, const th<D>& t); +ostream& operator<< (ostream& os, const th& t); // The time hierarchy (information about the current time) -template<int D> class th { public: // should be readonly // Fields - gh<D> &h; // hierarchy + dimgeneric_gh *h; // hierarchy private: @@ -61,7 +59,7 @@ private: public: // Constructors - th (gh<D>& h, const int basedelta); + th (dimgeneric_gh* h, const int basedelta); // Destructors ~th (); @@ -71,14 +69,14 @@ public: // Time management int get_time (const int rl, const int ml) const { - assert (rl>=0 && rl<h.reflevels()); - assert (ml>=0 && ml<h.mglevels(rl,0)); + 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) { - assert (rl>=0 && rl<h.reflevels()); - assert (ml>=0 && ml<h.mglevels(rl,0)); + assert (rl>=0 && rl<h->reflevels()); + assert (ml>=0 && ml<h->mglevels(rl,0)); times[rl][ml] = t; } @@ -87,14 +85,14 @@ public: } int get_delta (const int rl, const int ml) const { - assert (rl>=0 && rl<h.reflevels()); - assert (ml>=0 && ml<h.mglevels(rl,0)); + assert (rl>=0 && rl<h->reflevels()); + assert (ml>=0 && ml<h->mglevels(rl,0)); return deltas[rl][ml]; } int 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)); + assert (rl>=0 && rl<h->reflevels()); + assert (ml>=0 && ml<h->mglevels(rl,0)); return get_time(rl, ml) + tl * get_delta(rl, ml); } @@ -104,8 +102,7 @@ public: -template<int D> -ostream& operator<< (ostream& os, const th<D>& t) { +inline ostream& operator<< (ostream& os, const th& t) { t.output(os); return os; } |