2 #ifndef ERF_DirectionSelector_H
3 #define ERF_DirectionSelector_H
23 [[nodiscard]]
int getIndx (
int i,
int j,
int k)
const;
32 [[nodiscard]] AMREX_GPU_HOST_DEVICE
static int getIndx (
int i,
int,
int) {
return i; }
41 [[nodiscard]] AMREX_GPU_HOST_DEVICE
static int getIndx (
int,
int j,
int) {
return j; }
50 [[nodiscard]] AMREX_GPU_HOST_DEVICE
static int getIndx (
int,
int,
int k) {
return k; }
66 template <
typename IndexSelector>
67 AMREX_GPU_HOST_DEVICE amrex::Box
70 amrex::IntVect plane_lo, plane_hi;
72 if (std::is_same<IndexSelector, XDir>::value) {
73 plane_lo = {iv[0], bx.smallEnd(1), bx.smallEnd(2)};
74 plane_hi = {iv[0], bx.bigEnd(1) , bx.bigEnd(2) };
75 }
else if (std::is_same<IndexSelector, YDir>::value) {
76 plane_lo = {bx.smallEnd(0), iv[1], bx.smallEnd(2)};
77 plane_hi = {bx.bigEnd(0) , iv[1], bx.bigEnd(2) };
79 plane_lo = {bx.smallEnd(0), bx.smallEnd(1), iv[2]};
80 plane_hi = {bx.bigEnd(0) , bx.bigEnd(1) , iv[2]};
83 amrex::Box pbx(plane_lo, plane_hi, bx.type());
98 template <
typename IndexSelector>
99 AMREX_GPU_HOST_DEVICE amrex::Box
102 amrex::IntVect line_lo, line_hi;
104 if (std::is_same<IndexSelector, XDir>::value) {
105 line_lo = {bx.smallEnd(0), iv[1], iv[2]};
106 line_hi = {bx.bigEnd(0), iv[1], iv[2]};
107 }
else if (std::is_same<IndexSelector, YDir>::value) {
108 line_lo = {iv[0], bx.smallEnd(1), iv[2]};
109 line_hi = {iv[0], bx.bigEnd(1), iv[2]};
111 line_lo = {iv[0], iv[1], bx.smallEnd(2)};
112 line_hi = {iv[0], iv[1], bx.bigEnd(2)};
115 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:100
AMREX_GPU_HOST_DEVICE amrex::Box PerpendicularBox(const amrex::Box &bx, const amrex::IntVect &iv)
Definition: ERF_DirectionSelector.H:68
Definition: ERF_DirectionSelector.H:31
static AMREX_GPU_HOST_DEVICE int getIndx(int i, int, int)
Definition: ERF_DirectionSelector.H:32
Definition: ERF_DirectionSelector.H:40
static AMREX_GPU_HOST_DEVICE int getIndx(int, int j, int)
Definition: ERF_DirectionSelector.H:41
Definition: ERF_DirectionSelector.H:49
static AMREX_GPU_HOST_DEVICE int getIndx(int, int, int k)
Definition: ERF_DirectionSelector.H:50
Definition: ERF_DirectionSelector.H:14
int getIndx(int i, int j, int k) const