aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/data.hh
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2007-01-12 20:58:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2007-01-12 20:58:00 +0000
commitc23315efb5b4fea80c92f747173e47a7d29d644d (patch)
treed56de98cca60845ae083fe3d397843dda6102160 /Carpet/CarpetLib/src/data.hh
parent3c4993dd3e36426d62cbf8e574cba9ec6cf2ec89 (diff)
CarpetLib: Reorganise prolongation and restriction operators
Reorganise prolongation and restriction operators. This is a major implementation change. Most operators are now written as C++ templates instead of as Fortran 77 code. This simplifies the code, since C++ routines can be called more easily, and they also have access to CarpetLib's high-level data structures. Previously, the operators combined temporal and spatial interpolation. Now, time interpolation and space interpolation are handled separately. This may be less efficient, but simplifies the code significantly, since there are now N+M instead of N*M routines, for N time interpolation and M space interpolation methods. Remove the minmod prolongation operator, which was previously disabled. Add support for cell centering, using a method described by Simon Hern, and suggested for Carpet by Ian Hawke. darcs-hash:20070112205812-dae7b-5329795aa698e7bbc3671b1504134885dd830238.gz
Diffstat (limited to 'Carpet/CarpetLib/src/data.hh')
-rw-r--r--Carpet/CarpetLib/src/data.hh61
1 files changed, 30 insertions, 31 deletions
diff --git a/Carpet/CarpetLib/src/data.hh b/Carpet/CarpetLib/src/data.hh
index c1c1934be..415345c06 100644
--- a/Carpet/CarpetLib/src/data.hh
+++ b/Carpet/CarpetLib/src/data.hh
@@ -45,11 +45,13 @@ public:
// Constructors
data (const int varindex = -1,
+ const centering cent = error_centered,
const operator_type transport_operator = op_error,
const int vectorlength = 1, const int vectorindex = 0,
data* const vectorleader = NULL,
const int tag = -1);
- data (const int varindex, const operator_type transport_operator,
+ data (const int varindex,
+ const centering cent, const operator_type transport_operator,
const int vectorlength, const int vectorindex,
data* const vectorleader,
const ibbox& extent, const int proc);
@@ -59,6 +61,7 @@ public:
// Pseudo constructors
virtual data* make_typed (const int varindex,
+ const centering cent,
const operator_type transport_operator,
const int tag) const;
@@ -147,47 +150,43 @@ private:
public:
void copy_from_innerloop (const gdata* gsrc,
const ibbox& box);
- void interpolate_from_innerloop (const vector<const gdata*> gsrcs,
- const vector<CCTK_REAL> times,
+ void interpolate_from_innerloop (const vector<const gdata*>& gsrcs,
+ const vector<CCTK_REAL>& times,
const ibbox& box, const CCTK_REAL time,
const int order_space,
const int order_time);
+private:
+ void interpolate_time (vector <data const *> const & srcs,
+ vector <CCTK_REAL> const & times,
+ ibbox const & box,
+ CCTK_REAL const time,
+ int const order_space,
+ int const order_time);
+ void interpolate_p_r (data const * const src,
+ ibbox const & box,
+ int const order_space);
+ void interpolate_p_vc_cc (data const * const src,
+ ibbox const & box,
+ int const order_space);
+ void interpolate_prolongate (data const * src,
+ ibbox const & box,
+ int order_space);
+ void interpolate_restrict (data const * src,
+ ibbox const & box,
+ int order_space);
+ void time_interpolate (vector <data *> const & srcs,
+ ibbox const & box,
+ vector <CCTK_REAL> const & times,
+ CCTK_REAL time,
+ int order_time);
public:
// Output
ostream& output (ostream& os) const;
-private:
- bool try_without_time_interpolation (const vector<const gdata*> & gsrcs,
- const vector<CCTK_REAL> & times,
- const ibbox& box, const CCTK_REAL time,
- const int order_space,
- const int order_time);
- void interpolate_restrict (const vector<const data<T>*> & gsrcs,
- const vector<CCTK_REAL> & times,
- const ibbox& box);
- void interpolate_prolongate (const vector<const data<T>*> & gsrcs,
- const vector<CCTK_REAL> & times,
- const ibbox& box, const CCTK_REAL time,
- const int order_space,
- const int order_time);
- void Check_that_the_times_are_consistent ( const vector<CCTK_REAL> & times,
- const CCTK_REAL time );
friend ostream & operator << <T> ( ostream & os, const data<T> & d );
};
-
-
-// Declare a specialisation
-template<>
-void data<CCTK_REAL8>
-::interpolate_from_innerloop (const vector<const gdata*> gsrcs,
- const vector<CCTK_REAL> times,
- const ibbox& box, const CCTK_REAL time,
- const int order_space,
- const int order_time);
-
-
#endif // DATA_HH