2 #ifndef ERF_DirectionSelector_H
3 #define ERF_DirectionSelector_H
15 [[nodiscard]]
int getIndx (
int i,
int j,
int k)
const;
21 [[nodiscard]] AMREX_GPU_HOST_DEVICE
static int getIndx (
int i,
int,
int) {
return i; }
27 [[nodiscard]] AMREX_GPU_HOST_DEVICE
static int getIndx (
int,
int j,
int) {
return j; }
33 [[nodiscard]] AMREX_GPU_HOST_DEVICE
static int getIndx (
int,
int,
int k) {
return k; }
49 template <
typename IndexSelector>
50 AMREX_GPU_HOST_DEVICE amrex::Box
53 amrex::IntVect plane_lo, plane_hi;
55 if (std::is_same<IndexSelector, XDir>::value) {
56 plane_lo = {iv[0], bx.smallEnd(1), bx.smallEnd(2)};
57 plane_hi = {iv[0], bx.bigEnd(1), bx.bigEnd(2)};
58 }
else if (std::is_same<IndexSelector, YDir>::value) {
59 plane_lo = {bx.smallEnd(0), iv[1], bx.smallEnd(2)};
60 plane_hi = {bx.bigEnd(0), iv[1], bx.bigEnd(2)};
62 plane_lo = {bx.smallEnd(0), bx.smallEnd(1), iv[2]};
63 plane_hi = {bx.bigEnd(0), bx.bigEnd(1), iv[2]};
66 amrex::Box pbx(plane_lo, plane_hi, bx.type());
81 template <
typename IndexSelector>
82 AMREX_GPU_HOST_DEVICE amrex::Box
85 amrex::IntVect line_lo, line_hi;
87 if (std::is_same<IndexSelector, XDir>::value) {
88 line_lo = {bx.smallEnd(0), iv[1], iv[2]};
89 line_hi = {bx.bigEnd(0), iv[1], iv[2]};
90 }
else if (std::is_same<IndexSelector, YDir>::value) {
91 line_lo = {iv[0], bx.smallEnd(1), iv[2]};
92 line_hi = {iv[0], bx.bigEnd(1), iv[2]};
94 line_lo = {iv[0], iv[1], bx.smallEnd(2)};
95 line_hi = {iv[0], iv[1], bx.bigEnd(2)};
98 amrex::Box lbx(line_lo, line_hi, bx.type());
AMREX_GPU_HOST_DEVICE amrex::Box ParallelBox(const amrex::Box &bx, const amrex::IntVect &iv)
Definition: ERF_DirectionSelector.H:83
AMREX_GPU_HOST_DEVICE amrex::Box PerpendicularBox(const amrex::Box &bx, const amrex::IntVect &iv)
Definition: ERF_DirectionSelector.H:51
Definition: ERF_DirectionSelector.H:20
static AMREX_GPU_HOST_DEVICE int getIndx(int i, int, int)
Definition: ERF_DirectionSelector.H:21
Definition: ERF_DirectionSelector.H:26
static AMREX_GPU_HOST_DEVICE int getIndx(int, int j, int)
Definition: ERF_DirectionSelector.H:27
Definition: ERF_DirectionSelector.H:32
static AMREX_GPU_HOST_DEVICE int getIndx(int, int, int k)
Definition: ERF_DirectionSelector.H:33
Definition: ERF_DirectionSelector.H:14
int getIndx(int i, int j, int k) const