aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet/src/Recompose.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2008-02-20 00:30:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2008-02-20 00:30:00 +0000
commitf28a4b2722f1e9e4373d4b2fccd7a5eb7b0a0c54 (patch)
tree9033d96260a2201973b6a8c8aed38287dc69ecb6 /Carpet/Carpet/src/Recompose.cc
parent200148fe2a1416187d88bb054d9c7c1155158834 (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/Carpet/src/Recompose.cc')
-rw-r--r--Carpet/Carpet/src/Recompose.cc25
1 files changed, 19 insertions, 6 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
}