IBAMR  IBAMR version 0.19.
Classes | List of all members
SAMRAI::hier::BoxTop< DIM > Class Template Reference

#include <BoxTop.h>

Classes

struct  boxElt
 

BoxTop constructors

enum  { ASCENDING, DESCENDING }
 
BoxArray< DIM > d_boxes
 
boxEltd_sorted_lists [2 *DIM]
 
boxEltd_shortest_list
 
int d_shortest_list_length
 
 BoxTop (const BoxArray< DIM > &in_boxes, const tbox::Array< tbox::List< IntVector< DIM > > > &in_shifts)
 Constructor for BoxTop. More...
 
 BoxTop (const BoxArray< DIM > &in_boxes)
 Constructor for BoxTop. More...
 
 ~BoxTop ()
 
void findOverlappingBoxes (BoxArray< DIM > &overlaps, const Box< DIM > &box)
 Compute the set of boxes that overlap with the specified box. More...
 
void findOverlappingBoxIndices (tbox::Array< int > &indices, const Box< DIM > &box)
 Compute the indices of the boxes that overlap the specified box. More...
 
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. More...
 
void removeIntersections (BoxList< DIM > &list)
 Remove from list the portions that intersect the boxes in the BoxArray that was passed to the constructor. More...
 
void print (std::ostream &os=tbox::plog)
 Undocumented function, used during development and testing. More...
 
 BoxTop (const BoxTop< DIM > &bs)
 the copy constructor is not implemented. More...
 
BoxTop< DIM > & operator= (const BoxTop< DIM > &boxtop)
 the assignment operator is not implemented. More...
 
 BoxTop (const BoxList< DIM > &list)
 This undefined constructor prevents the creation of a "hidden" object. More...
 
void setup ()
 
void findNaborsPrivate (const Box< DIM > &box)
 
void sort (boxElt *&array, int len, int ordering)
 
int binSearch (boxElt *tmp, int tmp_len, int coord, int ordering)
 
void buildShortestList (BoxArray< DIM > &overlaps, bool build_overlaps, tbox::Array< int > &indices, bool build_indices, const Box< DIM > &box)
 
void printEltArray (boxElt *&data, int len, std::ostream &os)
 
static int boxEltCompareA (const void *v, const void *w)
 
static int boxEltCompareD (const void *v, const void *w)
 

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

Member Enumeration Documentation

◆ anonymous enum

template<int DIM>
anonymous enum
private
Enumerator
ASCENDING 
DESCENDING 

Constructor & Destructor Documentation

◆ BoxTop() [1/4]

template<int DIM>
SAMRAI::hier::BoxTop< DIM >::BoxTop ( const BoxArray< DIM > &  in_boxes,
const tbox::Array< tbox::List< IntVector< DIM > > > &  in_shifts 
)
Parameters
in_boxesinput array of boxes.
in_shiftscontains a shift vector associated with each boxes.

◆ BoxTop() [2/4]

template<int DIM>
SAMRAI::hier::BoxTop< DIM >::BoxTop ( const BoxArray< DIM > &  in_boxes)
Parameters
in_boxesinput array of boxes.

◆ ~BoxTop()

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

The destructor releases privately held resources.

◆ BoxTop() [3/4]

template<int DIM>
SAMRAI::hier::BoxTop< DIM >::BoxTop ( const BoxTop< DIM > &  bs)
private

◆ BoxTop() [4/4]

template<int DIM>
SAMRAI::hier::BoxTop< DIM >::BoxTop ( const BoxList< DIM > &  list)
private

Member Function Documentation

◆ findOverlappingBoxes()

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

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

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

◆ findOverlappingBoxIndices()

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::findOverlappingBoxIndices ( tbox::Array< int > &  indices,
const Box< DIM > &  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
indicesthe indices of the overlapping boxes.
boxthe specified box whose overlaps are requested.

◆ findOverlappingBoxesAndIndices()

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::findOverlappingBoxesAndIndices ( BoxArray< DIM > &  overlaps,
tbox::Array< int > &  indices,
const Box< DIM > &  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
overlapsthe subset of boxes, from the array that was passed to the ctor, that overlap the specified box.
indicesthe indices of the overlapping boxes.
boxthe specified box whose overlaps are requested.

◆ removeIntersections()

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

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
listthe list of boxes from which intersections are to be removed.

◆ print()

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

◆ operator=()

template<int DIM>
BoxTop<DIM>& SAMRAI::hier::BoxTop< DIM >::operator= ( const BoxTop< DIM > &  boxtop)
private

◆ setup()

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::setup ( )
private

◆ findNaborsPrivate()

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::findNaborsPrivate ( const Box< DIM > &  box)
private

◆ sort()

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::sort ( boxElt *&  array,
int  len,
int  ordering 
)
private

◆ binSearch()

template<int DIM>
int SAMRAI::hier::BoxTop< DIM >::binSearch ( boxElt tmp,
int  tmp_len,
int  coord,
int  ordering 
)
private

◆ buildShortestList()

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::buildShortestList ( BoxArray< DIM > &  overlaps,
bool  build_overlaps,
tbox::Array< int > &  indices,
bool  build_indices,
const Box< DIM > &  box 
)
private

◆ boxEltCompareA()

template<int DIM>
static int SAMRAI::hier::BoxTop< DIM >::boxEltCompareA ( const void *  v,
const void *  w 
)
staticprivate

◆ boxEltCompareD()

template<int DIM>
static int SAMRAI::hier::BoxTop< DIM >::boxEltCompareD ( const void *  v,
const void *  w 
)
staticprivate

◆ printEltArray()

template<int DIM>
void SAMRAI::hier::BoxTop< DIM >::printEltArray ( boxElt *&  data,
int  len,
std::ostream &  os 
)
private

Member Data Documentation

◆ d_boxes

template<int DIM>
BoxArray<DIM> SAMRAI::hier::BoxTop< DIM >::d_boxes
private

◆ d_sorted_lists

template<int DIM>
boxElt* SAMRAI::hier::BoxTop< DIM >::d_sorted_lists[2 *DIM]
private

◆ d_shortest_list

template<int DIM>
boxElt* SAMRAI::hier::BoxTop< DIM >::d_shortest_list
private

◆ d_shortest_list_length

template<int DIM>
int SAMRAI::hier::BoxTop< DIM >::d_shortest_list_length
private

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