From 91507decafa6261ef65371dcfb744d4829259d34 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 20 Feb 2008 00:30:00 +0000 Subject: 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 --- Carpet/Carpet/src/Recompose.cc | 25 +++++++++++++++++++------ Carpet/Carpet/src/SetupGH.cc | 29 +++++++++++++++++++++-------- Carpet/Carpet/src/functions.hh | 1 + 3 files changed, 41 insertions(+), 14 deletions(-) (limited to 'Carpet') 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 & 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 > const & regss, vector > > & regsss) { @@ -1304,7 +1317,7 @@ namespace Carpet { for (int c=0; c<(int)regss.at(rl).size(); ++c) { vector 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 > > > & 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); -- cgit v1.2.3