aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/ggf.hh
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2009-09-03 16:19:15 -0500
committerErik Schnetter <schnetter@cct.lsu.edu>2009-09-03 16:19:15 -0500
commita9bd55ce62a101ce9c2c8c40b9fda40ff894a250 (patch)
tree8f91d1fcf23269f6e494aae1ea11398c605eeac9 /Carpet/CarpetLib/src/ggf.hh
parentf20c19981b3e7fbd2413c96b41ec9dc1888f2d79 (diff)
Import Carpet
Ignore-this: 309b4dd613f4af2b84aa5d6743fdb6b3
Diffstat (limited to 'Carpet/CarpetLib/src/ggf.hh')
-rw-r--r--Carpet/CarpetLib/src/ggf.hh22
1 files changed, 13 insertions, 9 deletions
diff --git a/Carpet/CarpetLib/src/ggf.hh b/Carpet/CarpetLib/src/ggf.hh
index b2c86b8db..f89a73ee0 100644
--- a/Carpet/CarpetLib/src/ggf.hh
+++ b/Carpet/CarpetLib/src/ggf.hh
@@ -28,6 +28,9 @@ ostream& operator<< (ostream& os, const ggf& f);
// A generic grid function without type information
class ggf {
+
+ static list<ggf*> allggf;
+ list<ggf*>::iterator allggfi;
// Types
typedef list<ibbox> iblist;
@@ -38,7 +41,7 @@ class ggf {
typedef gdata* tdata; // data ...
typedef vector<tdata> fdata; // ... for each time level
- typedef vector<fdata> cdata; // ... for each component
+ typedef vector<fdata> cdata; // ... for each local component
typedef vector<cdata> rdata; // ... for each refinement level
typedef vector<rdata> mdata; // ... for each multigrid level
@@ -53,6 +56,7 @@ public: // should be readonly
const gh &h; // grid hierarchy
dh &d; // data hierarchy
+ dh::ggf_handle dh_handle;
protected:
vector<vector<int> > timelevels_; // time levels [ml][rl]
@@ -80,10 +84,10 @@ public:
virtual ~ggf ();
// Comparison
- bool operator== (const ggf& f) const;
+ bool operator== (const ggf& f) const CCTK_ATTRIBUTE_PURE;
// Querying
- int timelevels (int const ml, int const rl) const
+ int timelevels (int const ml, int const rl) const CCTK_ATTRIBUTE_PURE
{
return timelevels_.AT(ml).AT(rl);
}
@@ -141,9 +145,7 @@ public:
// Helpers
-protected:
-
- virtual gdata* typed_data (int tl, int rl, int c, int ml) = 0;
+ virtual gdata* typed_data (int tl, int rl, int lc, int ml) const = 0;
@@ -181,13 +183,14 @@ protected:
public:
// Access to the data
- virtual const gdata* operator() (int tl, int rl, int c, int ml) const = 0;
- virtual gdata* operator() (int tl, int rl, int c, int ml) = 0;
+ virtual const gdata* operator() (int tl, int rl, int lc, int ml) const CCTK_ATTRIBUTE_PURE = 0;
+ virtual gdata* operator() (int tl, int rl, int lc, int ml) CCTK_ATTRIBUTE_PURE = 0;
// Output
- virtual size_t memory () const;
+ virtual size_t memory () const CCTK_ATTRIBUTE_PURE = 0;
+ static size_t allmemory () CCTK_ATTRIBUTE_PURE;
virtual ostream& output (ostream& os) const = 0;
private:
@@ -199,6 +202,7 @@ private:
+inline size_t memoryof (ggf const & f) CCTK_ATTRIBUTE_PURE;
inline size_t memoryof (ggf const & f)
{
return f.memory ();