2 #ifndef AMREX_RealBox_H_
3 #define AMREX_RealBox_H_
4 #include <AMReX_Config.H>
28 RealBox (const Real* a_lo, const Real* a_hi) noexcept
31 RealBox (
const std::array<Real,AMREX_SPACEDIM>& a_lo,
32 const std::array<Real,AMREX_SPACEDIM>& a_hi) noexcept;
38 RealBox (
const Box& bx,
const Real* dx,
const Real* base) noexcept;
46 const Real*
lo () const& noexcept {
return xlo; }
48 const Real*
lo () && =
delete;
51 const Real*
hi () const& noexcept {
return xhi; }
53 const Real*
hi () && =
delete;
56 Real
lo (
int dir)
const noexcept {
return xlo[dir]; }
59 Real
hi (
int dir)
const noexcept {
return xhi[dir]; }
70 void setLo (
int dir, Real a_lo) noexcept {
BL_ASSERT(dir >= 0 && dir < AMREX_SPACEDIM);
xlo[dir] = a_lo; }
78 void setHi (
int dir, Real a_hi) noexcept {
BL_ASSERT(dir >= 0 && dir < AMREX_SPACEDIM);
xhi[dir] = a_hi; }
81 bool ok () const noexcept {
83 #if (AMREX_SPACEDIM > 1)
86 #
if (AMREX_SPACEDIM > 2)
103 Real
eps = 0.0) const noexcept {
125 Real
eps = 0.0) const noexcept {
133 || (
xlo[1] > bx.xhi[1]) || (
xhi[1] < bx.xlo[1]),
134 || (
xlo[2] > bx.xhi[2]) || (
xhi[2] < bx.xlo[2])));
147 std::ostream&
operator<< (std::ostream&,
const RealBox&);
150 std::istream&
operator>> (std::istream&, RealBox&);
155 Real
eps = 0.0) noexcept;
#define BL_ASSERT(EX)
Definition: AMReX_BLassert.H:39
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
#define AMREX_D_EXPR(a, b, c)
Definition: AMReX_SPACE.H:81
#define AMREX_D_TERM(a, b, c)
Definition: AMReX_SPACE.H:129
#define AMREX_D_DECL(a, b, c)
Definition: AMReX_SPACE.H:104
A Box with real dimensions. A RealBox is OK iff volume >= 0.
Definition: AMReX_RealBox.H:21
AMREX_GPU_HOST_DEVICE RealBox(AMREX_D_DECL(Real x0, Real y0, Real z0), AMREX_D_DECL(Real x1, Real y1, Real z1)) noexcept
Explicit dimension specific constructors.
Definition: AMReX_RealBox.H:41
void setLo(int dir, Real a_lo) noexcept
Sets lo side in specified direction.
Definition: AMReX_RealBox.H:70
AMREX_GPU_HOST_DEVICE Real volume() const noexcept
Definition: AMReX_RealBox.H:95
constexpr RealBox() noexcept=default
The default constructor. Builds invalid RealBox.
AMREX_GPU_HOST_DEVICE bool ok() const noexcept
Is the RealBox OK; i.e. does it have non-negative volume?
Definition: AMReX_RealBox.H:81
void setLo(const Real *a_lo) noexcept
Sets lo side.
Definition: AMReX_RealBox.H:64
AMREX_GPU_HOST_DEVICE const Real * hi() &&=delete
void setHi(const Vector< Real > &a_hi) noexcept
Sets hi side.
Definition: AMReX_RealBox.H:74
void setHi(int dir, Real a_hi) noexcept
Sets hi side in specified direction.
Definition: AMReX_RealBox.H:78
AMREX_GPU_HOST_DEVICE bool contains(const Real *point, Real eps=0.0) const noexcept
Is the specified point contained in the RealBox?
Definition: AMReX_RealBox.H:102
AMREX_GPU_HOST_DEVICE bool contains(XDim3 point, Real eps=0.0) const noexcept
Is the specified point contained in the RealBox?
Definition: AMReX_RealBox.H:111
AMREX_GPU_HOST_DEVICE const Real * hi() const &noexcept
Returns hide side.
Definition: AMReX_RealBox.H:51
AMREX_GPU_HOST_DEVICE Real hi(int dir) const noexcept
Returns hi side in specified direction.
Definition: AMReX_RealBox.H:59
AMREX_GPU_HOST_DEVICE bool contains(const RealVect &rv, Real eps=0.0) const noexcept
Is the specified RealVect contained in this RealBox?
Definition: AMReX_RealBox.H:119
AMREX_GPU_HOST_DEVICE bool intersects(const RealBox &bx) const noexcept
Does the specified RealBox intersect with this RealBox?
Definition: AMReX_RealBox.H:131
void setHi(const RealVect &a_hi) noexcept
Sets hi side.
Definition: AMReX_RealBox.H:76
void setLo(const RealVect &a_lo) noexcept
Sets lo side.
Definition: AMReX_RealBox.H:68
void setLo(const Vector< Real > &a_lo) noexcept
Sets lo side.
Definition: AMReX_RealBox.H:66
AMREX_GPU_HOST_DEVICE const Real * lo() const &noexcept
Returns lo side.
Definition: AMReX_RealBox.H:46
void setHi(const Real *a_hi) noexcept
Sets hi side.
Definition: AMReX_RealBox.H:72
Real xlo[AMREX_SPACEDIM]
Definition: AMReX_RealBox.H:141
AMREX_GPU_HOST_DEVICE Real lo(int dir) const noexcept
Returns length in specified direction.
Definition: AMReX_RealBox.H:56
AMREX_GPU_HOST_DEVICE bool contains(const RealBox &rb, Real eps=0.0) const noexcept
Is the specified RealBox contained in this RealBox?
Definition: AMReX_RealBox.H:124
AMREX_GPU_HOST_DEVICE Real length(int dir) const noexcept
Returns length in specified direction.
Definition: AMReX_RealBox.H:62
AMREX_GPU_HOST_DEVICE const Real * lo() &&=delete
Real xhi[AMREX_SPACEDIM]
Definition: AMReX_RealBox.H:142
A Real vector in SpaceDim-dimensional space.
Definition: AMReX_RealVect.H:32
AMREX_GPU_HOST_DEVICE const Real * dataPtr() const noexcept
Definition: AMReX_RealVect.H:488
constexpr double eps
Definition: AMReX_MLNodeLap_K.H:19
Definition: AMReX_Amr.cpp:49
BoxND< AMREX_SPACEDIM > Box
Definition: AMReX_BaseFwd.H:27
bool AlmostEqual(const RealBox &box1, const RealBox &box2, Real eps) noexcept
Check for equality of real boxes within a certain tolerance.
Definition: AMReX_RealBox.cpp:84
std::ostream & operator<<(std::ostream &os, AmrMesh const &amr_mesh)
Definition: AMReX_AmrMesh.cpp:1236
std::istream & operator>>(std::istream &is, BoxND< dim > &bx)
Read from istream.
Definition: AMReX_Box.H:1700
Definition: AMReX_Dim3.H:13
Real x
Definition: AMReX_Dim3.H:13
Real z
Definition: AMReX_Dim3.H:13
Real y
Definition: AMReX_Dim3.H:13