#include "AMReX_Box.H"
#include "AMReX_Gpu.H"
Go to the source code of this file.
|
template<typename IndexSelector > |
AMREX_GPU_HOST_DEVICE amrex::Box | PerpendicularBox (const amrex::Box &bx, const amrex::IntVect &iv) |
|
template<typename IndexSelector > |
AMREX_GPU_HOST_DEVICE amrex::Box | ParallelBox (const amrex::Box &bx, const amrex::IntVect &iv) |
|
◆ XDir
◆ YDir
◆ ZDir
◆ ParallelBox()
template<typename IndexSelector >
AMREX_GPU_HOST_DEVICE amrex::Box ParallelBox |
( |
const amrex::Box & |
bx, |
|
|
const amrex::IntVect & |
iv |
|
) |
| |
Given a box, return a 1D box parallel to the selected axis. For example, if we're using ZDir, return a box covering the z axis. The IntVect is used to set the constant indices in the perpendicular direction.
- Parameters
-
[in] | bx | Initial box for computing of perpendicular box |
[in] | iv | IntVect defining the perpendicular direction |
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());
◆ PerpendicularBox()
template<typename IndexSelector >
AMREX_GPU_HOST_DEVICE amrex::Box PerpendicularBox |
( |
const amrex::Box & |
bx, |
|
|
const amrex::IntVect & |
iv |
|
) |
| |
Given a box, return a 2D box perpendicular to the selected axis. For example, if we're using ZDir, return a box covering the x-y plane. The IntVect is used to set the constant index in the parallel direction.
- Parameters
-
[in] | bx | Initial box for computing of perpendicular box |
[in] | iv | IntVect defining the perpendicular direction |
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());