diff options
author | Roland Haas <roland.haas@physics.gatech.edu> | 2012-05-03 19:04:00 -0700 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2012-09-11 18:23:23 +0100 |
commit | 88eabaed580e106c50d512393a50b82edc03985d (patch) | |
tree | 3f857c2e5edbbd8509f5bcde94fdbcbb481df403 /Carpet/CarpetLib/src/restrict_3d_dgfe_rf2.cc | |
parent | 90a411f0afaa8f128577c023640e7ef891db5b21 (diff) |
CarpetLib: add offset3 function identical to index3 without tests
index3 fails with CARPET_DEBUG if it is asked for an index outisde of
the box, which happens in the operators when they try to ask for di
offsets for a box of width 1
Diffstat (limited to 'Carpet/CarpetLib/src/restrict_3d_dgfe_rf2.cc')
-rw-r--r-- | Carpet/CarpetLib/src/restrict_3d_dgfe_rf2.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Carpet/CarpetLib/src/restrict_3d_dgfe_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_dgfe_rf2.cc index d232c7e81..4b2c0c648 100644 --- a/Carpet/CarpetLib/src/restrict_3d_dgfe_rf2.cc +++ b/Carpet/CarpetLib/src/restrict_3d_dgfe_rf2.cc @@ -22,6 +22,8 @@ namespace CarpetLib { #define SRCIND3(i,j,k) ptrdiff_t(index3(i, j, k, srciext, srcjext, srckext)) #define DSTIND3(i,j,k) ptrdiff_t(index3(i, j, k, dstiext, dstjext, dstkext)) +#define SRCOFF3(i,j,k) ptrdiff_t(offset3(i, j, k, srciext, srcjext, srckext)) +#define DSTOFF3(i,j,k) ptrdiff_t(offset3(i, j, k, dstiext, dstjext, dstkext)) @@ -102,17 +104,17 @@ namespace CarpetLib { - // int const srcdi = SRCIND3(1,0,0) - SRCIND3(0,0,0); + // int const srcdi = SRCOFF3(1,0,0) - SRCOFF3(0,0,0); int const srcdi = 1; - assert(srcdi == SRCIND3(1,0,0) - SRCIND3(0,0,0)); - int const srcdj = SRCIND3(0,1,0) - SRCIND3(0,0,0); - int const srcdk = SRCIND3(0,0,1) - SRCIND3(0,0,0); + assert(srcdi == SRCOFF3(1,0,0) - SRCOFF3(0,0,0)); + int const srcdj = SRCOFF3(0,1,0) - SRCOFF3(0,0,0); + int const srcdk = SRCOFF3(0,0,1) - SRCOFF3(0,0,0); - // int const dstdi = DSTIND3(1,0,0) - DSTIND3(0,0,0); + // int const dstdi = DSTOFF3(1,0,0) - DSTOFF3(0,0,0); int const dstdi = 1; - assert(dstdi == DSTIND3(1,0,0) - DSTIND3(0,0,0)); - int const dstdj = DSTIND3(0,1,0) - DSTIND3(0,0,0); - int const dstdk = DSTIND3(0,0,1) - DSTIND3(0,0,0); + assert(dstdi == DSTOFF3(1,0,0) - DSTOFF3(0,0,0)); + int const dstdj = DSTOFF3(0,1,0) - DSTOFF3(0,0,0); + int const dstdk = DSTOFF3(0,0,1) - DSTOFF3(0,0,0); int const srcstr[3] = {srcdi, srcdj, srcdk}; int const dststr[3] = {dstdi, dstdj, dstdk}; |