From 6679e32674b71ed65cc2dbbb97e114f1699fee11 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 3 Jul 2012 21:33:41 -0400 Subject: Introduce cctk_ash, retire cctk_lssh Introduce cctk_ash, describing the process-local array shape that has been allocated. This may be larger than cctk_lsh, the process-local shape that should be used. Retire cctk_lssh and related infrastructure to handle staggered grid functions. --- Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc | 29 +++++++++++++++++---------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'Carpet/CarpetLib') diff --git a/Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc index c9067c9d9..a90ebb868 100644 --- a/Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc +++ b/Carpet/CarpetLib/src/restrict_3d_cc_o5_rf2.cc @@ -24,11 +24,12 @@ namespace CarpetLib { index3 (dstioff + (i), dstjoff + (j), dstkoff + (k), \ dstiext, dstjext, dstkext) #define SRCOFF3(i,j,k) \ - offset3 (srcioff + (i), srcjoff + (j), srckoff + (k), \ - srciext, srcjext, srckext) + offset3 (srcioff + (i), srcjoff + (j), srckoff + (k), \ + srciext, srcjext, srckext) #define DSTOFF3(i,j,k) \ - offset3 (dstioff + (i), dstjoff + (j), dstkoff + (k), \ - dstiext, dstjext, dstkext) + offset3 (dstioff + (i), dstjoff + (j), dstkoff + (k), \ + dstiext, dstjext, dstkext) + // This operator offers fifth-order accurate restriction operators for cell @@ -43,10 +44,12 @@ namespace CarpetLib { // TODO: use prolongate_3d_rf2 instead of writing new operators, its the same // interpolation. + namespace { + // 1D restriction template - static inline T restrict1 (T const * restrict const p, - size_t const d1) + inline T restrict1 (T const * restrict const p, + size_t const d1) { typedef typename typeprops::real RT; RT const den = 256; @@ -63,8 +66,8 @@ namespace CarpetLib { // 2D restriction template - static inline T restrict2 (T const * restrict const p, - size_t const d1, size_t const d2) + inline T restrict2 (T const * restrict const p, + size_t const d1, size_t const d2) { typedef typename typeprops::real RT; RT const den = 256; @@ -81,8 +84,8 @@ namespace CarpetLib { // 3D restriction template - static inline T restrict3 (T const * restrict const p, - size_t const d1, size_t const d2, size_t const d3) + inline T restrict3 (T const * restrict const p, + size_t const d1, size_t const d2, size_t const d3) { typedef typename typeprops::real RT; RT const den = 256; @@ -97,6 +100,10 @@ namespace CarpetLib { return res; } + } // namespace + + + template void restrict_3d_cc_o5_rf2 (T const * restrict const src, @@ -221,7 +228,7 @@ namespace CarpetLib { } #endif dst [DSTIND3(i, j, k)] = - restrict3 + CarpetLib::restrict3 (& src[SRCIND3(2*i, 2*j, 2*k)], srcdi, srcdj, srcdk); } -- cgit v1.2.3