|
IBAMR
IBAMR version 0.20.
|
#include <BoxList.h>

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 |
| bool | isEmpty () const |
| int | getNumberOfItems () const |
| int | size () const |
| void | addItem (const Box< DIM > &item) |
| void | addItemBefore (ListIterator< Box< DIM > > &iter, const Box< DIM > &item) |
| void | addItemAfter (ListIterator< Box< DIM > > &iter, const Box< DIM > &item) |
| void | appendItem (const Box< DIM > &item) |
| void | copyItems (const List< Box< DIM > > &list) |
| void | catenateItems (List< Box< DIM > > &list) |
| void | catenateItemsAtFront (List< Box< DIM > > &list) |
| void | clearItems () |
| Box< DIM > & | getFirstItem () const |
| Box< DIM > & | getLastItem () const |
| void | removeFirstItem () |
| void | removeLastItem () |
| void | removeItem (ListIterator< Box< DIM > > &iter) |
| void | reverse () |
| List< Box< DIM > >::Iterator | listStart () const |
| List< Box< DIM > >::Iterator | listEnd () const |
Static Public Member Functions | |
| static void | freeCachedListItems () |
Private Member Functions | |
| void | burstBoxes (const Box< DIM > &bursty, const Box< DIM > &solid, const int dimension) |
| void | newBurstBoxes (const Box< DIM > &bursty, const Box< DIM > &solid, const int dimension) |
Static Private Member Functions | |
| static void | heapify (Box< DIM > **heap, const int i, const int j) |
Private Attributes | |
| int | d_number_items |
| ListNode< Box< DIM > > * | d_list_head |
| ListNode< Box< DIM > > * | d_list_tail |
Class BoxList represents a linked list of boxes. It defines basic box calculus operations such as set intersection, union, and difference.
| 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.
| SAMRAI::hier::BoxList< DIM >::BoxList | ( | ) |
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 | ( | ) |
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 |
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 \(O(N^2)\) 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 | ) |
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 | ) |
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 \(O(N)\) time for a list with \(N\) 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 \(O(N)\) time for a list with \(N\) boxes.
| void SAMRAI::hier::BoxList< DIM >::intersectBoxes | ( | const BoxList< DIM > & | boxes | ) |
Intersect the current boxlist against the specified boxlist. The intersection calculation will require \(O(N^2)\) time for boxlists with \(N\) 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 \((N-1)!\) box comparisons for a box list with \(N\) 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 \(O(N*logN)\) 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.
|
private |
|
private |
|
staticprivate |
Sort boxes in list from largest to smallest in size with a heap sort.
|
staticinherited |
Free cached list nodes. A cached list of list nodes is used to speed allocation and deallocation of list items. This call will return this cached memory to the free memory pool.
|
inherited |
Check whether a list is empty (has no elements).
|
inherited |
Return the number of items in the list.
|
inherited |
Return the number of items in the list. Identical to getNumberOfItems(), but this method is common to several container classes.
|
inherited |
Add a new item to the head of the list.
|
inherited |
Add a new item to the list before the item pointed to by the specified iterator.
|
inherited |
Add a new item to the list after the item pointed to by the specified iterator.
|
inherited |
Add a new item to the tail of the list.
|
inherited |
Copy list items from the argument list. The new items are appended to the end of the current list. The argument list is not modified.
|
inherited |
Catenate list items from the argument list to the end of the current list. Unline copyItems(), the argument list is set to null.
|
inherited |
Catenate list items from the argument list to the front of the current list. Unline copyItems(), the argument list is set to null.
|
inherited |
Empty the list. All list items are deallocated.
|
inherited |
Return a reference to the first item in the list. This operation is not defined if the list is empty. This member function is const since it cannot change the list, although the item in the list may change.
|
inherited |
Return a reference to the last item in the list. This operation is not defined if the list is empty. This member function is const since it cannot change the list, although the item in the list may change.
|
inherited |
Remove (deallocate) the first item in the list.
|
inherited |
Remove (deallocate) the last item in the list.
|
inherited |
Remove (deallocate) the item pointed to by the iterator. After performing the remove, the iterator becomes invalid. Iterators that point to other elements in the list remain valid after the deletion of an item.
|
inherited |
Reverse all elements in the list. This operation is performed in-place by swapping next and previous list element pointers.
|
inherited |
Return a List<TYPE>::Iterator that points to the start of the list.
|
inherited |
Return a List<TYPE>::Iterator that points to the end of the list.
|
privateinherited |
|
privateinherited |
|
privateinherited |