diff options
Diffstat (limited to 'Carpet/CarpetLib/src')
-rw-r--r-- | Carpet/CarpetLib/src/copy_3d.cc | 70 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/interpolate_3d_2tl.cc | 60 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/interpolate_3d_3tl.cc | 60 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/operator_prototypes.hh | 100 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc | 197 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/prolongate_3d_o1_rf2.cc | 60 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/prolongate_3d_o3_rf2.cc | 60 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/prolongate_3d_o5_rf2.cc | 60 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc | 60 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/restrict_3d_rf2.cc | 70 |
10 files changed, 210 insertions, 587 deletions
diff --git a/Carpet/CarpetLib/src/copy_3d.cc b/Carpet/CarpetLib/src/copy_3d.cc index 3fa7dd872..45a5c4331 100644 --- a/Carpet/CarpetLib/src/copy_3d.cc +++ b/Carpet/CarpetLib/src/copy_3d.cc @@ -29,23 +29,13 @@ namespace CarpetLib { template <typename T> void copy_3d (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox) + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox) { -#if 0 - // This is already guaranteed by bbox - if (any (srcbbox.stride() == 0 or - dstbbox.stride() == 0 or - regbbox.stride() == 0)) - { - CCTK_WARN (0, "Internal error: stride is zero"); - } -#endif - if (any (srcbbox.stride() != regbbox.stride() or dstbbox.stride() != regbbox.stride())) { @@ -56,32 +46,12 @@ namespace CarpetLib { CCTK_WARN (0, "Internal error: strides disagree"); } -#if 0 - // This needs to be allowed for cell centring - if (any (srcbbox.lower() % srcbbox.stride() != 0 or - dstbbox.lower() % dstbbox.stride() != 0 or - regbbox.lower() % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array origins are not integer multiples of the strides"); - } -#endif - // This could be handled, but is likely to point to an error // elsewhere if (regbbox.empty()) { CCTK_WARN (0, "Internal error: region extent is empty"); } -#if 0 - // This is already guaranteed by bbox - if (any ((srcbbox.upper() - srcbbox.lower()) % srcbbox.stride() != 0 or - (dstbbox.upper() - dstbbox.lower()) % dstbbox.stride() != 0 or - (regbbox.upper() - regbbox.lower()) % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array extents are not integer multiples of the strides"); - } -#endif - if (not regbbox.is_contained_in(srcbbox) or not regbbox.is_contained_in(dstbbox)) { @@ -144,32 +114,32 @@ namespace CarpetLib { template void copy_3d (CCTK_INT const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_INT * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void copy_3d (CCTK_REAL const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_REAL * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void copy_3d (CCTK_COMPLEX const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_COMPLEX * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); diff --git a/Carpet/CarpetLib/src/interpolate_3d_2tl.cc b/Carpet/CarpetLib/src/interpolate_3d_2tl.cc index 27b290733..df696871f 100644 --- a/Carpet/CarpetLib/src/interpolate_3d_2tl.cc +++ b/Carpet/CarpetLib/src/interpolate_3d_2tl.cc @@ -32,28 +32,18 @@ namespace CarpetLib { CCTK_REAL const t1, T const * restrict const src2, CCTK_REAL const t2, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, CCTK_REAL const t, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox) + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox) { typedef typename typeprops<T>::real RT; -#if 0 - // This is already guaranteed by bbox - if (any (srcbbox.stride() == 0 or - dstbbox.stride() == 0 or - regbbox.stride() == 0)) - { - CCTK_WARN (0, "Internal error: stride is zero"); - } -#endif - if (any (srcbbox.stride() != regbbox.stride() or dstbbox.stride() != regbbox.stride())) { @@ -64,32 +54,12 @@ namespace CarpetLib { CCTK_WARN (0, "Internal error: strides disagree"); } -#if 0 - // This needs to be allowed for cell centring - if (any (srcbbox.lower() % srcbbox.stride() != 0 or - dstbbox.lower() % dstbbox.stride() != 0 or - regbbox.lower() % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array origins are not integer multiples of the strides"); - } -#endif - // This could be handled, but is likely to point to an error // elsewhere if (regbbox.empty()) { CCTK_WARN (0, "Internal error: region extent is empty"); } -#if 0 - // This is already guaranteed by bbox - if (any ((srcbbox.upper() - srcbbox.lower()) % srcbbox.stride() != 0 or - (dstbbox.upper() - dstbbox.lower()) % dstbbox.stride() != 0 or - (regbbox.upper() - regbbox.lower()) % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array extents are not integer multiples of the strides"); - } -#endif - if (not regbbox.is_contained_in(srcbbox) or not regbbox.is_contained_in(dstbbox)) { @@ -172,13 +142,13 @@ namespace CarpetLib { CCTK_REAL const t1, CCTK_REAL const * restrict const src2, CCTK_REAL const t2, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_REAL * restrict const dst, CCTK_REAL const t, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void @@ -186,13 +156,13 @@ namespace CarpetLib { CCTK_REAL const t1, CCTK_COMPLEX const * restrict const src2, CCTK_REAL const t2, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_COMPLEX * restrict const dst, CCTK_REAL const t, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); diff --git a/Carpet/CarpetLib/src/interpolate_3d_3tl.cc b/Carpet/CarpetLib/src/interpolate_3d_3tl.cc index 04d0e1e94..3b092a1ac 100644 --- a/Carpet/CarpetLib/src/interpolate_3d_3tl.cc +++ b/Carpet/CarpetLib/src/interpolate_3d_3tl.cc @@ -34,28 +34,18 @@ namespace CarpetLib { CCTK_REAL const t2, T const * restrict const src3, CCTK_REAL const t3, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, CCTK_REAL const t, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox) + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox) { typedef typename typeprops<T>::real RT; -#if 0 - // This is already guaranteed by bbox - if (any (srcbbox.stride() == 0 or - dstbbox.stride() == 0 or - regbbox.stride() == 0)) - { - CCTK_WARN (0, "Internal error: stride is zero"); - } -#endif - if (any (srcbbox.stride() != regbbox.stride() or dstbbox.stride() != regbbox.stride())) { @@ -66,32 +56,12 @@ namespace CarpetLib { CCTK_WARN (0, "Internal error: strides disagree"); } -#if 0 - // This needs to be allowed for cell centring - if (any (srcbbox.lower() % srcbbox.stride() != 0 or - dstbbox.lower() % dstbbox.stride() != 0 or - regbbox.lower() % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array origins are not integer multiples of the strides"); - } -#endif - // This could be handled, but is likely to point to an error // elsewhere if (regbbox.empty()) { CCTK_WARN (0, "Internal error: region extent is empty"); } -#if 0 - // This is already guaranteed by bbox - if (any ((srcbbox.upper() - srcbbox.lower()) % srcbbox.stride() != 0 or - (dstbbox.upper() - dstbbox.lower()) % dstbbox.stride() != 0 or - (regbbox.upper() - regbbox.lower()) % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array extents are not integer multiples of the strides"); - } -#endif - if (not regbbox.is_contained_in(srcbbox) or not regbbox.is_contained_in(dstbbox)) { @@ -179,13 +149,13 @@ namespace CarpetLib { CCTK_REAL const t2, CCTK_REAL const * restrict const src3, CCTK_REAL const t3, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_REAL * restrict const dst, CCTK_REAL const t, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void @@ -195,13 +165,13 @@ namespace CarpetLib { CCTK_REAL const t2, CCTK_COMPLEX const * restrict const src3, CCTK_REAL const t3, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_COMPLEX * restrict const dst, CCTK_REAL const t, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); diff --git a/Carpet/CarpetLib/src/operator_prototypes.hh b/Carpet/CarpetLib/src/operator_prototypes.hh index 05079ff22..c2a6e8fbc 100644 --- a/Carpet/CarpetLib/src/operator_prototypes.hh +++ b/Carpet/CarpetLib/src/operator_prototypes.hh @@ -45,56 +45,56 @@ namespace CarpetLib { template <typename T> void copy_3d (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template <typename T> void prolongate_3d_o1_rf2 (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template <typename T> void prolongate_3d_o3_rf2 (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template <typename T> void prolongate_3d_o5_rf2 (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template <typename T> void restrict_3d_rf2 (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); @@ -104,13 +104,13 @@ namespace CarpetLib { CCTK_REAL const t1, T const * restrict const src2, CCTK_REAL const t2, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, CCTK_REAL const t, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template <typename T> void @@ -120,47 +120,47 @@ namespace CarpetLib { CCTK_REAL const t2, T const * restrict const src3, CCTK_REAL const t3, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, CCTK_REAL const t, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template <typename T> void prolongate_3d_cc_rf2_std2prim (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template <typename T> void prolongate_3d_cc_rf2_prim2std (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template <typename T> void restrict_3d_cc_rf2 (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); diff --git a/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc index e0748ea56..a6cd9207c 100644 --- a/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc +++ b/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc @@ -37,12 +37,12 @@ namespace CarpetLib { template <typename T> void prolongate_3d_cc_rf2_std2prim (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox) + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox) { DECLARE_CCTK_PARAMETERS; @@ -120,85 +120,6 @@ namespace CarpetLib { -#if 0 - // Original version - - // Initialize the corner - - dst [DSTIND3(0, 0, 0)] = - zero; - - // Compute the axis lines - - for (int i=1; i<regiext; ++i) { - dst [DSTIND3(i, 0, 0)] = - + dst [DSTIND3(i-1, 0, 0)] - + src [SRCIND3(i-1, 0, 0)]; - } - - for (int j=1; j<regjext; ++j) { - dst [DSTIND3(0, j, 0)] = - + dst [DSTIND3(0, j-1, 0)] - + src [SRCIND3(0, j-1, 0)]; - } - - for (int k=1; k<regkext; ++k) { - dst [DSTIND3(0, 0, k)] = - + dst [DSTIND3(0, 0, k-1)] - + src [SRCIND3(0, 0, k-1)]; - } - - // Compute the planes - - for (int j=1; j<regjext; ++j) { - for (int i=1; i<regiext; ++i) { - dst [DSTIND3(i, j, 0)] = - + dst [DSTIND3(i-1, j, 0)] - + dst [DSTIND3(i, j-1, 0)] - - dst [DSTIND3(i-1, j-1, 0)] - + src [SRCIND3(i-1, j-1, 0)]; - } - } - - for (int k=1; k<regkext; ++k) { - for (int i=1; i<regiext; ++i) { - dst [DSTIND3(i, 0, k)] = - + dst [DSTIND3(i-1, 0, k)] - + dst [DSTIND3(i, 0, k-1)] - - dst [DSTIND3(i-1, 0, k-1)] - + src [SRCIND3(i-1, 0, k-1)]; - } - } - - for (int k=1; k<regkext; ++k) { - for (int j=1; j<regjext; ++j) { - dst [DSTIND3(0, j, k)] = - + dst [DSTIND3(0, j-1, k)] - + dst [DSTIND3(0, j, k-1)] - - dst [DSTIND3(0, j-1, k-1)] - + src [SRCIND3(0, j-1, k-1)]; - } - } - - // Compute the interior - - for (int k=1; k<regkext; ++k) { - for (int j=1; j<regjext; ++j) { - for (int i=1; i<regiext; ++i) { - dst [DSTIND3(i, j, k)] = - + dst [DSTIND3(i-1, j, k)] - + dst [DSTIND3(i, j-1, k)] - + dst [DSTIND3(i, j, k-1)] - - 2 * dst [DSTIND3(i-1, j-1, k-1)] - + src [SRCIND3(i-1, j-1, k-1)]; - } - } - } - -#endif - -#if 1 - for (int k=0; k<regkext; ++k) { for (int j=0; j<regjext; ++j) { for (int i=0; i<regiext; ++i) { @@ -230,26 +151,6 @@ namespace CarpetLib { } } -#endif - -#if 0 - // For testing - -#warning "TODO" - for (int k=0; k<regkext; ++k) { - for (int j=0; j<regjext; ++j) { - for (int i=0; i<regiext; ++i) { - if (i==0 or j==0 or k==0) { - dst [DSTIND3(i, j, k)] = zero; - } else { - dst [DSTIND3(i, j, k)] = src [SRCIND3(i-1, j-1, k-1)]; - } - } - } - } - -#endif - } @@ -257,22 +158,22 @@ namespace CarpetLib { template void prolongate_3d_cc_rf2_std2prim (CCTK_REAL const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_REAL * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void prolongate_3d_cc_rf2_std2prim (CCTK_COMPLEX const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_COMPLEX * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); @@ -282,12 +183,12 @@ namespace CarpetLib { template <typename T> void prolongate_3d_cc_rf2_prim2std (T const * restrict const src, - ivect const & srcext, + ivect const & restrict srcext, T * restrict const dst, - ivect const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox) + ivect const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox) { DECLARE_CCTK_PARAMETERS; @@ -358,28 +259,6 @@ namespace CarpetLib { -#if 0 - // Original version - - // Compute the interior - - for (int k=0; k<regkext; ++k) { - for (int j=0; j<regjext; ++j) { - for (int i=0; i<regiext; ++i) { - dst [DSTIND3(i, j, k)] = - + src [SRCIND3(i+1, j+1, k+1)] - - src [SRCIND3(i, j+1, k+1)] - - src [SRCIND3(i+1, j, k+1)] - - src [SRCIND3(i+1, j+1, k)] - + 2 * src [SRCIND3(i-1, j-1, k-1)]; - } - } - } - -#endif - -#if 1 - for (int k=0; k<regkext; ++k) { for (int j=0; j<regjext; ++j) { for (int i=0; i<regiext; ++i) { @@ -396,22 +275,6 @@ namespace CarpetLib { } } -#endif - -#if 0 - // For testing - -#warning "TODO" - for (int k=0; k<regkext; ++k) { - for (int j=0; j<regjext; ++j) { - for (int i=0; i<regiext; ++i) { - dst [DSTIND3(i, j, k)] = src [SRCIND3(i+1, j+1, k+1)]; - } - } - } - -#endif - } @@ -419,22 +282,22 @@ namespace CarpetLib { template void prolongate_3d_cc_rf2_prim2std (CCTK_REAL const * restrict const src, - ivect const & srcext, + ivect const & restrict srcext, CCTK_REAL * restrict const dst, - ivect const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void prolongate_3d_cc_rf2_prim2std (CCTK_COMPLEX const * restrict const src, - ivect const & srcext, + ivect const & restrict srcext, CCTK_COMPLEX * restrict const dst, - ivect const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); diff --git a/Carpet/CarpetLib/src/prolongate_3d_o1_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_o1_rf2.cc index 89bdb86a6..2fb318fad 100644 --- a/Carpet/CarpetLib/src/prolongate_3d_o1_rf2.cc +++ b/Carpet/CarpetLib/src/prolongate_3d_o1_rf2.cc @@ -29,27 +29,17 @@ namespace CarpetLib { template <typename T> void prolongate_3d_o1_rf2 (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox) + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox) { typedef typename typeprops<T>::real RT; -#if 0 - // This is already guaranteed by bbox - if (any (srcbbox.stride() == 0 or - dstbbox.stride() == 0 or - regbbox.stride() == 0)) - { - CCTK_WARN (0, "Internal error: stride is zero"); - } -#endif - if (any (srcbbox.stride() <= regbbox.stride() or dstbbox.stride() != regbbox.stride())) { @@ -60,32 +50,12 @@ namespace CarpetLib { CCTK_WARN (0, "Internal error: source strides are not twice the destination strides"); } -#if 0 - // This needs to be allowed for cell centring - if (any (srcbbox.lower() % srcbbox.stride() != 0 or - dstbbox.lower() % dstbbox.stride() != 0 or - regbbox.lower() % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array origins are not integer multiples of the strides"); - } -#endif - // This could be handled, but is likely to point to an error // elsewhere if (regbbox.empty()) { CCTK_WARN (0, "Internal error: region extent is empty"); } -#if 0 - // This is already guaranteed by bbox - if (any ((srcbbox.upper() - srcbbox.lower()) % srcbbox.stride() != 0 or - (dstbbox.upper() - dstbbox.lower()) % dstbbox.stride() != 0 or - (regbbox.upper() - regbbox.lower()) % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array extents are not integer multiples of the strides"); - } -#endif - ivect3 const regext = regbbox.shape() / regbbox.stride(); @@ -369,22 +339,22 @@ namespace CarpetLib { template void prolongate_3d_o1_rf2 (CCTK_REAL const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_REAL * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void prolongate_3d_o1_rf2 (CCTK_COMPLEX const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_COMPLEX * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); diff --git a/Carpet/CarpetLib/src/prolongate_3d_o3_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_o3_rf2.cc index 30a41c000..7c3c9ebd4 100644 --- a/Carpet/CarpetLib/src/prolongate_3d_o3_rf2.cc +++ b/Carpet/CarpetLib/src/prolongate_3d_o3_rf2.cc @@ -29,12 +29,12 @@ namespace CarpetLib { template <typename T> void prolongate_3d_o3_rf2 (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox) + ivect const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox) { DECLARE_CCTK_PARAMETERS; @@ -42,16 +42,6 @@ namespace CarpetLib { -#if 0 - // This is already guaranteed by bbox - if (any (srcbbox.stride() == 0 or - dstbbox.stride() == 0 or - regbbox.stride() == 0)) - { - CCTK_WARN (0, "Internal error: stride is zero"); - } -#endif - if (any (srcbbox.stride() <= regbbox.stride() or dstbbox.stride() != regbbox.stride())) { @@ -62,32 +52,12 @@ namespace CarpetLib { CCTK_WARN (0, "Internal error: source strides are not twice the destination strides"); } -#if 0 - // This needs to be allowed for cell centring - if (any (srcbbox.lower() % srcbbox.stride() != 0 or - dstbbox.lower() % dstbbox.stride() != 0 or - regbbox.lower() % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array origins are not integer multiples of the strides"); - } -#endif - // This could be handled, but is likely to point to an error // elsewhere if (regbbox.empty()) { CCTK_WARN (0, "Internal error: region extent is empty"); } -#if 0 - // This is already guaranteed by bbox - if (any ((srcbbox.upper() - srcbbox.lower()) % srcbbox.stride() != 0 or - (dstbbox.upper() - dstbbox.lower()) % dstbbox.stride() != 0 or - (regbbox.upper() - regbbox.lower()) % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array extents are not integer multiples of the strides"); - } -#endif - ivect3 const regext = regbbox.shape() / regbbox.stride(); @@ -473,22 +443,22 @@ namespace CarpetLib { template void prolongate_3d_o3_rf2 (CCTK_REAL const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_REAL * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void prolongate_3d_o3_rf2 (CCTK_COMPLEX const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_COMPLEX * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); diff --git a/Carpet/CarpetLib/src/prolongate_3d_o5_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_o5_rf2.cc index 749de2f2a..32788aa25 100644 --- a/Carpet/CarpetLib/src/prolongate_3d_o5_rf2.cc +++ b/Carpet/CarpetLib/src/prolongate_3d_o5_rf2.cc @@ -29,27 +29,17 @@ namespace CarpetLib { template <typename T> void prolongate_3d_o5_rf2 (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox) + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox) { typedef typename typeprops<T>::real RT; -#if 0 - // This is already guaranteed by bbox - if (any (srcbbox.stride() == 0 or - dstbbox.stride() == 0 or - regbbox.stride() == 0)) - { - CCTK_WARN (0, "Internal error: stride is zero"); - } -#endif - if (any (srcbbox.stride() <= regbbox.stride() or dstbbox.stride() != regbbox.stride())) { @@ -60,32 +50,12 @@ namespace CarpetLib { CCTK_WARN (0, "Internal error: source strides are not twice the destination strides"); } -#if 0 - // This needs to be allowed for cell centring - if (any (srcbbox.lower() % srcbbox.stride() != 0 or - dstbbox.lower() % dstbbox.stride() != 0 or - regbbox.lower() % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array origins are not integer multiples of the strides"); - } -#endif - // This could be handled, but is likely to point to an error // elsewhere if (regbbox.empty()) { CCTK_WARN (0, "Internal error: region extent is empty"); } -#if 0 - // This is already guaranteed by bbox - if (any ((srcbbox.upper() - srcbbox.lower()) % srcbbox.stride() != 0 or - (dstbbox.upper() - dstbbox.lower()) % dstbbox.stride() != 0 or - (regbbox.upper() - regbbox.lower()) % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array extents are not integer multiples of the strides"); - } -#endif - ivect3 const regext = regbbox.shape() / regbbox.stride(); @@ -693,22 +663,22 @@ namespace CarpetLib { template void prolongate_3d_o5_rf2 (CCTK_REAL const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_REAL * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void prolongate_3d_o5_rf2 (CCTK_COMPLEX const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_COMPLEX * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); diff --git a/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc index 9c0fbccb0..b45ba8f93 100644 --- a/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc +++ b/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc @@ -28,12 +28,12 @@ namespace CarpetLib { template <typename T> void restrict_3d_cc_rf2 (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox) + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox) { DECLARE_CCTK_PARAMETERS; @@ -41,16 +41,6 @@ namespace CarpetLib { -#if 0 - // This is already guaranteed by bbox - if (any (srcbbox.stride() == 0 or - dstbbox.stride() == 0 or - regbbox.stride() == 0)) - { - CCTK_WARN (0, "Internal error: stride is zero"); - } -#endif - if (any (srcbbox.stride() >= regbbox.stride() or dstbbox.stride() != regbbox.stride())) { @@ -61,32 +51,12 @@ namespace CarpetLib { CCTK_WARN (0, "Internal error: destination strides are not twice the source strides"); } -#if 0 - // This needs to be allowed for cell centring - if (any (srcbbox.lower() % srcbbox.stride() != 0 or - dstbbox.lower() % dstbbox.stride() != 0 or - regbbox.lower() % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array origins are not integer multiples of the strides"); - } -#endif - // This could be handled, but is likely to point to an error // elsewhere if (regbbox.empty()) { CCTK_WARN (0, "Internal error: region extent is empty"); } -#if 0 - // This is already guaranteed by bbox - if (any ((srcbbox.upper() - srcbbox.lower()) % srcbbox.stride() != 0 or - (dstbbox.upper() - dstbbox.lower()) % dstbbox.stride() != 0 or - (regbbox.upper() - regbbox.lower()) % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array extents are not integer multiples of the strides"); - } -#endif - if (not regbbox.expanded_for(srcbbox).is_contained_in(srcbbox) or not regbbox.is_contained_in(dstbbox)) { @@ -169,22 +139,22 @@ namespace CarpetLib { template void restrict_3d_cc_rf2 (CCTK_REAL const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_REAL * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void restrict_3d_cc_rf2 (CCTK_COMPLEX const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_COMPLEX * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); diff --git a/Carpet/CarpetLib/src/restrict_3d_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_rf2.cc index efda2a13a..c78f7a682 100644 --- a/Carpet/CarpetLib/src/restrict_3d_rf2.cc +++ b/Carpet/CarpetLib/src/restrict_3d_rf2.cc @@ -29,23 +29,13 @@ namespace CarpetLib { template <typename T> void restrict_3d_rf2 (T const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, T * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox) + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox) { -#if 0 - // This is already guaranteed by bbox - if (any (srcbbox.stride() == 0 or - dstbbox.stride() == 0 or - regbbox.stride() == 0)) - { - CCTK_WARN (0, "Internal error: stride is zero"); - } -#endif - if (any (srcbbox.stride() >= regbbox.stride() or dstbbox.stride() != regbbox.stride())) { @@ -56,32 +46,12 @@ namespace CarpetLib { CCTK_WARN (0, "Internal error: destination strides are not twice the source strides"); } -#if 0 - // This needs to be allowed for cell centring - if (any (srcbbox.lower() % srcbbox.stride() != 0 or - dstbbox.lower() % dstbbox.stride() != 0 or - regbbox.lower() % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array origins are not integer multiples of the strides"); - } -#endif - // This could be handled, but is likely to point to an error // elsewhere if (regbbox.empty()) { CCTK_WARN (0, "Internal error: region extent is empty"); } -#if 0 - // This is already guaranteed by bbox - if (any ((srcbbox.upper() - srcbbox.lower()) % srcbbox.stride() != 0 or - (dstbbox.upper() - dstbbox.lower()) % dstbbox.stride() != 0 or - (regbbox.upper() - regbbox.lower()) % regbbox.stride() != 0)) - { - CCTK_WARN (0, "Internal error: array extents are not integer multiples of the strides"); - } -#endif - if (not regbbox.is_contained_in(srcbbox) or not regbbox.is_contained_in(dstbbox)) { @@ -144,32 +114,32 @@ namespace CarpetLib { template void restrict_3d_rf2 (CCTK_INT const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_INT * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void restrict_3d_rf2 (CCTK_REAL const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_REAL * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); template void restrict_3d_rf2 (CCTK_COMPLEX const * restrict const src, - ivect3 const & srcext, + ivect3 const & restrict srcext, CCTK_COMPLEX * restrict const dst, - ivect3 const & dstext, - ibbox3 const & srcbbox, - ibbox3 const & dstbbox, - ibbox3 const & regbbox); + ivect3 const & restrict dstext, + ibbox3 const & restrict srcbbox, + ibbox3 const & restrict dstbbox, + ibbox3 const & restrict regbbox); |