aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/gdata.hh
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-01-01 18:22:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-01-01 18:22:00 +0000
commit2a38d7eb6a6db8b150a9f6fd5f1c844b8d0ef74a (patch)
tree1c5e763b0ffee9744ee708d6016bdbd36b8f8312 /Carpet/CarpetLib/src/gdata.hh
parent049cec8e042a508511fdb0f0948de63f84f9b8be (diff)
global: Turn CarpetLib templates into classes
Turn most of the templates in CarpetLib, which used to have the form template<int D> class XXX into classes, i.e., into something like class XXX by setting D to the new global integer constant dim, which in turn is set to 3. The templates gf and data, which used to be of the form template<typename T, int D> class XXX are now of the form template<typename T> class XXX The templates vect, bbox, and bboxset remain templates. This change simplifies the code somewhat. darcs-hash:20050101182234-891bb-c3063528841f0d078b12cc506309ea27d8ce730d.gz
Diffstat (limited to 'Carpet/CarpetLib/src/gdata.hh')
-rw-r--r--Carpet/CarpetLib/src/gdata.hh37
1 files changed, 15 insertions, 22 deletions
diff --git a/Carpet/CarpetLib/src/gdata.hh b/Carpet/CarpetLib/src/gdata.hh
index 9d08a5b63..37343b18b 100644
--- a/Carpet/CarpetLib/src/gdata.hh
+++ b/Carpet/CarpetLib/src/gdata.hh
@@ -21,7 +21,6 @@ using namespace std;
-template<int D>
class gdata;
@@ -29,7 +28,6 @@ class gdata;
// State information for communications
enum astate { state_recv, state_send, state_wait, state_done };
-template<int D>
struct comm_state {
astate thestate;
comm_state ();
@@ -43,20 +41,15 @@ private:
comm_state& operator= (comm_state const &);
public:
- queue<gdata<D>*> tmps1, tmps2;
+ queue<gdata*> tmps1, tmps2;
vector<MPI_Request> requests; // for use_waitall
};
// A generic data storage without type information
-template<int D>
class gdata {
- // Types
- typedef vect<int,D> ivect;
- typedef bbox<int,D> ibbox;
-
protected: // should be readonly
// Fields
@@ -90,7 +83,7 @@ public:
virtual ~gdata ();
// Pseudo constructors
- virtual gdata<D>*
+ virtual gdata*
make_typed (const int varindex,
const operator_type transport_operator = op_error) const = 0;
@@ -98,26 +91,26 @@ public:
gdata & operator= (gdata const & from);
// Processor management
- void change_processor (comm_state<D>& state,
+ void change_processor (comm_state& state,
const int newproc,
void* const mem=0);
protected:
- virtual void change_processor_recv (comm_state<D>& state,
+ virtual void change_processor_recv (comm_state& state,
const int newproc,
void* const mem=0)
= 0;
- virtual void change_processor_send (comm_state<D>& state,
+ virtual void change_processor_send (comm_state& state,
const int newproc,
void* const mem=0)
= 0;
- virtual void change_processor_wait (comm_state<D>& state,
+ virtual void change_processor_wait (comm_state& state,
const int newproc,
void* const mem=0)
= 0;
public:
// Storage management
- virtual void transfer_from (gdata<D>* src) = 0;
+ virtual void transfer_from (gdata* src) = 0;
virtual void allocate (const ibbox& extent, const int proc,
void* const mem=0) = 0;
@@ -173,18 +166,18 @@ public:
// Data manipulators
public:
- void copy_from (comm_state<D>& state,
+ void copy_from (comm_state& state,
const gdata* src, const ibbox& box);
private:
void copy_from_nocomm (const gdata* src, const ibbox& box);
- void copy_from_recv (comm_state<D>& state,
+ void copy_from_recv (comm_state& state,
const gdata* src, const ibbox& box);
- void copy_from_send (comm_state<D>& state,
+ void copy_from_send (comm_state& state,
const gdata* src, const ibbox& box);
- void copy_from_wait (comm_state<D>& state,
+ void copy_from_wait (comm_state& state,
const gdata* src, const ibbox& box);
public:
- void interpolate_from (comm_state<D>& state,
+ void interpolate_from (comm_state& state,
const vector<const gdata*> srcs,
const vector<CCTK_REAL> times,
const ibbox& box, const CCTK_REAL time,
@@ -196,19 +189,19 @@ public:
const ibbox& box, const CCTK_REAL time,
const int order_space,
const int order_time);
- void interpolate_from_recv (comm_state<D>& state,
+ void interpolate_from_recv (comm_state& state,
const vector<const gdata*> srcs,
const vector<CCTK_REAL> times,
const ibbox& box, const CCTK_REAL time,
const int order_space,
const int order_time);
- void interpolate_from_send (comm_state<D>& state,
+ void interpolate_from_send (comm_state& state,
const vector<const gdata*> srcs,
const vector<CCTK_REAL> times,
const ibbox& box, const CCTK_REAL time,
const int order_space,
const int order_time);
- void interpolate_from_wait (comm_state<D>& state,
+ void interpolate_from_wait (comm_state& state,
const vector<const gdata*> srcs,
const vector<CCTK_REAL> times,
const ibbox& box, const CCTK_REAL time,