aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Carpet/CarpetRegrid2/param.ccl5
-rw-r--r--Carpet/CarpetRegrid2/src/regrid.cc9
2 files changed, 10 insertions, 4 deletions
diff --git a/Carpet/CarpetRegrid2/param.ccl b/Carpet/CarpetRegrid2/param.ccl
index affc8103f..47cc3e72a 100644
--- a/Carpet/CarpetRegrid2/param.ccl
+++ b/Carpet/CarpetRegrid2/param.ccl
@@ -26,6 +26,11 @@ BOOLEAN snap_to_coarse "Ensure that the fine grid extent coincides with coarse g
{
} "no"
+CCTK_INT boundary_shiftout "Number of grid points added to the refinement boundary radius" STEERABLE=always
+{
+ *:* :: ""
+} 0
+
CCTK_INT regrid_every "Regrid every n time steps" STEERABLE=always
diff --git a/Carpet/CarpetRegrid2/src/regrid.cc b/Carpet/CarpetRegrid2/src/regrid.cc
index eb4f9a087..f6a275dd9 100644
--- a/Carpet/CarpetRegrid2/src/regrid.cc
+++ b/Carpet/CarpetRegrid2/src/regrid.cc
@@ -287,12 +287,13 @@ namespace CarpetRegrid2 {
rvect const rmax = centre.position + centre.radius.at(rl);
// Convert to an integer bbox
+ ivect const istride = hh.baseextents.at(0).at(rl).stride();
ivect const imin =
- rpos2ipos (rmin, origin, scale, hh, rl);
+ rpos2ipos (rmin, origin, scale, hh, rl)
+ - boundary_shiftout * istride;
ivect const imax =
- rpos2ipos1 (rmax, origin, scale, hh, rl);
-
- ivect const istride = hh.baseextents.at(0).at(rl).stride();
+ rpos2ipos1 (rmax, origin, scale, hh, rl)
+ + boundary_shiftout * istride;
ibbox const region (imin, imax, istride);