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

A List of Disjoint Boxes. More...

#include <AMReX_BoxDomain.H>

Inheritance diagram for amrex::BoxDomain:
amrex::BoxList

Public Types

using const_iterator = BoxList::const_iterator
 

Public Member Functions

 BoxDomain ()
 Construct an empty BoxDomain of IndexType::TheCellType(). More...
 
 BoxDomain (const Box &bx)
 A Box Domain out of single Box. More...
 
 BoxDomain (IndexType itype)
 Construct an empty BoxDomain of IndexType itype. More...
 
void add (const Box &b)
 Add a Box to the domain. More...
 
void add (const BoxList &bl)
 Add all Boxes in the BoxList to the domain. More...
 
BoxDomainrmBox (const Box &b)
 Remove a box from the domain. More...
 
bool ok () const
 
const BoxListboxList () const
 Return a const reference to the underlying BoxList of this BoxDomain. More...
 
bool operator== (const BoxDomain &rhs) const
 Are the BoxDomains equal? More...
 
bool operator!= (const BoxDomain &rhs) const
 Are the BoxDomains not equal? More...
 
BoxDomainrefine (int ratio)
 Refine all Boxes in the domain by the refinement ratio. More...
 
BoxDomaincoarsen (int ratio)
 Coarsen all Boxes in the domain by the refinement ratio. More...
 
BoxDomainintersect (const Box &b)
 Intersect this BoxDomain with Box b. More...
 
BoxDomainaccrete (int sz)
 Grow each Box by size sz. More...
 
BoxDomaincomplementIn (const Box &b, const BoxDomain &bl)
 Creates the complement of BoxDomain bl in Box b. More...
 
void clear ()
 Promoted from BoxList. More...
 
Long size () const noexcept
 Promoted from BoxList. More...
 
bool isEmpty () const noexcept
 Promoted from BoxList. More...
 
bool isNotEmpty () const noexcept
 Promoted from BoxList. More...
 
Box minimalBox () const
 Promoted from BoxList. More...
 
IndexType ixType () const noexcept
 Promoted from BoxList. More...
 
int simplify (bool best=false)
 Promoted from BoxList. More...
 
iterator begin () noexcept
 Promoted from BoxList. More...
 
const_iterator begin () const noexcept
 Promoted from BoxList. More...
 
iterator end () noexcept
 Promoted from BoxList. More...
 
const_iterator end () const noexcept
 Promoted from BoxList. More...
 
bool contains (const BoxList &bl) const
 Promoted from BoxList. More...
 
BoxListshift (int dir, int nzones)
 Promoted from BoxList. More...
 
BoxListshiftHalf (int dir, int num_halfs)
 Promoted from BoxList. More...
 
BoxListshiftHalf (const IntVect &iv)
 Promoted from BoxList. More...
 

Private Member Functions

 BoxDomain (BoxList &&bl)
 Construct from a BoxList that has no overlap. More...
 

Friends

class ClusterList
 

Additional Inherited Members

- Protected Types inherited from amrex::BoxList
using iterator = Vector< Box >::iterator
 
using const_iterator = Vector< Box >::const_iterator
 
- Protected Member Functions inherited from amrex::BoxList
 BoxList ()
 Construct an empty BoxList with IndexType::TheCellType(). More...
 
 BoxList (const Box &bx)
 Make a boxList consisting of a single Box. More...
 
 BoxList (IndexType _btype)
 Construct an empty BoxList with IndexType _btype. More...
 
 BoxList (const BoxArray &ba)
 Construct a BoxList from a BoxArray. More...
 
 BoxList (Vector< Box > &&bxs)
 Construct a boxlist from a rvalue Vector<Box>. More...
 
 BoxList (const Box &bx, const IntVect &tilesize)
 Make a boxList consisting of non-overlapping tile box from a single Box. More...
 
 BoxList (const Box &bx, int nboxes)
 Make a BoxList consisting of nboxes Boxes from a single Box. More...
 
 BoxList (const Box &bx, int nboxes, Direction dir)
 Make a BoxList consisting of nboxes Boxes chopped in dir-direction from a single Box. More...
 
 ~BoxList ()=default
 
 BoxList (const BoxList &rhs)=default
 
 BoxList (BoxList &&rhs)=default
 
BoxListoperator= (const BoxList &rhs)=default
 
BoxListoperator= (BoxList &&rhs)=default
 
void reserve (std::size_t n)
 
void push_back (const Box &bn)
 Append a Box to this BoxList. More...
 
Boxfront () noexcept
 
const Boxfront () const noexcept
 
void join (const BoxList &blist)
 Join the BoxList to ourselves. More...
 
void join (const Vector< Box > &barr)
 Join the Array of Boxes to ourselves. More...
 
void catenate (BoxList &blist)
 Catenate the BoxList to ourselves. Removes entries from blist. More...
 
void clear ()
 Remove all Boxes from this BoxList. More...
 
Long size () const noexcept
 The number of Boxes in this BoxList. More...
 
std::size_t capacity () const noexcept
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
const_iterator cbegin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cend () const noexcept
 
bool ok () const noexcept
 True if this BoxList is valid; i.e. all the Boxes are valid and they all have the same IndexType. Also returns true if the BoxList is empty. More...
 
bool operator== (const BoxList &rhs) const
 Is this BoxList equal to rhs? More...
 
bool operator!= (const BoxList &rhs) const
 Is this BoxList notequal to rhs? More...
 
bool isEmpty () const noexcept
 Is this BoxList empty? More...
 
bool isNotEmpty () const noexcept
 Is this BoxList not empty? More...
 
bool isDisjoint () const
 True if the set of intersecting Boxes is empty. More...
 
bool contains (const BoxList &bl) const
 True if all Boxes in bl are contained in this BoxList. More...
 
BoxListintersect (const Box &b)
 Modify this BoxList to contain only its intersection with Box b. More...
 
BoxListintersect (const BoxList &bl)
 Modify this BoxList to contain only its intersection with BoxList bl. More...
 
BoxListremoveEmpty ()
 Remove empty Boxes from this BoxList. More...
 
BoxListcomplementIn (const Box &b, const BoxList &bl)
 
BoxListcomplementIn (const Box &b, BoxList &&bl)
 
BoxListcomplementIn (const Box &b, const BoxArray &ba)
 
BoxListparallelComplementIn (const Box &b, const BoxList &bl)
 
BoxListparallelComplementIn (const Box &b, BoxList &&bl)
 
BoxListparallelComplementIn (const Box &b, const BoxArray &ba)
 
BoxListrefine (int ratio)
 Refine each Box in the BoxList by the ratio. More...
 
BoxListrefine (const IntVect &ratio)
 Refine each Box in the BoxList by the ratio. More...
 
BoxListcoarsen (int ratio)
 Coarsen each Box in the BoxList by the ratio. More...
 
BoxListcoarsen (const IntVect &ratio)
 Coarsen each Box in the BoxList by the ratio. More...
 
BoxListaccrete (int sz)
 Grow each Box in the BoxList by size sz. More...
 
BoxListaccrete (const IntVect &sz)
 
BoxListshift (int dir, int nzones)
 Applies Box::shift(int,int) to each Box in the BoxList. More...
 
BoxListshiftHalf (int dir, int num_halfs)
 Applies Box::shiftHalf(int,int) to each Box in the BoxList. More...
 
BoxListshiftHalf (const IntVect &iv)
 Applies Box::shiftHalf(IntVect) to each Box in BoxList. More...
 
int simplify (bool best=false)
 Merge adjacent Boxes in this BoxList. Return the number of Boxes merged. If "best" is specified we do a single bruteforce pass over the list checking each Box against all Boxes after it in the list to see if they can be merged. If "best" is not specified we limit how fair afield we look for possible matches. The "best" algorithm is O(N-squared) while the other algorithm is O(N). More...
 
int ordered_simplify ()
 Assuming the boxes are nicely ordered. More...
 
BoxListmaxSize (int chunk)
 Forces each Box in the BoxList to have sides of length <= chunk. More...
 
BoxListmaxSize (const IntVect &chunk)
 Forces each Box in the BoxList to have dimth side of length <= chunk[dim]. More...
 
Box minimalBox () const
 Returns smallest Box that contains all Boxes in this BoxList. More...
 
IndexType ixType () const noexcept
 Returns the IndexType of Boxes in this BoxList. More...
 
void set (IndexType ixtyp) noexcept
 Set the type of the BoxList. It's an error if the BoxList isn't empty. More...
 
BoxListsurroundingNodes () noexcept
 Applies surroundingNodes(Box) to each Box in BoxArray. See the documentation of Box for details. More...
 
BoxListsurroundingNodes (int dir) noexcept
 Applies surroundingNodes(Box,int) to each Box in BoxList. See the documentation of Box for details. More...
 
BoxListenclosedCells () noexcept
 Applies Box::enclosedCells() to each Box in the BoxList. More...
 
BoxListenclosedCells (int dir) noexcept
 Applies Box::enclosedCells(int) to each Box in the BoxList. More...
 
BoxListconvert (IndexType typ) noexcept
 Applies Box::convert(IndexType) to each Box in the BoxList. More...
 
Vector< Box > & data () noexcept
 Returns a reference to the Vector<Box>. More...
 
const Vector< Box > & data () const noexcept
 Returns a constant reference to the Vector<Box>. More...
 
void swap (BoxList &rhs) noexcept
 
void Bcast ()
 

Detailed Description

A List of Disjoint Boxes.

A BoxDomain is a BoxList with the restriction that Boxes in the list are disjoint. Note that a BoxDomain is NOT a BoxList due to the protected inheritance. This is a concrete class, not a polymorphic one.

Member Typedef Documentation

◆ const_iterator

Constructor & Destructor Documentation

◆ BoxDomain() [1/4]

amrex::BoxDomain::BoxDomain ( )

Construct an empty BoxDomain of IndexType::TheCellType().

◆ BoxDomain() [2/4]

amrex::BoxDomain::BoxDomain ( const Box bx)

A Box Domain out of single Box.

◆ BoxDomain() [3/4]

amrex::BoxDomain::BoxDomain ( IndexType  itype)
explicit

Construct an empty BoxDomain of IndexType itype.

◆ BoxDomain() [4/4]

amrex::BoxDomain::BoxDomain ( BoxList &&  bl)
explicitprivate

Construct from a BoxList that has no overlap.

Member Function Documentation

◆ accrete()

BoxDomain & amrex::BoxDomain::accrete ( int  sz)

Grow each Box by size sz.

◆ add() [1/2]

void amrex::BoxDomain::add ( const Box b)

Add a Box to the domain.

◆ add() [2/2]

void amrex::BoxDomain::add ( const BoxList bl)

Add all Boxes in the BoxList to the domain.

◆ begin() [1/2]

const_iterator amrex::BoxList::begin
inlinenoexcept

Promoted from BoxList.

◆ begin() [2/2]

iterator amrex::BoxList::begin
inlinenoexcept

Promoted from BoxList.

◆ boxList()

const BoxList & amrex::BoxDomain::boxList ( ) const

Return a const reference to the underlying BoxList of this BoxDomain.

◆ clear()

void amrex::BoxList::clear

Promoted from BoxList.

◆ coarsen()

BoxDomain & amrex::BoxDomain::coarsen ( int  ratio)

Coarsen all Boxes in the domain by the refinement ratio.

◆ complementIn()

BoxDomain & amrex::BoxDomain::complementIn ( const Box b,
const BoxDomain bl 
)

Creates the complement of BoxDomain bl in Box b.

◆ contains()

bool amrex::BoxList::contains

Promoted from BoxList.

◆ end() [1/2]

const_iterator amrex::BoxList::end
inlinenoexcept

Promoted from BoxList.

◆ end() [2/2]

iterator amrex::BoxList::end
inlinenoexcept

Promoted from BoxList.

◆ intersect()

BoxDomain & amrex::BoxDomain::intersect ( const Box b)

Intersect this BoxDomain with Box b.

◆ isEmpty()

bool amrex::BoxList::isEmpty
inlinenoexcept

Promoted from BoxList.

◆ isNotEmpty()

bool amrex::BoxList::isNotEmpty
inlinenoexcept

Promoted from BoxList.

◆ ixType()

IndexType amrex::BoxList::ixType
inlinenoexcept

Promoted from BoxList.

◆ minimalBox()

Box amrex::BoxList::minimalBox

Promoted from BoxList.

◆ ok()

bool amrex::BoxDomain::ok ( ) const

Returns True if this BoxDomain is valid. Checks for disjointness. Returns true if the BoxDomain is empty.

◆ operator!=()

bool amrex::BoxDomain::operator!= ( const BoxDomain rhs) const

Are the BoxDomains not equal?

◆ operator==()

bool amrex::BoxDomain::operator== ( const BoxDomain rhs) const

Are the BoxDomains equal?

◆ refine()

BoxDomain & amrex::BoxDomain::refine ( int  ratio)

Refine all Boxes in the domain by the refinement ratio.

◆ rmBox()

BoxDomain & amrex::BoxDomain::rmBox ( const Box b)

Remove a box from the domain.

◆ shift()

BoxList& amrex::BoxList::shift

Promoted from BoxList.

◆ shiftHalf() [1/2]

BoxList& amrex::BoxList::shiftHalf

Promoted from BoxList.

◆ shiftHalf() [2/2]

BoxList& amrex::BoxList::shiftHalf

Promoted from BoxList.

◆ simplify()

int amrex::BoxList::simplify

Promoted from BoxList.

◆ size()

Long amrex::BoxList::size
inlinenoexcept

Promoted from BoxList.

Friends And Related Function Documentation

◆ ClusterList

friend class ClusterList
friend

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