aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/gf.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-02-01 22:58:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-02-01 22:58:00 +0000
commit0914bc88c7aea61eedf470a903c8fa252bdc97dd (patch)
treec11153db9c2272c28d1861a42e543942c49a7dd1 /Carpet/CarpetLib/src/gf.cc
parentf9fe6d4b5a573027170f45784dae4b094160c546 (diff)
global: Change the way in which the grid hierarchy is stored
Change the way in which the grid hierarchy is stored. The new hierarchy is map mglevel reflevel component timelevel i.e., mglevel moved from the bottom to almost the top. This is because mglevel used to be a true multigrid level, but is now meant to be a convergence level. Do not allocate all storage all the time. Allow storage to be switched on an off per refinement level (and for a single mglevel, which prompted the change above). Handle storage management with CCTK_{In,De}creaseGroupStorage instead of CCTK_{En,Dis}ableGroupStorage. darcs-hash:20050201225827-891bb-eae3b6bd092ae8d6b5e49be84c6f09f0e882933e.gz
Diffstat (limited to 'Carpet/CarpetLib/src/gf.cc')
-rw-r--r--Carpet/CarpetLib/src/gf.cc31
1 files changed, 16 insertions, 15 deletions
diff --git a/Carpet/CarpetLib/src/gf.cc b/Carpet/CarpetLib/src/gf.cc
index e493f9491..e3fde8dd0 100644
--- a/Carpet/CarpetLib/src/gf.cc
+++ b/Carpet/CarpetLib/src/gf.cc
@@ -14,12 +14,11 @@ using namespace std;
template<typename T>
gf<T>::gf (const int varindex_, const operator_type transport_operator_,
th& t_, dh& d_,
- const int tmin_, const int tmax_,
const int prolongation_order_time_,
const int vectorlength_, const int vectorindex_,
gf* const vectorleader_)
: ggf(varindex_, transport_operator_,
- t_, d_, tmin_, tmax_, prolongation_order_time_,
+ t_, d_, prolongation_order_time_,
vectorlength_, vectorindex_, vectorleader_)
{
// recompose ();
@@ -51,21 +50,23 @@ gf<T>::~gf () { }
// Access to the data
template<typename T>
-const data<T>* gf<T>::operator() (int tl, int rl, int c, int ml) const {
- assert (tl>=tmin && tl<=tmax);
- assert (rl>=0 && rl<h.reflevels());
- assert (c>=0 && c<h.components(rl));
- assert (ml>=0 && ml<h.mglevels(rl,c));
- return (const data<T>*)storage.at(tl-tmin).at(rl).at(c).at(ml);
+const data<T>* gf<T>::operator() (int tl, int rl, int c, int ml) const
+{
+ assert (tl>=0 and tl<timelevels());
+ assert (rl>=0 and rl<h.reflevels());
+ assert (c>=0 and c<h.components(rl));
+ assert (ml>=0 and ml<h.mglevels());
+ return (const data<T>*)storage.at(ml).at(rl).at(c).at(tl);
}
template<typename T>
-data<T>* gf<T>::operator() (int tl, int rl, int c, int ml) {
- assert (tl>=tmin && tl<=tmax);
- assert (rl>=0 && rl<h.reflevels());
- assert (c>=0 && c<h.components(rl));
- assert (ml>=0 && ml<h.mglevels(rl,c));
- return (data<T>*)storage.at(tl-tmin).at(rl).at(c).at(ml);
+data<T>* gf<T>::operator() (int tl, int rl, int c, int ml)
+{
+ assert (tl>=0 and tl<timelevels());
+ assert (rl>=0 and rl<h.reflevels());
+ assert (c>=0 and c<h.components(rl));
+ assert (ml>=0 and ml<h.mglevels());
+ return (data<T>*)storage.at(ml).at(rl).at(c).at(tl);
}
@@ -76,7 +77,7 @@ ostream& gf<T>::output (ostream& os) const {
T Tdummy;
os << "gf<" << typestring(Tdummy) << ">:"
<< varindex << "[" << CCTK_VarName(varindex) << "],"
- << "dt=[" << tmin << ":" << tmax<< "]";
+ << "tls=" << timelevels();
return os;
}