Proto
Public Member Functions
Proto::DisjointBoxLayout Class Reference

Disjoint Box Layout. More...

#include <Proto_DisjointBoxLayout.H>

Public Member Functions

 DisjointBoxLayout (const ProblemDomain &a_problemDomain, const Point &a_boxSize)
 Constructor (Full Domain) More...
 
 DisjointBoxLayout (const ProblemDomain &a_problemDomain, const vector< Point > &a_coarsenedPatches, const Point &a_boxSize)
 Constructor (Partial Domain) More...
 
 DisjointBoxLayout (const DisjointBoxLayout &a_input)
 Copy Constructor. More...
 
void define (const ProblemDomain &a_problemDomain, const Point &a_boxSize)
 Define (Full Domain) More...
 
void define (const ProblemDomain &a_problemDomain, const vector< Point > &a_coarsenedPatches, const Point &a_boxSize)
 Define (Partial Domain) More...
 
DisjointBoxLayoutoperator= (const DisjointBoxLayout &a_input)
 Assignment. More...
 
bool operator== (const DisjointBoxLayout &a_input) const
 Equality Operator.
 
const DataIndexend () const
 
DataIterator begin () const
 Get Iterator.
 
bool coarsenable (const Point &a_refrat) const
 Coarsenable Query. More...
 
DisjointBoxLayout coarsen (const Point &a_refrat) const
 Coarsen. More...
 
DisjointBoxLayout refine (const Point &a_refrat) const
 Refine. More...
 
Access operators.
const shared_ptr< DBLInternalsdblInternals () const
 Get Internals. More...
 
Box operator[] (const DataIndex &a_index) const
 Index Access. More...
 
Box box (const DataIndex &a_index) const
 Box Indexing. More...
 
Point point (const DataIndex &a_index) const
 Point Indexing. More...
 
int procID (const DataIndex &a_index) const
 Get Process ID.
 
int procid (const DataIndex &a_index) const
 
unsigned int offset (int a_proc) const
 Patch Offset. More...
 
unsigned int offset () const
 
DataIndex index (Point &a_coarsenedPt) const
 Get Index From Point. More...
 
unsigned int size () const
 Size. More...
 
unsigned int localSize () const
 Local Size. More...
 
unsigned int mySize () const
 
DataIndex index (unsigned int a_indexInt) const
 Global Indexing. More...
 
DataIndex localIndex (unsigned int a_myIndexInt) const
 Local Indexing. More...
 
DataIndex myIndex (unsigned int a_myIndexInt) const
 
int localIntIndex (const DataIndex &a_di) const
 Local Indexing (Inverse) More...
 
int myIntIndex (const DataIndex &a_di) const
 
Point boxSize () const
 Get Box Size. More...
 
ProblemDomain domain () const
 Get Problem Domain.
 
ProblemDomain problemDomain () const
 
DataIndex find (const Point &a_pt) const
 Find Index. More...
 

Detailed Description

Disjoint Box Layout.

Layout of disjoint, logically rectangular regions of DIM-dimensional space. This object is a simplified generalization of the DisjointBoxLayout class used in Chombo, now specialized to use fixed box sizes.

Constructor & Destructor Documentation

◆ DisjointBoxLayout() [1/3]

Proto::DisjointBoxLayout::DisjointBoxLayout ( const ProblemDomain a_problemDomain,
const Point a_boxSize 
)
inline

Constructor (Full Domain)

Creates a DisjointBoxLayout by covering an input ProblemDomain completely with boxes of a predetermined size. If MPI is used, boxes will be distributed over available processors using Morton ordering.

◆ DisjointBoxLayout() [2/3]

Proto::DisjointBoxLayout::DisjointBoxLayout ( const ProblemDomain a_problemDomain,
const vector< Point > &  a_coarsenedPatches,
const Point a_boxSize 
)
inline

Constructor (Partial Domain)

Creates a DisjointBoxLayout by partially covering an input ProblemDomain with boxes according to a set of Points.

Each element of a_coarsenedPatches represents a box in the layout which has been coarsened by boxSize (resulting in a Box with a single element).

Concretely, for each Point p in the input array, a Box b will be constructed in the layout such that:

Point p => Box b = Box(p,p).refine(boxSize) = [boxSize*p, boxSize*(p + (1,1,...)) - (1,1,...)]

Parameters
a_problemDomainProblemDomain containing the DBL.
a_coarsenedPatchescontains the Points correcpoinding the patches in the DBL for all the processors.
a_boxSizeis the size of a patch. Note that this allows anisotropic patches.

◆ DisjointBoxLayout() [3/3]

Proto::DisjointBoxLayout::DisjointBoxLayout ( const DisjointBoxLayout a_input)
inline

Copy Constructor.

Copies share pointers to the same internal structure

Member Function Documentation

◆ box()

Box Proto::DisjointBoxLayout::box ( const DataIndex a_index) const
inline

Box Indexing.

Return the Box associated with a DataIndex.

◆ boxSize()

Point Proto::DisjointBoxLayout::boxSize ( ) const
inline

Get Box Size.

Return the constant size of all boxes in the layout.

◆ coarsen()

DisjointBoxLayout Proto::DisjointBoxLayout::coarsen ( const Point a_refrat) const
inline

Coarsen.

Coarsens the layout by an input (possibly anisotropic) refinement ratio. coarsenable(refRatio) must be true or this function will result in an error.

The coarsened layout has: coarseLayout.problemDomain().box() == fineLayout.problemDomain.box().coarsen(refRatio) coarseLayout[ii] == fineLayout[ii].coarsen(refRatio) for each ii in [0, size()) TODO: Write this in LaTeX TODO: Can this change the number of Boxes? -CLG

◆ coarsenable()

bool Proto::DisjointBoxLayout::coarsenable ( const Point a_refrat) const
inline

Coarsenable Query.

Checks if the layout is coarsenable by a (possibly anisotropic) refinement ratio. This property requires the ProblemDomain to be coarsenable as well as boxSize() % refRatio == (0,0,....)

◆ dblInternals()

const shared_ptr<DBLInternals> Proto::DisjointBoxLayout::dblInternals ( ) const
inline

Get Internals.

Needed by DataIndex -PC

◆ define() [1/2]

void Proto::DisjointBoxLayout::define ( const ProblemDomain a_problemDomain,
const Point a_boxSize 
)
inline

Define (Full Domain)

Construct a DisjointBoxLayout lazily or redefine an existing one.

◆ define() [2/2]

void Proto::DisjointBoxLayout::define ( const ProblemDomain a_problemDomain,
const vector< Point > &  a_coarsenedPatches,
const Point a_boxSize 
)
inline

Define (Partial Domain)

Construct a DisjointBoxLayout lazily or redefine an existing one.

◆ end()

const DataIndex& Proto::DisjointBoxLayout::end ( ) const
inline

Iterator End

◆ find()

DataIndex Proto::DisjointBoxLayout::find ( const Point a_pt) const
inline

Find Index.

Given a bit Point, return the DataIndex of the associated Box if it is in the layout. TODO: Someone check me on this description -CLG

◆ index() [1/2]

DataIndex Proto::DisjointBoxLayout::index ( Point a_coarsenedPt) const
inline

Get Index From Point.

Find the DataIndex associated with an input bit point. This function is the inverse of DisjointBoxLayout::point(DataIndex).

Points outside the ProblemDomain will still correspond to a DataIndex provided they are in periodic images of the ProblemDomain.

◆ index() [2/2]

DataIndex Proto::DisjointBoxLayout::index ( unsigned int  a_indexInt) const
inline

Global Indexing.

Get the DataIndex associated with a Box by indexing into the global Box array. TODO: Someone check me on this description -CLG

◆ localIndex()

DataIndex Proto::DisjointBoxLayout::localIndex ( unsigned int  a_myIndexInt) const
inline

Local Indexing.

Get the DataIndex associated with a Box by indexing into the local Box array. TODO: Someone check me on this description -CLG

◆ localIntIndex()

int Proto::DisjointBoxLayout::localIntIndex ( const DataIndex a_di) const
inline

Local Indexing (Inverse)

Given a DataIndex, compute the associated local integer index. Results in an error if the DataIndex is out of bounds for this processor. TODO: Someone check me on this description -CLG

◆ localSize()

unsigned int Proto::DisjointBoxLayout::localSize ( ) const
inline

Local Size.

Return the number of Boxes on this processor.

◆ offset()

unsigned int Proto::DisjointBoxLayout::offset ( int  a_proc) const
inline

Patch Offset.

Returns the linear offset (in number of boxes) of the first patch on proc a_proc

◆ operator=()

DisjointBoxLayout& Proto::DisjointBoxLayout::operator= ( const DisjointBoxLayout a_input)
inline

Assignment.

Copies share pointers to the same internal structure

◆ operator[]()

Box Proto::DisjointBoxLayout::operator[] ( const DataIndex a_index) const
inline

Index Access.

Return the Box associated with a DataIndex by calling this->box(a_index)

◆ point()

Point Proto::DisjointBoxLayout::point ( const DataIndex a_index) const
inline

Point Indexing.

Return the Point in the bit array associated with a DataIndex

◆ refine()

DisjointBoxLayout Proto::DisjointBoxLayout::refine ( const Point a_refrat) const
inline

Refine.

Refines the layout by an input (possibly anisotropic) refinement ratio. Unline coarsen(...), this function should always be possible.

The refined layout has: fineLayout.problemDomain().box() == coarseLayout.problemDomain.box().refine(refRatio) fineLayout[ii] == coarseLayout[ii].refine(refRatio) for each ii in [0, size()) TODO: Write this in LaTeX TODO: If there is a max boxSize, this could change the number of Boxes -CLG

◆ size()

unsigned int Proto::DisjointBoxLayout::size ( ) const
inline

Size.

Return the number of Boxes contained in *this including those on other processors.


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