diff options
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r-- | Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc | 13 |
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))) |