SAMRAI::hier::BoxTop< DIM > Class Template Reference

#include <source/hierarchy/boxes/BoxTop.h>

List of all members.

Public Member Functions

 ~BoxTop ()
void findOverlappingBoxes (BoxArray< DIM > &overlaps, const Box< DIM > &box)
 Compute the set of boxes that overlap with the specified box.
void findOverlappingBoxIndices (tbox::Array< int > &indices, const Box< DIM > &box)
 Compute the indices of the boxes that overlap the specified box.
void findOverlappingBoxesAndIndices (BoxArray< DIM > &overlaps, tbox::Array< int > &indices, const Box< DIM > &box)
 Compute the set of boxes, and their indices, that overlap with the specified box.
void removeIntersections (BoxList< DIM > &list)
 Remove from list the portions that intersect the boxes in the BoxArray that was passed to the constructor.
void print (std::ostream &os=tbox::plog)
 Undocumented function, used during development and testing.


Detailed Description

template<int DIM>
class SAMRAI::hier::BoxTop< DIM >

Class BoxTop is a utility class that provides functionality that can be used to reduce the runtime complexity of certain box calculus operations.

A BoxTop object is constructed by passing the ctor a BoxArray; this array is used internally to setup private data structures that will be used in subsequent methods, described below. If the BoxArray contains n boxes, then the setup phase (which is invoked by the constructor) has a runtime complexity of O(n log(n)).

Following construction, two types of operations are supported. First, the three related functions findOverlappingBoxes, findOverlappingBoxIndices, and findOverlappingBoxesAndIndices take a box as input, and compute the subset of the boxes, and/or the indices of the boxes, that overlap with the box.

Second, the removeIntersections call takes a list of boxes as input, and removes those portions that intersect with the boxes in the BoxArray that was passed to the constructor.

See also:
hier::Box

hier::BoxArray


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::hier::BoxTop< DIM >::BoxTop ( const BoxArray< DIM > &  in_boxes,
const tbox::Array< tbox::List< IntVector< DIM > > > &  in_shifts 
)

Constructor for BoxTop.

Parameters:
in_boxes input array of boxes.
in_shifts contains a shift vector associated with each boxes.

template<int DIM>
SAMRAI::hier::BoxTop< DIM >::BoxTop ( const BoxArray< DIM > &  in_boxes  ) 

Constructor for BoxTop.

Parameters:
in_boxes input array of boxes.

template<int DIM>
SAMRAI::hier::BoxTop< DIM >::~BoxTop (  ) 

The destructor releases privately held resources.

template<int DIM>
SAMRAI::hier::BoxTop< DIM >::BoxTop ( const BoxArray< DIM > &  in_boxes,
const tbox::Array< tbox::List< IntVector< DIM > > > &  in_shifts 
)

Constructor for BoxTop.

Parameters:
in_boxes input array of boxes.
in_shifts contains a shift vector associated with each boxes.

template<int DIM>
SAMRAI::hier::BoxTop< DIM >::BoxTop ( const BoxArray< DIM > &  in_boxes  ) 

Constructor for BoxTop.

Parameters:
in_boxes input array of boxes.


Member Function Documentation

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::findOverlappingBoxes ( BoxArray< DIM > &  overlaps,
const Box< DIM > &  box 
)

Compute the set of boxes that overlap with the specified box.

The return array, overlaps, contains the subset of the boxes that were passed to the constructor that overlap the box.

Parameters:
overlaps the subset of boxes, from the array that was passed to the ctor, that overlap the specified box.
box the specified box whose overlaps are requested.

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::findOverlappingBoxIndices ( tbox::Array< int > &  indices,
const Box< DIM > &  box 
)

Compute the indices of the boxes that overlap the specified box.

The return array, indices, contains the indices of the boxes (in the BoxArray that was passed to the constructor) that overlap the specified box.

Parameters:
indices the indices of the overlapping boxes.
box the specified box whose overlaps are requested.

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::findOverlappingBoxesAndIndices ( BoxArray< DIM > &  overlaps,
tbox::Array< int > &  indices,
const Box< DIM > &  box 
)

Compute the set of boxes, and their indices, that overlap with the specified box.

The return array, overlaps, contains the subset of the boxes that were passed to the constructor that overlap the box. The returned array, indices, contains an index for each box in overlaps; each index is the corresponding box's index w.r.t. the BoxArray that was passed to the constructor.

Parameters:
overlaps the subset of boxes, from the array that was passed to the ctor, that overlap the specified box.
indices the indices of the overlapping boxes.
box the specified box whose overlaps are requested.

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::removeIntersections ( BoxList< DIM > &  list  ) 

Remove from list the portions that intersect the boxes in the BoxArray that was passed to the constructor.

CAUTION: the semantics of this call differ from that of BoxList::removeIntersections(const BoxList<DIM> takeaway). Here, the list that is being modified is the list that is passed as an argument; the "takeaway" list is the list that was passed when the BoxTop object was constructed.

Parameters:
list the list of boxes from which intersections are to be removed.

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::print ( std::ostream &  os = tbox::plog  ) 

Undocumented function, used during development and testing.


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:28:27 2009 for SAMRAI by  doxygen 1.5.1