diff options
Diffstat (limited to 'Carpet/CarpetLib/src/interpolate_3d_3tl.cc')
-rw-r--r-- | Carpet/CarpetLib/src/interpolate_3d_3tl.cc | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/Carpet/CarpetLib/src/interpolate_3d_3tl.cc b/Carpet/CarpetLib/src/interpolate_3d_3tl.cc index eaf24bea5..ce8249998 100644 --- a/Carpet/CarpetLib/src/interpolate_3d_3tl.cc +++ b/Carpet/CarpetLib/src/interpolate_3d_3tl.cc @@ -8,7 +8,6 @@ #include <loopcontrol.h> -#include "gdata.hh" #include "operator_prototypes_3d.hh" #include "typeprops.hh" @@ -22,9 +21,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) @@ -37,9 +38,11 @@ namespace CarpetLib { CCTK_REAL const t2, T const * restrict const src3, CCTK_REAL const t3, + ivect3 const & restrict srcpadext, ivect3 const & restrict srcext, T * restrict const dst, CCTK_REAL const t, + ivect3 const & restrict dstpadext, ivect3 const & restrict dstext, ibbox3 const & restrict srcbbox, ibbox3 const & restrict dstbbox, @@ -75,12 +78,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(); @@ -91,6 +88,14 @@ namespace CarpetLib { + ptrdiff_t const srcipadext = srcpadext[0]; + ptrdiff_t const srcjpadext = srcpadext[1]; + ptrdiff_t const srckpadext = srcpadext[2]; + + ptrdiff_t const dstipadext = dstpadext[0]; + ptrdiff_t const dstjpadext = dstpadext[1]; + ptrdiff_t const dstkpadext = dstpadext[2]; + ptrdiff_t const srciext = srcext[0]; ptrdiff_t const srcjext = srcext[1]; ptrdiff_t const srckext = srcext[2]; @@ -133,7 +138,8 @@ namespace CarpetLib { // Loop over region #pragma omp parallel CCTK_LOOP3(interpolate_3d_3tl, - i,j,k, 0,0,0, regiext,regjext,regkext, srciext,srcjext,srckext) + i,j,k, 0,0,0, regiext,regjext,regkext, + dstipadext,dstjpadext,dstkpadext) { dst [DSTIND3(i, j, k)] = @@ -147,23 +153,25 @@ namespace CarpetLib { -#define TYPECASE(N,T) \ - template \ - void \ - interpolate_3d_3tl (T const * restrict const src1, \ - CCTK_REAL const t1, \ - T const * restrict const src2, \ - CCTK_REAL const t2, \ - T const * restrict const src3, \ - CCTK_REAL const t3, \ - ivect3 const & restrict srcext, \ - T * restrict const dst, \ - CCTK_REAL const t, \ - ivect3 const & restrict dstext, \ - ibbox3 const & restrict srcbbox, \ - ibbox3 const & restrict dstbbox, \ - ibbox3 const & restrict, \ - ibbox3 const & restrict regbbox, \ +#define TYPECASE(N,T) \ + template \ + void \ + interpolate_3d_3tl (T const * restrict const src1, \ + CCTK_REAL const t1, \ + T const * restrict const src2, \ + CCTK_REAL const t2, \ + T const * restrict const src3, \ + CCTK_REAL const t3, \ + ivect3 const & restrict srcpadext, \ + ivect3 const & restrict srcext, \ + T * restrict const dst, \ + CCTK_REAL const t, \ + 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 |