1#ifndef DirectionSelector_H
2#define DirectionSelector_H
17 AMREX_GPU_DEVICE
int operator()(
int i,
int ,
int )
const
28 AMREX_GPU_DEVICE
int operator()(
int ,
int j,
int )
const
39 AMREX_GPU_DEVICE
int operator()(
int ,
int ,
int k)
const
54template <
typename IndexSelector>
55AMREX_GPU_HOST_DEVICE amrex::Box
58 amrex::IntVect plane_lo, plane_hi;
60 if (std::is_same_v<IndexSelector, XDir>) {
61 plane_lo = {iv[0], bx.smallEnd(1), bx.smallEnd(2)};
62 plane_hi = {iv[0], bx.bigEnd(1), bx.bigEnd(2)};
63 }
else if (std::is_same_v<IndexSelector, YDir>) {
64 plane_lo = {bx.smallEnd(0), iv[1], bx.smallEnd(2)};
65 plane_hi = {bx.bigEnd(0), iv[1], bx.bigEnd(2)};
67 plane_lo = {bx.smallEnd(0), bx.smallEnd(1), iv[2]};
68 plane_hi = {bx.bigEnd(0), bx.bigEnd(1), iv[2]};
71 amrex::Box pbx(plane_lo, plane_hi);
80template <
typename IndexSelector>
81AMREX_GPU_DEVICE amrex::Box
84 amrex::IntVect line_lo, line_hi;
86 if (std::is_same_v<IndexSelector, XDir>) {
87 line_lo = {bx.smallEnd(0), iv[1], iv[2]};
88 line_hi = {bx.bigEnd(0), iv[1], iv[2]};
89 }
else if (std::is_same_v<IndexSelector, YDir>) {
90 line_lo = {iv[0], bx.smallEnd(1), iv[2]};
91 line_hi = {iv[0], bx.bigEnd(1), iv[2]};
93 line_lo = {iv[0], iv[1], bx.smallEnd(2)};
94 line_hi = {iv[0], iv[1], bx.bigEnd(2)};
97 amrex::Box lbx(line_lo, line_hi);
104AMREX_GPU_DEVICE AMREX_FORCE_INLINE
int
107 return (dir == 0) ? i : (dir == 1) ? j : k;
AMREX_GPU_HOST_DEVICE amrex::Box perpendicular_box(const amrex::Box &bx, const amrex::IntVect &iv)
Definition DirectionSelector.H:56
DirectionSelector< 0 > XDir
Definition DirectionSelector.H:47
DirectionSelector< 1 > YDir
Definition DirectionSelector.H:48
DirectionSelector< 2 > ZDir
Definition DirectionSelector.H:49
AMREX_GPU_DEVICE amrex::Box parallel_box(const amrex::Box &bx, const amrex::IntVect &iv)
Definition DirectionSelector.H:82
This test case is intended as an evaluation of the momentum advection scheme.
Definition BCInterface.cpp:10
AMREX_GPU_DEVICE AMREX_FORCE_INLINE int direction_selector(const int i, const int j, const int k, const int dir)
Definition DirectionSelector.H:105
Definition DirectionSelector.H:10
int operator()(int i, int j, int k) const