4#include <AMReX_Config.H>
57 BCRec (
const int* a_lo,
const int* a_hi) noexcept
74 const BCRec& bc_domain)
noexcept
76 const int* bxlo = bx.loVect();
77 const int* bxhi = bx.hiVect();
78 const int* dlo = domain.loVect();
79 const int* dhi = domain.hiVect();
80 for (
int dir = 0; dir < AMREX_SPACEDIM; dir++)
83 int ihi = dir+AMREX_SPACEDIM;
84 bc[ilo] = ( bxlo[dir]<=dlo[dir] ? bc_domain.bc[ilo] :
BCType::int_dir );
85 bc[ihi] = ( bxhi[dir]>=dhi[dir] ? bc_domain.bc[ihi] :
BCType::int_dir );
94 void setLo (
int dir,
int bc_val)
noexcept { bc[dir] = bc_val; }
101 void setHi (
int dir,
int bc_val)
noexcept { bc[AMREX_SPACEDIM+dir] = bc_val; }
110 setLo(face.coordDir(), bc_val);
112 setHi(face.coordDir(), bc_val);
117 const int*
vect () const& noexcept{
return bc; }
118 const int*
vect () && =
delete;
122 const int*
data () const& noexcept {
return bc; }
123 const int*
data () && =
delete;
127 const int*
lo () const& noexcept {
return bc; }
128 const int*
lo () && =
delete;
131 const int*
hi () const& noexcept {
return bc+AMREX_SPACEDIM; }
132 const int*
hi () && =
delete;
135 int lo (
int dir)
const noexcept {
return bc[dir]; }
138 int hi (
int dir)
const noexcept {
return bc[AMREX_SPACEDIM+dir]; }
143 for (
int i = 0; i < 2*AMREX_SPACEDIM && retval; i++)
145 retval &= bc[i] == rhs.bc[i];
177 const int* bxlo = bx.loVect();
178 const int* bxhi = bx.hiVect();
179 const int* dlo = domain.loVect();
180 const int* dhi = domain.hiVect();
181 for (
int dir = 0; dir < AMREX_SPACEDIM; dir++)
183 bcr.setLo(dir, ( bxlo[dir]<=dlo[dir] ? bc_dom.lo(dir) :
BCType::int_dir ));
184 bcr.setHi(dir, ( bxhi[dir]>=dhi[dir] ? bc_dom.hi(dir) :
BCType::int_dir ));
205 const Vector<BCRec>& bc_dom,
206 Vector<BCRec>& bcr)
noexcept;
Enumerations describing physical and mathematical boundary types.
Integer-lattice boxes and helpers for defining index-space regions.
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:124
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
Boundary condition record storing low/high face types per coordinate.
Definition AMReX_BCRec.H:25
const int * vect() &&=delete
const int * data() &&=delete
__host__ __device__ BCRec(const Box &bx, const Box &domain, const BCRec &bc_domain) noexcept
Initialize boundary faces relative to a domain record.
Definition AMReX_BCRec.H:72
__host__ __device__ int lo(int dir) const noexcept
Return the low-end boundary code for dimension dir.
Definition AMReX_BCRec.H:135
__host__ __device__ const int * data() const &noexcept
Equivalent to vect(); returns the same pointer to the internal boundary array.
Definition AMReX_BCRec.H:122
__host__ __device__ BCRec(const int *a_lo, const int *a_hi) noexcept
Construct from arrays of low/high face types.
Definition AMReX_BCRec.H:57
__host__ __device__ const int * hi() const &noexcept
Return pointer to the high-end face array.
Definition AMReX_BCRec.H:131
__host__ __device__ bool operator!=(const BCRec &rhs) const noexcept
Logical negation of operator==.
Definition AMReX_BCRec.H:151
__host__ __device__ const int * lo() const &noexcept
Return pointer to the low-end face array.
Definition AMReX_BCRec.H:127
const int * hi() &&=delete
__host__ __device__ bool operator==(const BCRec &rhs) const noexcept
Compare two records for identical boundary condition values.
Definition AMReX_BCRec.H:141
__host__ __device__ const int * vect() const &noexcept
Return pointer to the internal boundary array (low faces, then high faces). Legacy name for Fortran c...
Definition AMReX_BCRec.H:117
friend std::ostream & operator<<(std::ostream &, const BCRec &)
ASCII write to ostream.
Definition AMReX_BCRec.cpp:35
const int * lo() &&=delete
__host__ __device__ void setLo(int dir, int bc_val) noexcept
Set the low-face boundary for dimension dir.
Definition AMReX_BCRec.H:94
__host__ __device__ int hi(int dir) const noexcept
Return the high-end boundary code for dimension dir.
Definition AMReX_BCRec.H:138
__host__ __device__ void setHi(int dir, int bc_val) noexcept
Set the high-face boundary for dimension dir.
Definition AMReX_BCRec.H:101
__host__ __device__ void set(Orientation face, int bc_val) noexcept
Explicitly set the boundary value for a given face.
Definition AMReX_BCRec.H:108
__host__ __device__ BCRec() noexcept=default
Default constructor leaves all face types set to BCType::bogus.
Encapsulation of the Orientation of the Faces of a Box.
Definition AMReX_Orientation.H:29
@ int_dir
Definition AMReX_BC_TYPES.H:89
@ bogus
Definition AMReX_BC_TYPES.H:87
Definition AMReX_Amr.cpp:50
BoxND< 3 > Box
Box is an alias for amrex::BoxND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:35
void setBC(const Box &bx, const Box &domain, int src_comp, int dest_comp, int ncomp, const Vector< BCRec > &bc_dom, Vector< BCRec > &bcr) noexcept
Populate a span of BCRec objects based on a domain record.
Definition AMReX_BCRec.cpp:8