aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2012-11-16 18:55:47 -0500
committerErik Schnetter <schnetter@gmail.com>2012-11-22 09:59:16 -0500
commit53a1c146bc09c67ea709c14dab4c73ebebed86dc (patch)
treeb5bd034cf3c0e6de4cb422ceffe52e01de06f505 /Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc
parentdf843816d07d18e2c0407915d1b8113bfe7ab720 (diff)
Allow padding in transport operators
Rewrite padding infrastructure. Add padded array extents to transport operator APIs.
Diffstat (limited to 'Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc')
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc42
1 files changed, 31 insertions, 11 deletions
diff --git a/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc
index 5cd8fdd2c..7b5c6cee2 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc
@@ -6,7 +6,6 @@
#include <cmath>
#include <cstdlib>
-#include "gdata.hh"
#include "operator_prototypes_3d.hh"
#include "typeprops.hh"
@@ -43,13 +42,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)
@@ -947,8 +955,10 @@ namespace CarpetLib {
template <typename T, int ORDER>
void
prolongate_3d_cc_eno_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,
@@ -1033,13 +1043,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];
@@ -1283,8 +1295,10 @@ namespace CarpetLib {
template <> \
void \
prolongate_3d_cc_eno_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, \
@@ -1299,8 +1313,10 @@ namespace CarpetLib {
template <> \
void \
prolongate_3d_cc_eno_rf2<T,3> (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, \
@@ -1324,8 +1340,10 @@ namespace CarpetLib {
template \
void \
prolongate_3d_cc_eno_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, \
@@ -1337,8 +1355,10 @@ namespace CarpetLib {
template \
void \
prolongate_3d_cc_eno_rf2<T,3> (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, \