#include <source/hierarchy/boxes/BoxList.h>
Inheritance diagram for SAMRAI::hier::BoxList< DIM >:
Public Types | |
typedef tbox::List< Box< DIM > >::Iterator | Iterator |
Public Member Functions | |
BoxList () | |
BoxList (const Box< DIM > &box) | |
BoxList (const BoxList< DIM > &list) | |
BoxList (const BoxArray< DIM > &array) | |
BoxList< DIM > & | operator= (const BoxList< DIM > &list) |
~BoxList () | |
int | getNumberOfBoxes () const |
void | simplifyBoxes () |
void | unionBoxes (const Box< DIM > &box) |
void | unionBoxes (const BoxList< DIM > &boxes) |
void | removeIntersections (const Box< DIM > &takeaway) |
void | removeIntersections (const BoxList< DIM > &takeaway) |
void | removeIntersections (const Box< DIM > &box, const Box< DIM > &takeaway) |
void | intersectBoxes (const Box< DIM > &box) |
void | intersectBoxes (const BoxList< DIM > &boxes) |
void | coalesceBoxes () |
void | sortDescendingBoxSizes () |
int | getTotalSizeOfBoxes () const |
bool | contains (const Index< DIM > &p) const |
void | grow (const IntVector< DIM > &ghosts) |
void | shift (const IntVector< DIM > &offset) |
void | refine (const IntVector< DIM > &ratio) |
void | coarsen (const IntVector< DIM > &ratio) |
bool | boxesIntersect () const |
Box< DIM > | getBoundingBox () const |
void | print (std::ostream &os=tbox::plog) const |
typedef tbox::List< Box<DIM> >::Iterator SAMRAI::hier::BoxList< DIM >::Iterator |
The iterator for class BoxList<DIM>. This is a convenient alias to the list iterator tbox::List< Box<DIM> >Iterator.
Reimplemented from SAMRAI::tbox::List< TYPE >.
SAMRAI::hier::BoxList< DIM >::BoxList | ( | ) | [inline] |
Create an empty box list with no boxes.
SAMRAI::hier::BoxList< DIM >::BoxList | ( | const Box< DIM > & | box | ) |
Create a box list with one box in it.
SAMRAI::hier::BoxList< DIM >::BoxList | ( | const BoxList< DIM > & | list | ) |
Create a box list and copy the boxes from the argument list.
SAMRAI::hier::BoxList< DIM >::BoxList | ( | const BoxArray< DIM > & | array | ) |
Create a box list and copy the boxes from the argument array.
SAMRAI::hier::BoxList< DIM >::~BoxList | ( | ) | [inline] |
The destructor releases all list storage.
BoxList< DIM > & SAMRAI::hier::BoxList< DIM >::operator= | ( | const BoxList< DIM > & | list | ) |
Copy boxes from the argument list.
int SAMRAI::hier::BoxList< DIM >::getNumberOfBoxes | ( | ) | const [inline] |
Return integer number of boxes in the box list. Note that this function merely calls the getNumberOfItems() function in the tbox::List base class. This function is provided for convenience and consistency with the tbox::BoxArray class.
void SAMRAI::hier::BoxList< DIM >::simplifyBoxes | ( | ) |
Place the boxes on the list into a canonical ordering. The canonical ordering for boxes is defined such that boxes that lie next to each other in higher dimensions are coalesced together before boxes that lie next to each other in lower dimensions. This ordering provides a standard representation that can be used to compare box lists. The canonical ordering also does not allow any overlap between the boxes on the list. This routine is potentially expensive, since the running time is for N boxes. None of the domain calculus routines call simplifyBoxes(); all calls to simplify the boxes must be explicit. Note that this routine is distinct from coalesceBoxes(), which is not guaranteed to produce a canonical ordering.
void SAMRAI::hier::BoxList< DIM >::unionBoxes | ( | const Box< DIM > & | box | ) | [inline] |
Add the box to the list of boxes. Note that this routine does not simplify the box list. Thus, the new box may overlap with boxes that already reside on the list.
void SAMRAI::hier::BoxList< DIM >::unionBoxes | ( | const BoxList< DIM > & | boxes | ) | [inline] |
Add the boxes to the list of boxes. Note that this routine does not simplify the box list. Thus, the new boxes may overlap with boxes that already reside on the list.
void SAMRAI::hier::BoxList< DIM >::removeIntersections | ( | const Box< DIM > & | takeaway | ) |
Remove from the current boxlist the portions that intersect the box takeaway. This operation can be thought of as a set difference defined over the abstract AMR box index space. Performing the set difference will require time for a list with boxes.
void SAMRAI::hier::BoxList< DIM >::removeIntersections | ( | const BoxList< DIM > & | takeaway | ) |
Remove from the current boxlist the portions that intersect the boxes in the BoxList takeaway.
void SAMRAI::hier::BoxList< DIM >::removeIntersections | ( | const Box< DIM > & | box, | |
const Box< DIM > & | takeaway | |||
) |
A special version for the case where the BoxList is empty initially, this routine builds the list of boxes that get formed when intersecting box with takeaway. If the boxes do not intersect, box is added to the boxlist. This routine is primarily suited for applications which are looking only for the intersection of two boxes.
void SAMRAI::hier::BoxList< DIM >::intersectBoxes | ( | const Box< DIM > & | box | ) |
Intersect the current boxlist against the specified box. Performing the intersection will require time for a list with boxes.
void SAMRAI::hier::BoxList< DIM >::intersectBoxes | ( | const BoxList< DIM > & | boxes | ) |
Intersect the current boxlist against the specified boxlist. The intersection calculation will require time for boxlists with boxes.
void SAMRAI::hier::BoxList< DIM >::coalesceBoxes | ( | ) |
Combine any boxes in the list which may be coalesced. Two boxes may be coalesced if their union is a box (recall that boxes are not closed under index set unions). Empty boxes on the list are removed during this process. Note that this is potentially an expensive calculation (e.g., it will require box comparisons for a box list with boxes in the worst possible case). So this routine should be used sparingly. Also note that this routine is different than simplifyBoxes() since it does not produce a canonical ordering. In particular, this routine processes the boxes in the order in which they appear on the list, rather than attempting to coalesce boxes along specific coordinate directions before others.
void SAMRAI::hier::BoxList< DIM >::sortDescendingBoxSizes | ( | ) |
Sort the boxes in the list from largest to smallest in size. Recall that the size of a box is the number of cell indices it contains. This routine uses a heap sort algorithm which requires work in both average and worst case scenarios. Note that to obtain a box list from smallest to largest, the list elements can be reversed after this sorting routine is applied.
int SAMRAI::hier::BoxList< DIM >::getTotalSizeOfBoxes | ( | ) | const |
Count up the total number of indices in all the boxes in the list.
bool SAMRAI::hier::BoxList< DIM >::contains | ( | const Index< DIM > & | p | ) | const |
Check whether an index lies within the bounds of the collection of boxes.
void SAMRAI::hier::BoxList< DIM >::grow | ( | const IntVector< DIM > & | ghosts | ) |
Grow all boxes in the box list by the specified ghost cell width.
void SAMRAI::hier::BoxList< DIM >::shift | ( | const IntVector< DIM > & | offset | ) |
Shift all boxes in the box list by the specified offset.
void SAMRAI::hier::BoxList< DIM >::refine | ( | const IntVector< DIM > & | ratio | ) |
Refine the index space of each box in the box list by the specified vector refinement ratio.
void SAMRAI::hier::BoxList< DIM >::coarsen | ( | const IntVector< DIM > & | ratio | ) |
Coarsen the index space of each box in the box list by the specified vector coarsening ratio.
bool SAMRAI::hier::BoxList< DIM >::boxesIntersect | ( | ) | const |
Return true if there exists non-empty intersection among boxes in list; otherwise, return false.
Box< DIM > SAMRAI::hier::BoxList< DIM >::getBoundingBox | ( | ) | const |
Return the bounding box for all boxes in the box list.
void SAMRAI::hier::BoxList< DIM >::print | ( | std::ostream & | os = tbox::plog |
) | const |
Print all class member data for this bounding box list object to specified output stream.