aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetRegrid/src
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-02-01 22:58:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-02-01 22:58:00 +0000
commit0914bc88c7aea61eedf470a903c8fa252bdc97dd (patch)
treec11153db9c2272c28d1861a42e543942c49a7dd1 /Carpet/CarpetRegrid/src
parentf9fe6d4b5a573027170f45784dae4b094160c546 (diff)
global: Change the way in which the grid hierarchy is stored
Change the way in which the grid hierarchy is stored. The new hierarchy is map mglevel reflevel component timelevel i.e., mglevel moved from the bottom to almost the top. This is because mglevel used to be a true multigrid level, but is now meant to be a convergence level. Do not allocate all storage all the time. Allow storage to be switched on an off per refinement level (and for a single mglevel, which prompted the change above). Handle storage management with CCTK_{In,De}creaseGroupStorage instead of CCTK_{En,Dis}ableGroupStorage. darcs-hash:20050201225827-891bb-eae3b6bd092ae8d6b5e49be84c6f09f0e882933e.gz
Diffstat (limited to 'Carpet/CarpetRegrid/src')
-rw-r--r--Carpet/CarpetRegrid/src/automatic.cc22
-rw-r--r--Carpet/CarpetRegrid/src/baselevel.cc2
-rw-r--r--Carpet/CarpetRegrid/src/centre.cc16
-rw-r--r--Carpet/CarpetRegrid/src/manualcoordinatelist.cc14
-rw-r--r--Carpet/CarpetRegrid/src/manualcoordinates.cc16
-rw-r--r--Carpet/CarpetRegrid/src/manualgridpointlist.cc14
-rw-r--r--Carpet/CarpetRegrid/src/manualgridpoints.cc16
-rw-r--r--Carpet/CarpetRegrid/src/moving.cc16
-rw-r--r--Carpet/CarpetRegrid/src/regrid.cc2
-rw-r--r--Carpet/CarpetRegrid/src/regrid.hh18
10 files changed, 67 insertions, 69 deletions
diff --git a/Carpet/CarpetRegrid/src/automatic.cc b/Carpet/CarpetRegrid/src/automatic.cc
index 2e29195e5..abe685d47 100644
--- a/Carpet/CarpetRegrid/src/automatic.cc
+++ b/Carpet/CarpetRegrid/src/automatic.cc
@@ -26,7 +26,7 @@ namespace CarpetRegrid {
int Automatic (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss)
{
@@ -35,6 +35,7 @@ namespace CarpetRegrid {
assert (refinement_levels >= 1);
assert (bbsss.size() >= 1);
+ vector<vector<ibbox> > bbss = bbsss.at(0);
@@ -68,32 +69,29 @@ namespace CarpetRegrid {
gh::cprocs ps;
SplitRegions (cctkGH, bbs, obs, ps);
- // make multigrid aware
- vector<vector<ibbox> > bbss;
- MakeMultigridBoxes (cctkGH, bbs, obs, bbss);
-
-
-
if (bbss.size() == 0) {
// remove all finer levels
- bbsss.resize(reflevel+1);
+ bbss.resize(reflevel+1);
obss.resize(reflevel+1);
pss.resize(reflevel+1);
} else {
- assert (reflevel < (int)bbsss.size());
- if (reflevel+1 == (int)bbsss.size()) {
+ assert (reflevel < (int)bbss.size());
+ if (reflevel+1 == (int)bbss.size()) {
// add a finer level
- bbsss.push_back (bbss);
+ bbss.push_back (bbs);
obss.push_back (obs);
pss.push_back (ps);
} else {
// change a finer level
- bbsss.at(reflevel+1) = bbss;
+ bbss.at(reflevel+1) = bbs;
obss.at(reflevel+1) = obs;
pss.at(reflevel+1) = ps;
}
}
+ // make multigrid aware
+ MakeMultigridBoxes (cctkGH, bbss, obss, bbsss);
+
return 1;
}
diff --git a/Carpet/CarpetRegrid/src/baselevel.cc b/Carpet/CarpetRegrid/src/baselevel.cc
index ce4aee1c2..a2579d8ec 100644
--- a/Carpet/CarpetRegrid/src/baselevel.cc
+++ b/Carpet/CarpetRegrid/src/baselevel.cc
@@ -19,7 +19,7 @@ namespace CarpetRegrid {
int BaseLevel (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss)
{
diff --git a/Carpet/CarpetRegrid/src/centre.cc b/Carpet/CarpetRegrid/src/centre.cc
index 2c5dd6ce0..2bcbda6eb 100644
--- a/Carpet/CarpetRegrid/src/centre.cc
+++ b/Carpet/CarpetRegrid/src/centre.cc
@@ -19,7 +19,7 @@ namespace CarpetRegrid {
int Centre (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss)
{
@@ -31,8 +31,9 @@ namespace CarpetRegrid {
if (reflevel == refinement_levels) return 0;
assert (bbsss.size() >= 1);
+ vector<vector<ibbox> > bbss = bbsss.at(0);
- bbsss.resize (refinement_levels);
+ bbss.resize (refinement_levels);
obss.resize (refinement_levels);
pss.resize (refinement_levels);
@@ -45,7 +46,7 @@ namespace CarpetRegrid {
assert (! smart_outer_boundaries);
- for (size_t rl=1; rl<bbsss.size(); ++rl) {
+ for (size_t rl=1; rl<bbss.size(); ++rl) {
// save old values
ivect const oldrlb = rlb;
@@ -74,14 +75,13 @@ namespace CarpetRegrid {
gh::cprocs ps;
SplitRegions (cctkGH, bbs, obs, ps);
- // make multigrid aware
- vector<vector<ibbox> > bbss;
- MakeMultigridBoxes (cctkGH, bbs, obs, bbss);
-
- bbsss.at(rl) = bbss;
+ bbss.at(rl) = bbs;
obss.at(rl) = obs;
pss.at(rl) = ps;
+ // make multigrid aware
+ MakeMultigridBoxes (cctkGH, bbss, obss, bbsss);
+
} // for rl
return 1;
diff --git a/Carpet/CarpetRegrid/src/manualcoordinatelist.cc b/Carpet/CarpetRegrid/src/manualcoordinatelist.cc
index 04dffd5e5..2467bae24 100644
--- a/Carpet/CarpetRegrid/src/manualcoordinatelist.cc
+++ b/Carpet/CarpetRegrid/src/manualcoordinatelist.cc
@@ -23,7 +23,7 @@ namespace CarpetRegrid {
int ManualCoordinateList (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss)
{
@@ -36,6 +36,7 @@ namespace CarpetRegrid {
if (reflevel == refinement_levels) return 0;
assert (bbsss.size() >= 1);
+ vector<vector<ibbox> > bbss = bbsss.at(0);
jjvect nboundaryzones, is_internal, is_staggered, shiftout;
ierr = GetBoundarySpecification
@@ -52,7 +53,7 @@ namespace CarpetRegrid {
&exterior_min[0], &exterior_max[0], &base_spacing[0]);
assert (!ierr);
- bbsss.resize (refinement_levels);
+ bbss.resize (refinement_levels);
obss.resize (refinement_levels);
pss.resize (refinement_levels);
@@ -183,14 +184,13 @@ namespace CarpetRegrid {
gh::cprocs ps;
SplitRegions (cctkGH, bbs, obs, ps);
- // make multigrid aware
- vector<vector<ibbox> > bbss;
- MakeMultigridBoxes (cctkGH, bbs, obs, bbss);
-
- bbsss.at(rl) = bbss;
+ bbss.at(rl) = bbs;
obss.at(rl) = obs;
pss.at(rl) = ps;
+ // make multigrid aware
+ MakeMultigridBoxes (cctkGH, bbss, obss, bbsss);
+
} // for rl
return 1;
diff --git a/Carpet/CarpetRegrid/src/manualcoordinates.cc b/Carpet/CarpetRegrid/src/manualcoordinates.cc
index cc757fdce..4495f7ac9 100644
--- a/Carpet/CarpetRegrid/src/manualcoordinates.cc
+++ b/Carpet/CarpetRegrid/src/manualcoordinates.cc
@@ -21,7 +21,7 @@ namespace CarpetRegrid {
int ManualCoordinates (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss)
{
@@ -36,8 +36,9 @@ namespace CarpetRegrid {
if (reflevel == refinement_levels) return 0;
assert (bbsss.size() >= 1);
+ vector<vector<ibbox> > bbss = bbsss.at(0);
- bbsss.resize (refinement_levels);
+ bbss.resize (refinement_levels);
obss.resize (refinement_levels);
pss.resize (refinement_levels);
@@ -51,7 +52,7 @@ namespace CarpetRegrid {
assert (! smart_outer_boundaries);
- for (size_t rl=1; rl<bbsss.size(); ++rl) {
+ for (size_t rl=1; rl<bbss.size(); ++rl) {
bbvect const ob (false);
@@ -66,14 +67,13 @@ namespace CarpetRegrid {
gh::cprocs ps;
SplitRegions (cctkGH, bbs, obs, ps);
- // make multigrid aware
- vector<vector<ibbox> > bbss;
- MakeMultigridBoxes (cctkGH, bbs, obs, bbss);
-
- bbsss.at(rl) = bbss;
+ bbss.at(rl) = bbs;
obss.at(rl) = obs;
pss.at(rl) = ps;
+ // make multigrid aware
+ MakeMultigridBoxes (cctkGH, bbss, obss, bbsss);
+
} // for rl
return 1;
diff --git a/Carpet/CarpetRegrid/src/manualgridpointlist.cc b/Carpet/CarpetRegrid/src/manualgridpointlist.cc
index c4f534fd1..93dfe6563 100644
--- a/Carpet/CarpetRegrid/src/manualgridpointlist.cc
+++ b/Carpet/CarpetRegrid/src/manualgridpointlist.cc
@@ -23,7 +23,7 @@ namespace CarpetRegrid {
int ManualGridpointList (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss)
{
@@ -35,8 +35,9 @@ namespace CarpetRegrid {
if (reflevel == refinement_levels) return 0;
assert (bbsss.size() >= 1);
+ vector<vector<ibbox> > bbss = bbsss.at(0);
- bbsss.resize (refinement_levels);
+ bbss.resize (refinement_levels);
obss.resize (refinement_levels);
pss.resize (refinement_levels);
@@ -104,14 +105,13 @@ namespace CarpetRegrid {
gh::cprocs ps;
SplitRegions (cctkGH, bbs, obs, ps);
- // make multigrid aware
- vector<vector<ibbox> > bbss;
- MakeMultigridBoxes (cctkGH, bbs, obs, bbss);
-
- bbsss.at(rl) = bbss;
+ bbss.at(rl) = bbs;
obss.at(rl) = obs;
pss.at(rl) = ps;
+ // make multigrid aware
+ MakeMultigridBoxes (cctkGH, bbss, obss, bbsss);
+
} // for rl
return 1;
diff --git a/Carpet/CarpetRegrid/src/manualgridpoints.cc b/Carpet/CarpetRegrid/src/manualgridpoints.cc
index b4cb85a17..92432686c 100644
--- a/Carpet/CarpetRegrid/src/manualgridpoints.cc
+++ b/Carpet/CarpetRegrid/src/manualgridpoints.cc
@@ -22,7 +22,7 @@ namespace CarpetRegrid {
int ManualGridpoints (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss)
{
@@ -37,8 +37,9 @@ namespace CarpetRegrid {
if (reflevel == refinement_levels) return 0;
assert (bbsss.size() >= 1);
+ vector<vector<ibbox> > bbss = bbsss.at(0);
- bbsss.resize (refinement_levels);
+ bbss.resize (refinement_levels);
obss.resize (refinement_levels);
pss.resize (refinement_levels);
@@ -52,7 +53,7 @@ namespace CarpetRegrid {
assert (! smart_outer_boundaries);
- for (size_t rl=1; rl<bbsss.size(); ++rl) {
+ for (size_t rl=1; rl<bbss.size(); ++rl) {
bbvect const ob (false);
@@ -67,14 +68,13 @@ namespace CarpetRegrid {
gh::cprocs ps;
SplitRegions (cctkGH, bbs, obs, ps);
- // make multigrid aware
- vector<vector<ibbox> > bbss;
- MakeMultigridBoxes (cctkGH, bbs, obs, bbss);
-
- bbsss.at(rl) = bbss;
+ bbss.at(rl) = bbs;
obss.at(rl) = obs;
pss.at(rl) = ps;
+ // make multigrid aware
+ MakeMultigridBoxes (cctkGH, bbss, obss, bbsss);
+
} // for rl
return 1;
diff --git a/Carpet/CarpetRegrid/src/moving.cc b/Carpet/CarpetRegrid/src/moving.cc
index 0985399d5..7936865c3 100644
--- a/Carpet/CarpetRegrid/src/moving.cc
+++ b/Carpet/CarpetRegrid/src/moving.cc
@@ -20,7 +20,7 @@ namespace CarpetRegrid {
int Moving (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss)
{
@@ -30,8 +30,9 @@ namespace CarpetRegrid {
assert (refinement_levels >= 1);
assert (bbsss.size() >= 1);
+ vector<vector<ibbox> > bbss = bbsss.at(0);
- bbsss.resize (refinement_levels);
+ bbss.resize (refinement_levels);
obss.resize (refinement_levels);
pss.resize (refinement_levels);
@@ -40,7 +41,7 @@ namespace CarpetRegrid {
assert (! smart_outer_boundaries);
- for (size_t rl=1; rl<bbsss.size(); ++rl) {
+ for (size_t rl=1; rl<bbss.size(); ++rl) {
// calculate new extent
CCTK_REAL const argument = 2*M_PI * moving_circle_frequency * cctk_time;
@@ -63,14 +64,13 @@ namespace CarpetRegrid {
gh::cprocs ps;
SplitRegions (cctkGH, bbs, obs, ps);
- // make multigrid aware
- vector<vector<ibbox> > bbss;
- MakeMultigridBoxes (cctkGH, bbs, obs, bbss);
-
- bbsss.at(rl) = bbss;
+ bbss.at(rl) = bbs;
obss.at(rl) = obs;
pss.at(rl) = ps;
+ // make multigrid aware
+ MakeMultigridBoxes (cctkGH, bbss, obss, bbsss);
+
} // for rl
return 1;
diff --git a/Carpet/CarpetRegrid/src/regrid.cc b/Carpet/CarpetRegrid/src/regrid.cc
index 94b281513..92b234d24 100644
--- a/Carpet/CarpetRegrid/src/regrid.cc
+++ b/Carpet/CarpetRegrid/src/regrid.cc
@@ -28,7 +28,7 @@ namespace CarpetRegrid {
const cGH * const cctkGH = (const cGH *) cctkGH_;
- gh::rexts & bbsss = * (gh::rexts *) bbsss_;
+ gh::mexts & bbsss = * (gh::mexts *) bbsss_;
gh::rbnds & obss = * (gh::rbnds *) obss_;
gh::rprocs & pss = * (gh::rprocs *) pss_;
diff --git a/Carpet/CarpetRegrid/src/regrid.hh b/Carpet/CarpetRegrid/src/regrid.hh
index fea47e073..30038d8b2 100644
--- a/Carpet/CarpetRegrid/src/regrid.hh
+++ b/Carpet/CarpetRegrid/src/regrid.hh
@@ -30,7 +30,7 @@ namespace CarpetRegrid {
/* Aliased functions */
// CCTK_INT CarpetRegrid_Regrid (const cGH * const cctkGH,
-// gh<dim>::rexts * bbsss,
+// gh<dim>::mexts * bbsss,
// gh<dim>::rbnds * obss,
// gh<dim>::rprocs * pss);
CCTK_INT CarpetRegrid_Regrid (CCTK_POINTER_TO_CONST const cctkGH_,
@@ -44,19 +44,19 @@ namespace CarpetRegrid {
int BaseLevel (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss);
int Centre (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss);
int ManualGridpoints (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss);
@@ -72,7 +72,7 @@ namespace CarpetRegrid {
int ManualCoordinates (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss);
@@ -97,25 +97,25 @@ namespace CarpetRegrid {
int ManualGridpointList (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss);
int ManualCoordinateList (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss);
int Moving (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss);
int Automatic (cGH const * const cctkGH,
gh const & hh,
- gh::rexts & bbsss,
+ gh::mexts & bbsss,
gh::rbnds & obss,
gh::rprocs & pss);