diff options
author | Erik Schnetter <schnetter@aei.mpg.de> | 2005-02-01 22:58:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@aei.mpg.de> | 2005-02-01 22:58:00 +0000 |
commit | 0914bc88c7aea61eedf470a903c8fa252bdc97dd (patch) | |
tree | c11153db9c2272c28d1861a42e543942c49a7dd1 /Carpet/CarpetRegrid/src/automatic.cc | |
parent | f9fe6d4b5a573027170f45784dae4b094160c546 (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/automatic.cc')
-rw-r--r-- | Carpet/CarpetRegrid/src/automatic.cc | 22 |
1 files changed, 10 insertions, 12 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; } |