Block-Structured AMR Software Framework
amrex::RealBox Class Reference

A Box with real dimensions. A RealBox is OK iff volume >= 0. More...

#include <AMReX_RealBox.H>

Public Member Functions

constexpr RealBox () noexcept=default
 The default constructor. Builds invalid RealBox. More...
 
AMREX_GPU_HOST_DEVICE RealBox (const Real *a_lo, const Real *a_hi) noexcept
 Construct region given diagonal points. More...
 
 RealBox (const std::array< Real, AMREX_SPACEDIM > &a_lo, const std::array< Real, AMREX_SPACEDIM > &a_hi) noexcept
 
 RealBox (const Box &bx, const Real *dx, const Real *base) noexcept
 Construct region given index box, cell spacing and physical location of index (0,0,0). More...
 
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. More...
 
AMREX_GPU_HOST_DEVICE const Real * lo () const &noexcept
 Returns lo side. More...
 
AMREX_GPU_HOST_DEVICE const Real * lo () &&=delete
 
AMREX_GPU_HOST_DEVICE const Real * hi () const &noexcept
 Returns hide side. More...
 
AMREX_GPU_HOST_DEVICE const Real * hi () &&=delete
 
AMREX_GPU_HOST_DEVICE Real lo (int dir) const noexcept
 Returns length in specified direction. More...
 
AMREX_GPU_HOST_DEVICE Real hi (int dir) const noexcept
 Returns hi side in specified direction. More...
 
AMREX_GPU_HOST_DEVICE Real length (int dir) const noexcept
 Returns length in specified direction. More...
 
void setLo (const Real *a_lo) noexcept
 Sets lo side. More...
 
void setLo (const Vector< Real > &a_lo) noexcept
 Sets lo side. More...
 
void setLo (const RealVect &a_lo) noexcept
 Sets lo side. More...
 
void setLo (int dir, Real a_lo) noexcept
 Sets lo side in specified direction. More...
 
void setHi (const Real *a_hi) noexcept
 Sets hi side. More...
 
void setHi (const Vector< Real > &a_hi) noexcept
 Sets hi side. More...
 
void setHi (const RealVect &a_hi) noexcept
 Sets hi side. More...
 
void setHi (int dir, Real a_hi) noexcept
 Sets hi side in specified direction. More...
 
AMREX_GPU_HOST_DEVICE bool ok () const noexcept
 Is the RealBox OK; i.e. does it have non-negative volume? More...
 
AMREX_GPU_HOST_DEVICE Real volume () const noexcept
 
AMREX_GPU_HOST_DEVICE bool contains (const Real *point, Real eps=0.0) const noexcept
 Is the specified point contained in the RealBox? More...
 
AMREX_GPU_HOST_DEVICE bool contains (XDim3 point, Real eps=0.0) const noexcept
 Is the specified point contained in the RealBox? More...
 
AMREX_GPU_HOST_DEVICE bool contains (const RealVect &rv, Real eps=0.0) const noexcept
 Is the specified RealVect contained in this RealBox? More...
 
AMREX_GPU_HOST_DEVICE bool contains (const RealBox &rb, Real eps=0.0) const noexcept
 Is the specified RealBox contained in this RealBox? More...
 
AMREX_GPU_HOST_DEVICE bool intersects (const RealBox &bx) const noexcept
 Does the specified RealBox intersect with this RealBox? More...
 

Private Attributes

Real xlo [AMREX_SPACEDIM] = {AMREX_D_DECL(Real(0.),Real(0.),Real(0.))}
 
Real xhi [AMREX_SPACEDIM] = {AMREX_D_DECL(Real(-1.),Real(-1.),Real(-1.))}
 

Detailed Description

A Box with real dimensions. A RealBox is OK iff volume >= 0.

Constructor & Destructor Documentation

◆ RealBox() [1/5]

constexpr amrex::RealBox::RealBox ( )
constexprdefaultnoexcept

The default constructor. Builds invalid RealBox.

◆ RealBox() [2/5]

AMREX_GPU_HOST_DEVICE amrex::RealBox::RealBox ( const Real *  a_lo,
const Real *  a_hi 
)
inlinenoexcept

Construct region given diagonal points.

◆ RealBox() [3/5]

amrex::RealBox::RealBox ( const std::array< Real, AMREX_SPACEDIM > &  a_lo,
const std::array< Real, AMREX_SPACEDIM > &  a_hi 
)
noexcept

◆ RealBox() [4/5]

amrex::RealBox::RealBox ( const Box bx,
const Real *  dx,
const Real *  base 
)
noexcept

Construct region given index box, cell spacing and physical location of index (0,0,0).

◆ RealBox() [5/5]

AMREX_GPU_HOST_DEVICE amrex::RealBox::RealBox ( AMREX_D_DECL(Real x0, Real y0, Real z0)  ,
AMREX_D_DECL(Real x1, Real y1, Real z1)   
)
inlinenoexcept

Explicit dimension specific constructors.

Member Function Documentation

◆ contains() [1/4]

AMREX_GPU_HOST_DEVICE bool amrex::RealBox::contains ( const Real *  point,
Real  eps = 0.0 
) const
inlinenoexcept

Is the specified point contained in the RealBox?

◆ contains() [2/4]

AMREX_GPU_HOST_DEVICE bool amrex::RealBox::contains ( const RealBox rb,
Real  eps = 0.0 
) const
inlinenoexcept

Is the specified RealBox contained in this RealBox?

◆ contains() [3/4]

AMREX_GPU_HOST_DEVICE bool amrex::RealBox::contains ( const RealVect rv,
Real  eps = 0.0 
) const
inlinenoexcept

Is the specified RealVect contained in this RealBox?

◆ contains() [4/4]

AMREX_GPU_HOST_DEVICE bool amrex::RealBox::contains ( XDim3  point,
Real  eps = 0.0 
) const
inlinenoexcept

Is the specified point contained in the RealBox?

◆ hi() [1/3]

AMREX_GPU_HOST_DEVICE const Real* amrex::RealBox::hi ( ) &&
delete

◆ hi() [2/3]

AMREX_GPU_HOST_DEVICE const Real* amrex::RealBox::hi ( ) const &
inlinenoexcept

Returns hide side.

◆ hi() [3/3]

AMREX_GPU_HOST_DEVICE Real amrex::RealBox::hi ( int  dir) const
inlinenoexcept

Returns hi side in specified direction.

◆ intersects()

AMREX_GPU_HOST_DEVICE bool amrex::RealBox::intersects ( const RealBox bx) const
inlinenoexcept

Does the specified RealBox intersect with this RealBox?

◆ length()

AMREX_GPU_HOST_DEVICE Real amrex::RealBox::length ( int  dir) const
inlinenoexcept

Returns length in specified direction.

◆ lo() [1/3]

AMREX_GPU_HOST_DEVICE const Real* amrex::RealBox::lo ( ) &&
delete

◆ lo() [2/3]

AMREX_GPU_HOST_DEVICE const Real* amrex::RealBox::lo ( ) const &
inlinenoexcept

Returns lo side.

◆ lo() [3/3]

AMREX_GPU_HOST_DEVICE Real amrex::RealBox::lo ( int  dir) const
inlinenoexcept

Returns length in specified direction.

◆ ok()

AMREX_GPU_HOST_DEVICE bool amrex::RealBox::ok ( ) const
inlinenoexcept

Is the RealBox OK; i.e. does it have non-negative volume?

◆ setHi() [1/4]

void amrex::RealBox::setHi ( const Real *  a_hi)
inlinenoexcept

Sets hi side.

◆ setHi() [2/4]

void amrex::RealBox::setHi ( const RealVect a_hi)
inlinenoexcept

Sets hi side.

◆ setHi() [3/4]

void amrex::RealBox::setHi ( const Vector< Real > &  a_hi)
inlinenoexcept

Sets hi side.

◆ setHi() [4/4]

void amrex::RealBox::setHi ( int  dir,
Real  a_hi 
)
inlinenoexcept

Sets hi side in specified direction.

◆ setLo() [1/4]

void amrex::RealBox::setLo ( const Real *  a_lo)
inlinenoexcept

Sets lo side.

◆ setLo() [2/4]

void amrex::RealBox::setLo ( const RealVect a_lo)
inlinenoexcept

Sets lo side.

◆ setLo() [3/4]

void amrex::RealBox::setLo ( const Vector< Real > &  a_lo)
inlinenoexcept

Sets lo side.

◆ setLo() [4/4]

void amrex::RealBox::setLo ( int  dir,
Real  a_lo 
)
inlinenoexcept

Sets lo side in specified direction.

◆ volume()

AMREX_GPU_HOST_DEVICE Real amrex::RealBox::volume ( ) const
inlinenoexcept

Returns the volume of the RealBox. If this RealBox is invalid, it's volume is considered to be zero.

Member Data Documentation

◆ xhi

Real amrex::RealBox::xhi[AMREX_SPACEDIM] = {AMREX_D_DECL(Real(-1.),Real(-1.),Real(-1.))}
private

◆ xlo

Real amrex::RealBox::xlo[AMREX_SPACEDIM] = {AMREX_D_DECL(Real(0.),Real(0.),Real(0.))}
private

The documentation for this class was generated from the following files: