diff options
author | Erik Schnetter <schnetter@gmail.com> | 2012-11-21 16:29:18 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2012-11-22 09:59:17 -0500 |
commit | 6b5c318bb1057851d0ee1b5bba6e633c5cf31ca6 (patch) | |
tree | d384fe0af5bfda13e21d5eb4acd84507726b53d2 /Carpet/CarpetLib/src/prolongate_3d_cc_enovol_rf2.cc | |
parent | 4b29366c791d5fad2e10a1da1f1c20ecd91515a8 (diff) |
CarpetLib: Support padding in enovol prolongation operator
Diffstat (limited to 'Carpet/CarpetLib/src/prolongate_3d_cc_enovol_rf2.cc')
-rw-r--r-- | Carpet/CarpetLib/src/prolongate_3d_cc_enovol_rf2.cc | 123 |
1 files changed, 53 insertions, 70 deletions
diff --git a/Carpet/CarpetLib/src/prolongate_3d_cc_enovol_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_cc_enovol_rf2.cc index 7631c192b..45a6ad25b 100644 --- a/Carpet/CarpetLib/src/prolongate_3d_cc_enovol_rf2.cc +++ b/Carpet/CarpetLib/src/prolongate_3d_cc_enovol_rf2.cc @@ -43,13 +43,22 @@ using namespace std; namespace CarpetLib { - -#define SRCIND3(i,j,k) index3 (i, j, k, srciext, srcjext, srckext) -#define DSTIND3(i,j,k) index3 (i, j, k, dstiext, dstjext, dstkext) -#define SRCOFF3(i,j,k) offset3 (i, j, k, srciext, srcjext, srckext) -#define DSTOFF3(i,j,k) offset3 (i, j, k, dstiext, dstjext, dstkext) +#define SRCIND3(i,j,k) \ + index3 (i, j, k, \ + srcipadext, srcjpadext, srckpadext, \ + srciext, srcjext, srckext) +#define DSTIND3(i,j,k) \ + index3 (i, j, k, \ + dstipadext, dstjpadext, dstkpadext, \ + dstiext, dstjext, dstkext) +#define SRCOFF3(i,j,k) \ + offset3 (i, j, k, \ + srciext, srcjext, srckext) +#define DSTOFF3(i,j,k) \ + offset3 (i, j, k, \ + dstiext, dstjext, dstkext) @@ -427,14 +436,16 @@ namespace CarpetLib { template <typename T, int ORDER> void prolongate_3d_cc_enovol_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); @@ -504,13 +515,15 @@ 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"); - } + size_t const srcipadext = srcpadext[0]; + size_t const srcjpadext = srcpadext[1]; + size_t const srckpadext = srcpadext[2]; + + size_t const dstipadext = dstpadext[0]; + size_t const dstjpadext = dstpadext[1]; + size_t const dstkpadext = dstpadext[2]; size_t const srciext = srcext[0]; size_t const srcjext = srcext[1]; @@ -753,42 +766,25 @@ namespace CarpetLib { \ template <> \ void \ - prolongate_3d_cc_enovol_rf2<T,2> (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) \ - { \ - CCTK_WARN (CCTK_WARN_ABORT, \ - "ENO operators are not supported for CCTK_COMPLEX"); \ - } \ - -#if 0 - template <> \ - void \ - prolongate_3d_cc_enovol_rf2<T,3> (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) \ + prolongate_3d_cc_enovol_rf2<T,2> (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) \ { \ CCTK_WARN (CCTK_WARN_ABORT, \ "ENO operators are not supported for CCTK_COMPLEX"); \ } -#endif #define CARPET_COMPLEX #include "typecase.hh" #undef TYPECASE - @@ -796,30 +792,17 @@ namespace CarpetLib { \ template \ void \ - prolongate_3d_cc_enovol_rf2<T,2> (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); \ - \ - -#if 0 - template \ - void \ - prolongate_3d_cc_enovol_rf2<T,3> (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); -#endif + prolongate_3d_cc_enovol_rf2<T,2> (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); #define CARPET_NO_INT #define CARPET_NO_COMPLEX |