aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc')
-rw-r--r--Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc60
1 files changed, 34 insertions, 26 deletions
diff --git a/Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc
index a90ebb868..6c90daa44 100644
--- a/Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc
+++ b/Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc
@@ -19,9 +19,11 @@ namespace CarpetLib {
#define SRCIND3(i,j,k) \
index3 (srcioff + (i), srcjoff + (j), srckoff + (k), \
+ srcipadext, srcjpadext, srckpadext, \
srciext, srcjext, srckext)
#define DSTIND3(i,j,k) \
index3 (dstioff + (i), dstjoff + (j), dstkoff + (k), \
+ dstipadext, dstjpadext, dstkpadext, \
dstiext, dstjext, dstkext)
#define SRCOFF3(i,j,k) \
offset3 (srcioff + (i), srcjoff + (j), srckoff + (k), \
@@ -107,14 +109,16 @@ namespace CarpetLib {
template <typename T>
void
restrict_3d_cc_o5_rf2 (T const * restrict const src,
- ivect3 const & restrict srcext,
- T * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict,
- ibbox3 const & restrict regbbox,
- void * extraargs)
+ ivect3 const & restrict srcpadext,
+ ivect3 const & restrict srcext,
+ T * restrict const dst,
+ ivect3 const & restrict dstpadext,
+ ivect3 const & restrict dstext,
+ ibbox3 const & restrict srcbbox,
+ ibbox3 const & restrict dstbbox,
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
assert (not extraargs);
@@ -149,12 +153,6 @@ namespace CarpetLib {
CCTK_WARN (0, "Internal error: region extent is not contained in array extent");
}
- if (any (srcext != gdata::allocated_memory_shape(srcbbox.shape() / srcbbox.stride()) or
- dstext != gdata::allocated_memory_shape(dstbbox.shape() / dstbbox.stride())))
- {
- CCTK_WARN (0, "Internal error: array sizes don't agree with bounding boxes");
- }
-
ivect3 const regext = regbbox.shape() / regbbox.stride();
@@ -170,6 +168,14 @@ namespace CarpetLib {
+ int const srcipadext = srcpadext[0];
+ int const srcjpadext = srcpadext[1];
+ int const srckpadext = srcpadext[2];
+
+ int const dstipadext = dstpadext[0];
+ int const dstjpadext = dstpadext[1];
+ int const dstkpadext = dstpadext[2];
+
int const srciext = srcext[0];
int const srcjext = srcext[1];
int const srckext = srcext[2];
@@ -239,18 +245,20 @@ namespace CarpetLib {
-#define TYPECASE(N,T) \
- template \
- void \
- restrict_3d_cc_o5_rf2 (T const * restrict const src, \
- ivect3 const & restrict srcext, \
- T * restrict const dst, \
- ivect3 const & restrict dstext, \
- ibbox3 const & restrict srcbbox, \
- ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict, \
- ibbox3 const & restrict regbbox, \
- void * extraargs);
+#define TYPECASE(N,T) \
+ template \
+ void \
+ restrict_3d_cc_o5_rf2 (T const * restrict const src, \
+ ivect3 const & restrict srcpadext, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ ivect3 const & restrict dstpadext, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE