diff options
author | Erik Schnetter <schnetter@aei.mpg.de> | 2005-01-01 18:22:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@aei.mpg.de> | 2005-01-01 18:22:00 +0000 |
commit | 2a38d7eb6a6db8b150a9f6fd5f1c844b8d0ef74a (patch) | |
tree | 1c5e763b0ffee9744ee708d6016bdbd36b8f8312 /Carpet/CarpetRegrid | |
parent | 049cec8e042a508511fdb0f0948de63f84f9b8be (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/CarpetRegrid')
-rw-r--r-- | Carpet/CarpetRegrid/interface.ccl | 6 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/automatic.cc | 26 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/baselevel.cc | 8 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/centre.cc | 12 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/manualcoordinatelist.cc | 12 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/manualcoordinates.cc | 18 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/manualgridpointlist.cc | 12 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/manualgridpoints.cc | 14 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/moving.cc | 12 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/regrid.cc | 8 | ||||
-rw-r--r-- | Carpet/CarpetRegrid/src/regrid.hh | 80 |
11 files changed, 104 insertions, 104 deletions
diff --git a/Carpet/CarpetRegrid/interface.ccl b/Carpet/CarpetRegrid/interface.ccl index 5a7e2c4b6..7c38c0efb 100644 --- a/Carpet/CarpetRegrid/interface.ccl +++ b/Carpet/CarpetRegrid/interface.ccl @@ -52,9 +52,9 @@ USES FUNCTION ConvertFromPhysicalBoundary # The true prototype of the routine below: # int Carpet_Regrid (const cGH * cctkGH, -# gh<dim>::rexts * bbsss, -# gh<dim>::rbnds * obss, -# gh<dim>::rprocs * pss); +# gh::rexts * bbsss, +# gh::rbnds * obss, +# gh::rprocs * pss); CCTK_INT FUNCTION Carpet_Regrid (CCTK_POINTER_TO_CONST IN cctkGH, \ CCTK_POINTER IN bbsss, \ CCTK_POINTER IN obss, \ diff --git a/Carpet/CarpetRegrid/src/automatic.cc b/Carpet/CarpetRegrid/src/automatic.cc index 2ccdc0b3d..2e29195e5 100644 --- a/Carpet/CarpetRegrid/src/automatic.cc +++ b/Carpet/CarpetRegrid/src/automatic.cc @@ -25,10 +25,10 @@ namespace CarpetRegrid { int Automatic (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss) + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss) { DECLARE_CCTK_PARAMETERS; @@ -50,14 +50,14 @@ namespace CarpetRegrid { assert (CCTK_GroupDimI(gi) == dim); assert (arrdata.at(gi).at(Carpet::map).data.at(vi-v1)); - const gf<CCTK_REAL,dim>& errorgf - = (*dynamic_cast<const gf<CCTK_REAL,dim>*> + const gf<CCTK_REAL>& errorgf + = (*dynamic_cast<const gf<CCTK_REAL>*> (arrdata.at(gi).at(Carpet::map).data.at(vi-v1))); assert (! smart_outer_boundaries); vector<ibbox> bbs; - gh<dim>::cbnds obs; + gh::cbnds obs; Automatic_OneLevel (cctkGH, hh, reflevel, min(reflevels+1, maxreflevels), @@ -65,7 +65,7 @@ namespace CarpetRegrid { bbs, obs); // make multiprocessor aware - gh<dim>::cprocs ps; + gh::cprocs ps; SplitRegions (cctkGH, bbs, obs, ps); // make multigrid aware @@ -100,13 +100,13 @@ namespace CarpetRegrid { void Automatic_OneLevel (const cGH * const cctkGH, - const gh<dim> & hh, + const gh & hh, const int rl, const int numrl, const int minwidth, const CCTK_REAL minfraction, const CCTK_REAL maxerror, - const gf<CCTK_REAL,dim> & errorgf, + const gf<CCTK_REAL> & errorgf, vector<ibbox> & bbs, vector<bbvect> & obs) { @@ -123,7 +123,7 @@ namespace CarpetRegrid { const ibbox region = hh.extents().at(rl).at(c).at(ml); assert (! region.empty()); - const data<CCTK_REAL,dim>& errordata = *errorgf(tl,rl,c,ml); + const data<CCTK_REAL>& errordata = *errorgf(tl,rl,c,ml); Automatic_Recursive (cctkGH, hh, minwidth, minfraction, maxerror, errordata, bbl, region); @@ -168,11 +168,11 @@ namespace CarpetRegrid { void Automatic_Recursive (const cGH * const cctkGH, - const gh<dim> & hh, + const gh & hh, const int minwidth, const CCTK_REAL minfraction, const CCTK_REAL maxerror, - const data<CCTK_REAL,dim> & errordata, + const data<CCTK_REAL> & errordata, list<ibbox> & bbl, const ibbox & region) { diff --git a/Carpet/CarpetRegrid/src/baselevel.cc b/Carpet/CarpetRegrid/src/baselevel.cc index 441ba57bc..ce4aee1c2 100644 --- a/Carpet/CarpetRegrid/src/baselevel.cc +++ b/Carpet/CarpetRegrid/src/baselevel.cc @@ -18,10 +18,10 @@ namespace CarpetRegrid { int BaseLevel (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss) + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss) { DECLARE_CCTK_PARAMETERS; diff --git a/Carpet/CarpetRegrid/src/centre.cc b/Carpet/CarpetRegrid/src/centre.cc index 4a560c955..2c5dd6ce0 100644 --- a/Carpet/CarpetRegrid/src/centre.cc +++ b/Carpet/CarpetRegrid/src/centre.cc @@ -18,10 +18,10 @@ namespace CarpetRegrid { int Centre (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss) + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss) { DECLARE_CCTK_PARAMETERS; @@ -67,11 +67,11 @@ namespace CarpetRegrid { bbs.at(0) = bb; bbvect const ob (false); - gh<dim>::cbnds obs (1); + gh::cbnds obs (1); obs.at(0) = ob; // make multiprocessor aware - gh<dim>::cprocs ps; + gh::cprocs ps; SplitRegions (cctkGH, bbs, obs, ps); // make multigrid aware diff --git a/Carpet/CarpetRegrid/src/manualcoordinatelist.cc b/Carpet/CarpetRegrid/src/manualcoordinatelist.cc index d62e2cce3..04dffd5e5 100644 --- a/Carpet/CarpetRegrid/src/manualcoordinatelist.cc +++ b/Carpet/CarpetRegrid/src/manualcoordinatelist.cc @@ -22,10 +22,10 @@ namespace CarpetRegrid { int ManualCoordinateList (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss) + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss) { DECLARE_CCTK_PARAMETERS; int ierr; @@ -143,7 +143,7 @@ namespace CarpetRegrid { for (size_t rl=1; rl<refinement_levels; ++rl) { vector<ibbox> bbs; - gh<dim>::cbnds obs; + gh::cbnds obs; bbs.reserve (newbbss.at(rl-1).size()); obs.reserve (newbbss.at(rl-1).size()); @@ -180,7 +180,7 @@ namespace CarpetRegrid { } // make multiprocessor aware - gh<dim>::cprocs ps; + gh::cprocs ps; SplitRegions (cctkGH, bbs, obs, ps); // make multigrid aware diff --git a/Carpet/CarpetRegrid/src/manualcoordinates.cc b/Carpet/CarpetRegrid/src/manualcoordinates.cc index 4b45687da..cc757fdce 100644 --- a/Carpet/CarpetRegrid/src/manualcoordinates.cc +++ b/Carpet/CarpetRegrid/src/manualcoordinates.cc @@ -20,10 +20,10 @@ namespace CarpetRegrid { int ManualCoordinates (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss) + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss) { DECLARE_CCTK_PARAMETERS; @@ -56,14 +56,14 @@ namespace CarpetRegrid { bbvect const ob (false); vector<ibbox> bbs; - gh<dim>::cbnds obs; + gh::cbnds obs; ManualCoordinates_OneLevel (cctkGH, hh, rl, refinement_levels, lower.at(rl-1), upper.at(rl-1), ob, bbs, obs); // make multiprocessor aware - gh<dim>::cprocs ps; + gh::cprocs ps; SplitRegions (cctkGH, bbs, obs, ps); // make multigrid aware @@ -82,7 +82,7 @@ namespace CarpetRegrid { void ManualCoordinates_OneLevel (const cGH * const cctkGH, - const gh<dim> & hh, + const gh & hh, const int rl, const int numrl, const rvect lower, @@ -102,7 +102,7 @@ namespace CarpetRegrid { - ivect delta2int (const cGH * const cctkGH, const gh<dim>& hh, + ivect delta2int (const cGH * const cctkGH, const gh& hh, const rvect & rpos, const int rl) { rvect global_lower, global_upper; @@ -132,7 +132,7 @@ namespace CarpetRegrid { - ivect pos2int (const cGH* const cctkGH, const gh<dim>& hh, + ivect pos2int (const cGH* const cctkGH, const gh& hh, const rvect & rpos, const int rl) { rvect global_lower, global_upper; diff --git a/Carpet/CarpetRegrid/src/manualgridpointlist.cc b/Carpet/CarpetRegrid/src/manualgridpointlist.cc index feae9544b..c4f534fd1 100644 --- a/Carpet/CarpetRegrid/src/manualgridpointlist.cc +++ b/Carpet/CarpetRegrid/src/manualgridpointlist.cc @@ -22,10 +22,10 @@ namespace CarpetRegrid { int ManualGridpointList (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss) + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss) { DECLARE_CCTK_PARAMETERS; @@ -87,7 +87,7 @@ namespace CarpetRegrid { for (size_t rl=1; rl<refinement_levels; ++rl) { vector<ibbox> bbs; - gh<dim>::cbnds obs; + gh::cbnds obs; bbs.reserve (newbbss.at(rl-1).size()); obs.reserve (newbbss.at(rl-1).size()); @@ -101,7 +101,7 @@ namespace CarpetRegrid { } // make multiprocessor aware - gh<dim>::cprocs ps; + gh::cprocs ps; SplitRegions (cctkGH, bbs, obs, ps); // make multigrid aware diff --git a/Carpet/CarpetRegrid/src/manualgridpoints.cc b/Carpet/CarpetRegrid/src/manualgridpoints.cc index 64692e105..b4cb85a17 100644 --- a/Carpet/CarpetRegrid/src/manualgridpoints.cc +++ b/Carpet/CarpetRegrid/src/manualgridpoints.cc @@ -21,10 +21,10 @@ namespace CarpetRegrid { int ManualGridpoints (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss) + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss) { DECLARE_CCTK_PARAMETERS; @@ -57,14 +57,14 @@ namespace CarpetRegrid { bbvect const ob (false); vector<ibbox> bbs; - gh<dim>::cbnds obs; + gh::cbnds obs; ManualGridpoints_OneLevel (cctkGH, hh, rl,refinement_levels, ilower.at(rl-1), iupper.at(rl-1), ob, bbs, obs); // make multiprocessor aware - gh<dim>::cprocs ps; + gh::cprocs ps; SplitRegions (cctkGH, bbs, obs, ps); // make multigrid aware @@ -83,7 +83,7 @@ namespace CarpetRegrid { void ManualGridpoints_OneLevel (const cGH * const cctkGH, - const gh<dim> & hh, + const gh & hh, const int rl, const int numrl, const ivect ilower, diff --git a/Carpet/CarpetRegrid/src/moving.cc b/Carpet/CarpetRegrid/src/moving.cc index 58a010e8a..0985399d5 100644 --- a/Carpet/CarpetRegrid/src/moving.cc +++ b/Carpet/CarpetRegrid/src/moving.cc @@ -19,10 +19,10 @@ namespace CarpetRegrid { int Moving (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss) + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; @@ -54,13 +54,13 @@ namespace CarpetRegrid { rvect const rub (symmetric.ifthen (rvect(radius), pos + rvect(radius))); vector<ibbox> bbs; - gh<dim>::cbnds obs; + gh::cbnds obs; ManualCoordinates_OneLevel (cctkGH, hh, rl, refinement_levels, rlb, rub, ob, bbs, obs); // make multiprocessor aware - gh<dim>::cprocs ps; + gh::cprocs ps; SplitRegions (cctkGH, bbs, obs, ps); // make multigrid aware diff --git a/Carpet/CarpetRegrid/src/regrid.cc b/Carpet/CarpetRegrid/src/regrid.cc index c51ea97c1..94b281513 100644 --- a/Carpet/CarpetRegrid/src/regrid.cc +++ b/Carpet/CarpetRegrid/src/regrid.cc @@ -28,11 +28,11 @@ namespace CarpetRegrid { const cGH * const cctkGH = (const cGH *) cctkGH_; - gh<dim>::rexts & bbsss = * (gh<dim>::rexts *) bbsss_; - gh<dim>::rbnds & obss = * (gh<dim>::rbnds *) obss_; - gh<dim>::rprocs & pss = * (gh<dim>::rprocs *) pss_; + gh::rexts & bbsss = * (gh::rexts *) bbsss_; + gh::rbnds & obss = * (gh::rbnds *) obss_; + gh::rprocs & pss = * (gh::rprocs *) pss_; - gh<dim> const & hh = *vhh.at(Carpet::map); + gh const & hh = *vhh.at(Carpet::map); assert (is_singlemap_mode()); diff --git a/Carpet/CarpetRegrid/src/regrid.hh b/Carpet/CarpetRegrid/src/regrid.hh index 460290646..fea47e073 100644 --- a/Carpet/CarpetRegrid/src/regrid.hh +++ b/Carpet/CarpetRegrid/src/regrid.hh @@ -43,25 +43,25 @@ namespace CarpetRegrid { int BaseLevel (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss); + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss); int Centre (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss); + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss); int ManualGridpoints (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss); + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss); void ManualGridpoints_OneLevel (const cGH * const cctkGH, - const gh<dim> & hh, + const gh & hh, const int rl, const int numrl, const ivect ilower, @@ -71,13 +71,13 @@ namespace CarpetRegrid { vector<bbvect> & obs); int ManualCoordinates (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss); + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss); void ManualCoordinates_OneLevel (const cGH * const cctkGH, - const gh<dim> & hh, + const gh & hh, const int rl, const int numrl, const rvect lower, @@ -87,55 +87,55 @@ namespace CarpetRegrid { vector<bbvect> & obs); ivect delta2int (const cGH * const cctkGH, - const gh<dim>& hh, + const gh& hh, const rvect & rpos, const int rl); ivect pos2int (const cGH* const cctkGH, - const gh<dim>& hh, + const gh& hh, const rvect & rpos, const int rl); int ManualGridpointList (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss); + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss); int ManualCoordinateList (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss); + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss); int Moving (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss); + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss); int Automatic (cGH const * const cctkGH, - gh<dim> const & hh, - gh<dim>::rexts & bbsss, - gh<dim>::rbnds & obss, - gh<dim>::rprocs & pss); + gh const & hh, + gh::rexts & bbsss, + gh::rbnds & obss, + gh::rprocs & pss); void Automatic_OneLevel (const cGH * const cctkGH, - const gh<dim> & hh, + const gh & hh, const int rl, const int numrl, const int minwidth, const CCTK_REAL minfraction, const CCTK_REAL maxerror, - const gf<CCTK_REAL,dim> & errorvar, + const gf<CCTK_REAL> & errorvar, vector<ibbox> & bbs, vector<bbvect> & obs); void Automatic_Recursive (const cGH * const cctkGH, - const gh<dim> & hh, + const gh & hh, const int minwidth, const CCTK_REAL minfraction, const CCTK_REAL maxerror, - const data<CCTK_REAL,dim> & errorvar, + const data<CCTK_REAL> & errorvar, list<ibbox> & bbl, const ibbox & region); |