#include #include #include #include #include "cctk.h" #include "defs.hh" #include "gh.hh" #include "th.hh" using namespace std; list th::allth; // Constructors th::th (gh& h_, const vector & reffacts_, const CCTK_REAL basedelta) : h(h_), reffacts(reffacts_), delta(basedelta) { assert (reffacts.size() >= 1); assert (reffacts.front() == 1); for (size_t n = 1; n < reffacts.size(); ++ n) { assert (reffacts.AT(n) >= reffacts.AT(n-1)); assert (reffacts.AT(n) % reffacts.AT(n-1) == 0); } allthi = allth.insert(allth.end(), this); gh_handle = h.add(this); } // Destructors th::~th () { h.erase(gh_handle); allth.erase(allthi); } // Modifiers void th::regrid () { const int old_mglevels = times.size(); times.resize(h.mglevels()); deltas.resize(h.mglevels()); for (int ml=0; ml::const_iterator thi = allth.begin(); thi != allth.end(); ++ thi) { mem += memoryof(**thi); } return mem; } // Output void th::output (ostream& os) const { os << "th:" << "times={"; const char * sep = ""; for (int ml=0; ml