diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-02-20 00:30:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-02-20 00:30:00 +0000 |
commit | 91507decafa6261ef65371dcfb744d4829259d34 (patch) | |
tree | 9033d96260a2201973b6a8c8aed38287dc69ecb6 /Carpet | |
parent | 491775ecd8515e370b77fb270d5c342736127fe1 (diff) |
Carpet: MultiPatch_GetBoundarySpecification
When Carpet::domain_from_multipatch = yes, and when the aliased
function MultiPatch_GetBoundarySpecification exists, then call this
function instead of CoordBase's GetBoundarySpecification to determine
the number of boundary points.
darcs-hash:20080220003026-dae7b-da3a05591a3fd237be9acf0c755b58e87b29bbf4.gz
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/Carpet/src/Recompose.cc | 25 | ||||
-rw-r--r-- | Carpet/Carpet/src/SetupGH.cc | 29 | ||||
-rw-r--r-- | Carpet/Carpet/src/functions.hh | 1 |
3 files changed, 41 insertions, 14 deletions
diff --git a/Carpet/Carpet/src/Recompose.cc b/Carpet/Carpet/src/Recompose.cc index fe10cff4e..d25d12e47 100644 --- a/Carpet/Carpet/src/Recompose.cc +++ b/Carpet/Carpet/src/Recompose.cc @@ -1232,18 +1232,30 @@ namespace Carpet { static void MakeMultigridBoxes (cGH const * const cctkGH, + int const m, ibbox const & base, region_t const & reg, vector<region_t> & regs) { + DECLARE_CCTK_PARAMETERS; + regs.resize (mglevels, reg); if (mglevels > 1) { // boundary offsets jjvect nboundaryzones, is_internal, is_staggered, shiftout; - const int ierr = GetBoundarySpecification - (2*dim, &nboundaryzones[0][0], &is_internal[0][0], - &is_staggered[0][0], &shiftout[0][0]); - assert (not ierr); + if (domain_from_multipatch and + CCTK_IsFunctionAliased ("MultiPatch_GetBoundarySpecification")) + { + const int ierr = MultiPatch_GetBoundarySpecification + (m, 2*dim, &nboundaryzones[0][0], &is_internal[0][0], + &is_staggered[0][0], &shiftout[0][0]); + assert (not ierr); + } else { + const int ierr = GetBoundarySpecification + (2*dim, &nboundaryzones[0][0], &is_internal[0][0], + &is_staggered[0][0], &shiftout[0][0]); + assert (not ierr); + } // (distance in grid points between the exterior and the physical boundary) iivect offset; for (int d=0; d<dim; ++d) { @@ -1284,6 +1296,7 @@ namespace Carpet { void MakeMultigridBoxes (cGH const * const cctkGH, + int const m, vector<vector<region_t> > const & regss, vector<vector<vector<region_t> > > & regsss) { @@ -1304,7 +1317,7 @@ namespace Carpet { for (int c=0; c<(int)regss.at(rl).size(); ++c) { vector<region_t> mg_regs; - MakeMultigridBoxes (cctkGH, base, regss.at(rl).at(c), mg_regs); + MakeMultigridBoxes (cctkGH, m, base, regss.at(rl).at(c), mg_regs); assert ((int)mg_regs.size() == mglevels); for (int ml=0; ml<mglevels; ++ml) { regsss.at(ml).at(rl).at(c) = mg_regs.at(ml); @@ -1321,7 +1334,7 @@ namespace Carpet { vector<vector<vector<vector<region_t> > > > & regssss) { for (int m = 0; m < maps; ++m) { - MakeMultigridBoxes (cctkGH, regsss.at(m), regssss.at(m)); + MakeMultigridBoxes (cctkGH, m, regsss.at(m), regssss.at(m)); } // for m } diff --git a/Carpet/Carpet/src/SetupGH.cc b/Carpet/Carpet/src/SetupGH.cc index 7fba6ae5e..fe10c3e73 100644 --- a/Carpet/Carpet/src/SetupGH.cc +++ b/Carpet/Carpet/src/SetupGH.cc @@ -1105,13 +1105,26 @@ namespace Carpet { if (domain_from_multipatch or domain_from_coordbase) { jjvect nboundaryzones_, is_internal_, is_staggered_, shiftout_; - int const ierr = - GetBoundarySpecification (2*dim, - &nboundaryzones_[0][0], - &is_internal_[0][0], - &is_staggered_[0][0], - &shiftout_[0][0]); - assert (not ierr); + if (domain_from_multipatch and + CCTK_IsFunctionAliased ("MultiPatch_GetBoundarySpecification")) + { + int const ierr = + MultiPatch_GetBoundarySpecification (m, + 2*dim, + &nboundaryzones_[0][0], + &is_internal_[0][0], + &is_staggered_[0][0], + &shiftout_[0][0]); + assert (not ierr); + } else { + int const ierr = + GetBoundarySpecification (2*dim, + &nboundaryzones_[0][0], + &is_internal_[0][0], + &is_staggered_[0][0], + &shiftout_[0][0]); + assert (not ierr); + } nboundaryzones = xpose (nboundaryzones_); is_internal = xpose (is_internal_); is_staggered = xpose (is_staggered_); @@ -1453,7 +1466,7 @@ namespace Carpet { SplitRegions (cctkGH, regsss.at(m).at(rl)); // Create all multigrid levels - MakeMultigridBoxes (cctkGH, regsss.at(m), regssss.at(m)); + MakeMultigridBoxes (cctkGH, m, regsss.at(m), regssss.at(m)); } // for m } else { diff --git a/Carpet/Carpet/src/functions.hh b/Carpet/Carpet/src/functions.hh index 3ac06e9bb..44aee74c3 100644 --- a/Carpet/Carpet/src/functions.hh +++ b/Carpet/Carpet/src/functions.hh @@ -157,6 +157,7 @@ namespace Carpet { void MakeMultigridBoxes (cGH const * cctkGH, + int m, gh::rregs const & regss, gh::mregs & regsss); |