7#ifndef DirectionSelector_H
8#define DirectionSelector_H
23 AMREX_GPU_DEVICE
int operator()(
int i,
int ,
int )
const
34 AMREX_GPU_DEVICE
int operator()(
int ,
int j,
int )
const
45 AMREX_GPU_DEVICE
int operator()(
int ,
int ,
int k)
const
60template <
typename IndexSelector>
61AMREX_GPU_HOST_DEVICE amrex::Box
64 amrex::IntVect plane_lo, plane_hi;
66 if (std::is_same_v<IndexSelector, XDir>) {
67 plane_lo = {iv[0], bx.smallEnd(1), bx.smallEnd(2)};
68 plane_hi = {iv[0], bx.bigEnd(1), bx.bigEnd(2)};
69 }
else if (std::is_same_v<IndexSelector, YDir>) {
70 plane_lo = {bx.smallEnd(0), iv[1], bx.smallEnd(2)};
71 plane_hi = {bx.bigEnd(0), iv[1], bx.bigEnd(2)};
73 plane_lo = {bx.smallEnd(0), bx.smallEnd(1), iv[2]};
74 plane_hi = {bx.bigEnd(0), bx.bigEnd(1), iv[2]};
77 amrex::Box pbx(plane_lo, plane_hi);
86template <
typename IndexSelector>
87AMREX_GPU_DEVICE amrex::Box
90 amrex::IntVect line_lo, line_hi;
92 if (std::is_same_v<IndexSelector, XDir>) {
93 line_lo = {bx.smallEnd(0), iv[1], iv[2]};
94 line_hi = {bx.bigEnd(0), iv[1], iv[2]};
95 }
else if (std::is_same_v<IndexSelector, YDir>) {
96 line_lo = {iv[0], bx.smallEnd(1), iv[2]};
97 line_hi = {iv[0], bx.bigEnd(1), iv[2]};
99 line_lo = {iv[0], iv[1], bx.smallEnd(2)};
100 line_hi = {iv[0], iv[1], bx.bigEnd(2)};
103 amrex::Box lbx(line_lo, line_hi);
110AMREX_GPU_DEVICE AMREX_FORCE_INLINE
int
113 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:62
DirectionSelector< 0 > XDir
Definition DirectionSelector.H:53
DirectionSelector< 1 > YDir
Definition DirectionSelector.H:54
DirectionSelector< 2 > ZDir
Definition DirectionSelector.H:55
AMREX_GPU_DEVICE amrex::Box parallel_box(const amrex::Box &bx, const amrex::IntVect &iv)
Definition DirectionSelector.H:88
This test case is intended as an evaluation of the momentum advection scheme.
Definition BCInterface.cpp:7
AMREX_GPU_DEVICE AMREX_FORCE_INLINE int direction_selector(const int i, const int j, const int k, const int dir)
Definition DirectionSelector.H:111
Definition DirectionSelector.H:16
int operator()(int i, int j, int k) const