4#include <AMReX_Config.H>
48 void boxDiff (BoxList& bl_diff,
const Box& b1in,
const Box& b2);
56 BoxList
refine (
const BoxList& bl,
int ratio);
64 BoxList
coarsen (
const BoxList& bl,
int ratio);
80 BoxList
accrete (
const BoxList& bl,
int sz);
97 std::ostream&
operator<< (std::ostream& os,
const BoxList& blist);
148 void reserve (std::size_t n) { m_lbox.reserve(n); }
152 if (m_lbox.empty()) { btype = bn.
ixType(); }
154 m_lbox.push_back(bn);
161 [[nodiscard]]
const Box&
front () const noexcept {
BL_ASSERT(!m_lbox.empty());
return m_lbox.front(); }
173 [[nodiscard]]
Long size () const noexcept {
return m_lbox.size(); }
176 [[nodiscard]] std::size_t
capacity () const noexcept {
return m_lbox.capacity(); }
196 [[nodiscard]]
bool ok () const noexcept;
198 bool operator== (const
BoxList& rhs) const;
200 bool operator!= (const
BoxList& rhs) const;
202 [[nodiscard]]
bool isEmpty () const noexcept {
return m_lbox.empty(); }
204 [[nodiscard]]
bool isNotEmpty () const noexcept {
return !m_lbox.empty(); }
369 std::swap(m_lbox, rhs.m_lbox);
370 std::swap(btype, rhs.btype);
378 int simplify_doit (
int depth);
Fixed-size array types for use on GPU and CPU.
#define BL_ASSERT(EX)
Definition AMReX_BLassert.H:39
Integer-lattice boxes and helpers for defining index-space regions.
Reference-counted collection of Boxes.
Definition AMReX_BoxArray.H:676
A list of disjoint boxes built on top of BoxList.
Definition AMReX_BoxDomain.H:95
A list of Boxes sharing a common IndexType.
Definition AMReX_BoxList.H:109
bool ok() const noexcept
True if this BoxList is valid; i.e. all the Boxes are valid and they all have the same IndexType....
Definition AMReX_BoxList.cpp:235
bool contains(const BoxList &bl) const
True if all Boxes in bl are contained in this BoxList.
Definition AMReX_BoxList.cpp:252
const_iterator cend() const noexcept
Return a const iterator past the last Box.
Definition AMReX_BoxList.H:190
bool isDisjoint() const
True if the set of intersecting Boxes is empty.
Definition AMReX_BoxList.cpp:242
BoxList & convert(IndexType typ) noexcept
Applies Box::convert(IndexType) to each Box in the BoxList.
Definition AMReX_BoxList.cpp:865
BoxList & refine(int ratio)
Refine each Box in the BoxList by a uniform ratio.
Definition AMReX_BoxList.cpp:503
void clear()
Remove all Boxes from this BoxList.
Definition AMReX_BoxList.cpp:65
BoxList & shiftHalf(int dir, int num_halfs)
Apply Box::shiftHalf(dir, num_halfs) to every Box in the list.
Definition AMReX_BoxList.cpp:573
BoxList & coarsen(int ratio)
Coarsen each Box in the BoxList by a uniform ratio.
Definition AMReX_BoxList.cpp:523
const Box & front() const noexcept
Return a const reference to the first Box in the list.
Definition AMReX_BoxList.H:161
IndexType ixType() const noexcept
Returns the IndexType of Boxes in this BoxList.
Definition AMReX_BoxList.H:342
const_iterator cbegin() const noexcept
Return a const iterator to the first Box.
Definition AMReX_BoxList.H:183
BoxList()
Construct an empty BoxList with IndexType::TheCellType().
Definition AMReX_BoxList.cpp:146
const_iterator end() const noexcept
Return a const iterator past the last Box.
Definition AMReX_BoxList.H:188
BoxList & intersect(const Box &b)
Modify this BoxList to contain only its intersection with Box b.
Definition AMReX_BoxList.cpp:265
iterator end() noexcept
Return an iterator past the last Box.
Definition AMReX_BoxList.H:186
Vector< Box > & data() noexcept
Returns a reference to the Vector<Box>.
Definition AMReX_BoxList.H:363
const Vector< Box > & data() const noexcept
Returns a constant reference to the Vector<Box>.
Definition AMReX_BoxList.H:365
void catenate(BoxList &blist)
Catenate the BoxList to ourselves. Removes entries from blist.
Definition AMReX_BoxList.cpp:85
bool isEmpty() const noexcept
Is this BoxList empty?
Definition AMReX_BoxList.H:202
void set(IndexType ixtyp) noexcept
Set the type of the BoxList. It's an error if the BoxList isn't empty.
Definition AMReX_BoxList.H:344
BoxList(const BoxList &rhs)=default
std::size_t capacity() const noexcept
Return the current allocated capacity.
Definition AMReX_BoxList.H:176
void Bcast()
Broadcast this BoxList from the I/O processor to all other processors.
Definition AMReX_BoxList.cpp:908
BoxList(BoxList &&rhs)=default
bool isNotEmpty() const noexcept
Is this BoxList not empty?
Definition AMReX_BoxList.H:204
void reserve(std::size_t n)
Reserve storage for at least n Boxes.
Definition AMReX_BoxList.H:148
int simplify(bool best=false)
Merge adjacent Boxes in this BoxList. Return the number of Boxes merged. If "best" is specified we do...
Definition AMReX_BoxList.cpp:652
const_iterator begin() const noexcept
Return a const iterator to the first Box.
Definition AMReX_BoxList.H:181
BoxList & surroundingNodes() noexcept
Applies surroundingNodes(Box) to each Box in BoxArray. See the documentation of Box for details.
Definition AMReX_BoxList.cpp:825
BoxList & enclosedCells() noexcept
Applies Box::enclosedCells() to each Box in the BoxList.
Definition AMReX_BoxList.cpp:845
Box & front() noexcept
Return a reference to the first Box in the list.
Definition AMReX_BoxList.H:158
void swap(BoxList &rhs) noexcept
Swap contents with another BoxList.
Definition AMReX_BoxList.H:368
BoxList & accrete(int sz)
Grow each Box in the BoxList by sz cells in every direction.
Definition AMReX_BoxList.cpp:543
BoxList & parallelComplementIn(const Box &b, const BoxList &bl)
Parallel version of complementIn using BoxList.
Definition AMReX_BoxList.cpp:397
BoxList & maxSize(int chunk)
Forces each Box in the BoxList to have sides of length <= chunk.
Definition AMReX_BoxList.cpp:819
void push_back(const Box &bn)
Append a Box to this BoxList.
Definition AMReX_BoxList.H:151
int ordered_simplify()
Merge adjacent Boxes assuming the list is already sorted/ordered.
Definition AMReX_BoxList.cpp:668
iterator begin() noexcept
Return an iterator to the first Box.
Definition AMReX_BoxList.H:179
BoxList & removeEmpty()
Remove empty Boxes from this BoxList.
Definition AMReX_BoxList.cpp:93
Long size() const noexcept
The number of Boxes in this BoxList.
Definition AMReX_BoxList.H:173
Box minimalBox() const
Returns smallest Box that contains all Boxes in this BoxList.
Definition AMReX_BoxList.cpp:747
Vector< Box >::iterator iterator
Definition AMReX_BoxList.H:114
BoxList & complementIn(const Box &b, const BoxList &bl)
Set this BoxList to the complement of BoxList bl in Box b.
Definition AMReX_BoxList.cpp:305
Vector< Box >::const_iterator const_iterator
Definition AMReX_BoxList.H:115
BoxList & shift(int dir, int nzones)
Apply Box::shift(dir, nzones) to every Box in the list.
Definition AMReX_BoxList.cpp:563
BoxList & operator=(const BoxList &rhs)=default
void join(const BoxList &blist)
Join the BoxList to ourselves.
Definition AMReX_BoxList.cpp:71
__host__ __device__ IndexTypeND< dim > ixType() const noexcept
Return the indexing type.
Definition AMReX_Box.H:148
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition AMReX_Vector.H:29
amrex_long Long
Definition AMReX_INT.H:30
__host__ __device__ BoxND< dim > coarsen(const BoxND< dim > &b, int ref_ratio) noexcept
Return a copy of b coarsened by the isotropic ratio ref_ratio.
Definition AMReX_Box.H:1469
__host__ __device__ BoxND< dim > refine(const BoxND< dim > &b, int ref_ratio) noexcept
Return a copy of b refined by the isotropic ratio ref_ratio.
Definition AMReX_Box.H:1510
Definition AMReX_Amr.cpp:50
std::ostream & operator<<(std::ostream &os, AmrMesh const &amr_mesh)
Stream helper; forwards to the friend declared inside AmrMesh.
Definition AMReX_AmrMesh.cpp:1306
void accrete(BoxDomain &dest, const BoxDomain &fin, int sz)
Grow each Box in BoxDomain fin by size sz.
Definition AMReX_BoxDomain.cpp:45
BoxArray intersect(const BoxArray &ba, const Box &b, int ng)
Make a BoxArray from the intersection of Box b and BoxArray(+ghostcells).
Definition AMReX_BoxArray.cpp:1717
BoxND< 3 > Box
Box is an alias for amrex::BoxND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:35
BoxList boxDiff(const Box &b1in, const Box &b2)
Returns a BoxList defining the complement of b2 in b1in.
Definition AMReX_BoxList.cpp:597
BoxArray complementIn(const Box &b, const BoxArray &ba)
Make a BoxArray from the complement of ba within the Box b.
Definition AMReX_BoxArray.cpp:1710
Direction
Definition AMReX_Orientation.H:14
BoxList removeOverlap(const BoxList &bl)
Return BoxList which covers the same area but has no overlapping boxes.
Definition AMReX_BoxList.cpp:133