aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-08-27 10:11:14 -0400
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 18:24:01 +0000
commit5ab59f0b6ab7e46281ce404f2bead810dedfed98 (patch)
tree841b30a294f1a946d46ff8aaa070d4433af60cb5 /Carpet
parent03af01606edaa61cdd0308c1d3e2a11f6c20ae57 (diff)
CarpetLib: Correct face-centred restriction operator
Artificially shift bounding boxes as if the fluxes were cell centred, since Carpet internally doesn't distinguish between the different centering methods.
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc
index 17401c727..17ed66218 100644
--- a/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc
+++ b/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc
@@ -132,8 +132,8 @@ namespace CarpetLib {
ivect3 const & restrict srcext,
T * restrict const dst,
ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
+ ibbox3 const & restrict srcbbox0,
+ ibbox3 const & restrict dstbbox0,
ibbox3 const & restrict regbbox)
{
DECLARE_CCTK_PARAMETERS;
@@ -147,6 +147,13 @@ namespace CarpetLib {
+ // Correct bboxes, since the fluxes are stored as if they were
+ // cell-centered
+ ibbox const srcbbox = srcbbox0.shift(icent-1,2);
+ ibbox const dstbbox = dstbbox0.shift(icent-1,2);
+
+
+
if (any (srcbbox.stride() >= regbbox.stride() or
dstbbox.stride() != regbbox.stride()))
{
@@ -178,7 +185,7 @@ namespace CarpetLib {
ivect3 const regext = regbbox.shape() / regbbox.stride();
- assert (all (either (cent, srcbbox.stride() % 2 == 0, true)));
+ assert (all (srcbbox.stride() % either (cent, 2, 1) == 0));
if (not (all ((regbbox.lower() - srcbbox.lower() -
either (cent, srcbbox.stride() / 2, 0)) %
srcbbox.stride() == 0)))