Disjoint Box Layout.
More...
#include <Proto_DisjointBoxLayout.H>
|
| DisjointBoxLayout () |
| Default Constructor. More...
|
|
| 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 ProblemDomain &a_problemDomain, const Box &a_region, const Point &a_boxSize) |
| Constructor (Partial Domain - Simple) More...
|
|
| DisjointBoxLayout (std::shared_ptr< BoxPartition > a_partition, const Point &a_boxSize) |
|
void | define (std::shared_ptr< BoxPartition > a_partition, const Point &a_boxSize) |
| Direct Define. More...
|
|
| DisjointBoxLayout (const DisjointBoxLayout &a_layout) |
| 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< PatchID > &a_patchIDs, const Point &a_boxSize) |
| Define (Partial Domain) More...
|
|
void | define (const ProblemDomain &a_problemDomain, const Box &a_region, const Point &a_boxSize) |
| Define (Partial Domaini - Simple) More...
|
|
DisjointBoxLayout | sorted () const |
| Get Sorted Version of This. More...
|
|
bool | isSorted () const |
|
void | loadBalance (unsigned int a_startProc, unsigned int a_endProc) |
| Load Balance. More...
|
|
template<typename... Args> |
void | loadAssign (Args... a_args) |
| Load Assign. More...
|
|
void | loadAssign (std::vector< std::pair< int, unsigned int >> &a_assignment) |
| Load Assign. More...
|
|
DisjointBoxLayout & | operator= (const DisjointBoxLayout &a_input) |
| Assignment. More...
|
|
bool | operator== (const DisjointBoxLayout &a_input) const |
| Equality Operator. More...
|
|
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.
◆ DisjointBoxLayout() [1/6]
Proto::DisjointBoxLayout::DisjointBoxLayout |
( |
| ) |
|
|
inline |
◆ DisjointBoxLayout() [2/6]
Proto::DisjointBoxLayout::DisjointBoxLayout |
( |
const ProblemDomain & |
a_problemDomain, |
|
|
const Point & |
a_boxSize |
|
) |
| |
|
inline |
Constructor (Full Domain)
Creates a DisjointBoxLayout by tiling an input ProblemDomain completely with boxes of a predetermined size. If MPI is used, boxes will be distributed over available processors using Morton ordering. If a_problemDomain.coarsenable(a_boxSize) != true
this results in an error.
- Parameters
-
◆ DisjointBoxLayout() [3/6]
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 tiling 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). In parallel applications, a_coarsenedPatches
should contain the patches in the layout on ALL ranks, not just locally.
- Parameters
-
a_problemDomain | ProblemDomain containing the DBL. |
a_coarsenedPatches | An array of points corresponding to patches in the tiled layout |
a_boxSize | Possibly anisotropic size of each Box in the layout |
◆ DisjointBoxLayout() [4/6]
Proto::DisjointBoxLayout::DisjointBoxLayout |
( |
const ProblemDomain & |
a_problemDomain, |
|
|
const Box & |
a_region, |
|
|
const Point & |
a_boxSize |
|
) |
| |
|
inline |
Constructor (Partial Domain - Simple)
Creats a DisjointBoxLayout by partially covering an input ProblemDomain with all patches in an input region. The sub-region must also be coarsenable by the box size, and must be a contained within the problem domain. Useful for quick debugging, but not practically useful for most real problems.
- Parameters
-
a_problemDomain | ProblemDomain containing the DBL. |
a_region | Sub-region of the domain which will be tiled in the layout. |
a_boxSize | Possibly anisotropic size of each Box in the layout. |
◆ DisjointBoxLayout() [5/6]
Proto::DisjointBoxLayout::DisjointBoxLayout |
( |
std::shared_ptr< BoxPartition > |
a_partition, |
|
|
const Point & |
a_boxSize |
|
) |
| |
|
inline |
◆ DisjointBoxLayout() [6/6]
Copy Constructor.
Copies share pointers to the internal structure hence this is relatively cheap.
- Parameters
-
◆ define() [1/4]
void Proto::DisjointBoxLayout::define |
( |
std::shared_ptr< BoxPartition > |
a_partition, |
|
|
const Point & |
a_boxSize |
|
) |
| |
|
inline |
Direct Define.
Creates a DisjointBoxLayout which is linked to an existing BoxPartition object. This constructor is used internally and is not recommended for public use.
◆ define() [2/4]
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() [3/4]
void Proto::DisjointBoxLayout::define |
( |
const ProblemDomain & |
a_problemDomain, |
|
|
const vector< PatchID > & |
a_patchIDs, |
|
|
const Point & |
a_boxSize |
|
) |
| |
|
inline |
Define (Partial Domain)
Construct a DisjointBoxLayout lazily or redefine an existing one.
◆ define() [4/4]
void Proto::DisjointBoxLayout::define |
( |
const ProblemDomain & |
a_problemDomain, |
|
|
const Box & |
a_region, |
|
|
const Point & |
a_boxSize |
|
) |
| |
|
inline |
Define (Partial Domaini - Simple)
Construct a DisjointBoxLayout lazily or redefine an existing one.
◆ sorted()
Get Sorted Version of This.
◆ isSorted()
bool Proto::DisjointBoxLayout::isSorted |
( |
| ) |
const |
|
inline |
◆ loadBalance()
void Proto::DisjointBoxLayout::loadBalance |
( |
unsigned int |
a_startProc, |
|
|
unsigned int |
a_endProc |
|
) |
| |
|
inline |
Load Balance.
Distribute the load of this layout over the range of processors whose indices span [a_startProc, a_endProc-1]
.
Referenced by isSorted().
◆ loadAssign() [1/2]
template<typename... Args>
void Proto::DisjointBoxLayout::loadAssign |
( |
Args... |
a_args | ) |
|
|
inline |
Load Assign.
Manually assign the load of this layout using the syntax loadAssign(P0, N0, P1, N1, ..., Pk, Nk)
where process Pi is assigned Ni boxes. The sum over all Ni should be equal to the size of this layout.
◆ loadAssign() [2/2]
void Proto::DisjointBoxLayout::loadAssign |
( |
std::vector< std::pair< int, unsigned int >> & |
a_assignment | ) |
|
|
inline |
Load Assign.
Manually assign the load of this layout. The input is a vector of pair<int, unsigned int>
where the first entry of each pair is a process and the second is the number of boxes to be assigned to that process.
◆ operator=()
Assignment.
Copies share pointers to the same internal structure
◆ operator==()
◆ boxes()
const std::vector< std::pair< Point, unsigned int > > Proto::DisjointBoxLayout::boxes |
( |
| ) |
const |
|
inline |
Get All Boxes.
Get a copy of the patches in the layout. The output is a vector of pair<Point, int>
where for each element item
, item.first
contains a Point corresponding to the Box Box(item.first, item.first).refine(boxSize())
. item.second
contains the integer rank of the process which handles the patch.
Note that this function returns data for all patches on all parallel processes.
◆ operator[]()
Box Proto::DisjointBoxLayout::operator[] |
( |
const LevelIndex & |
a_index | ) |
const |
|
inline |
Index Access.
Return the Box associated with a DataIndex. Fails if the index is not compatible with *this.
- Parameters
-
◆ box()
Box Proto::DisjointBoxLayout::box |
( |
const LevelIndex & |
a_index | ) |
const |
|
inline |
Box Indexing.
Return the Box associated with a DataIndex. Identical to operator[]
Fails if the index is not compatible with *this.
- Parameters
-
◆ point()
Point Indexing.
Return the Point version of the Box associated with a DataIndex. Fails if the index is not compatible with *this.
- Parameters
-
◆ procID()
int Proto::DisjointBoxLayout::procID |
( |
const LevelIndex & |
a_index | ) |
const |
|
inline |
◆ offset() [1/2]
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. Used for serialization.
- Parameters
-
◆ offset() [2/2]
unsigned int Proto::DisjointBoxLayout::offset |
( |
| ) |
const |
|
inline |
This Patch Offset.
Returns the linear offset (in number of boxes) of the first patch on this proc. Used for linearization.
References offset(), and Proto::procID().
Referenced by offset().
◆ index() [1/2]
Get Index From Point.
Find the DataIndex associated with an input patch point. This function is the inverse of DisjointBoxLayout::point(DataIndex).
Input Points must be in this->patchDomain()
or be a valid periodic image thereof, otherwise this function will fail by assertion.
- Parameters
-
a_patchPoint | A point representing a patch in the layout or a periodic image |
◆ size()
unsigned int Proto::DisjointBoxLayout::size |
( |
| ) |
const |
|
inline |
Size.
Return the number of Boxes contained in *this including those on other processors. Deprecated: Use numBoxes() instead for improved in situe documentation.
◆ numBoxes()
unsigned int Proto::DisjointBoxLayout::numBoxes |
( |
| ) |
const |
|
inline |
NumBoxes.
Returns the number of Boxes contained in *this including those on other processors. This function is identical to the deprecated function size()
◆ localSize()
unsigned int Proto::DisjointBoxLayout::localSize |
( |
| ) |
const |
|
inline |
Local Size.
Return the number of Boxes on this processor.
◆ index() [2/2]
LevelIndex Proto::DisjointBoxLayout::index |
( |
unsigned int |
a_intIndex | ) |
const |
|
inline |
Global Indexing.
Get the DataIndex associated with a global integer index. Inputs are integers in [0, this->size())
- Parameters
-
a_intIndex | A valid integer index |
◆ localIndex()
LevelIndex Proto::DisjointBoxLayout::localIndex |
( |
unsigned int |
a_myIndexInt | ) |
const |
|
inline |
Local Indexing.
Get the DataIndex associated with a local integer index. Inputs are integers in [0, this->localSize())
- Parameters
-
a_intIndex | A valid integer index |
◆ boxSize()
Point Proto::DisjointBoxLayout::boxSize |
( |
| ) |
const |
|
inline |
◆ domain()
◆ patchDomain()
◆ partition()
std::shared_ptr<BoxPartition> Proto::DisjointBoxLayout::partition |
( |
| ) |
|
|
inline |
◆ find()
Find Index.
Given a patch Point, return the DataIndex of the associated Box if it is in the layout including periodic images. If the Point does not represent a patch in this layout, this function returns this->end()
- Parameters
-
◆ contains()
bool Proto::DisjointBoxLayout::contains |
( |
const Point & |
a_pt | ) |
const |
|
inline |
Find Tile Point.
Returns true if the tile a_pt (or a periodic image thereof) is contained in the layout
◆ onDomainBoundary()
bool Proto::DisjointBoxLayout::onDomainBoundary |
( |
const Point & |
a_pt | ) |
const |
|
inline |
On Domain Boundary.
Returns true if a_pt
corresponds to a patch that is adjacent to a non-periodic domain boundary. If a_pt
does not represent a valid patch in this layout, this function fails by assertion.
- Parameters
-
◆ isDomainBoundary()
bool Proto::DisjointBoxLayout::isDomainBoundary |
( |
const LevelIndex & |
a_patch, |
|
|
const Point & |
a_dir |
|
) |
| const |
|
inline |
◆ onLevelBoundary()
bool Proto::DisjointBoxLayout::onLevelBoundary |
( |
const Point & |
a_pt | ) |
const |
|
inline |
On Level Boundary.
Returns true if a_pt
corresponds to a patch that is adjacent to a non-periodic layout boundary (including domain boundaries). In other words, this function returns false if and only if a_pt
represents a patch that is completely surrounded by other patches in the layout. If a_pt
does not represent a valid patch in this layout, this function fails by assertion.
- Parameters
-
◆ end()
◆ begin()
◆ coarsenable()
bool Proto::DisjointBoxLayout::coarsenable |
( |
const Point & |
a_refRatio | ) |
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() % a_refRatio == (0,0,....)
- Parameters
-
a_refRatio | Refinement ratios |
◆ compatible() [1/3]
bool Proto::DisjointBoxLayout::compatible |
( |
const DisjointBoxLayout & |
a_layout | ) |
const |
|
inline |
Compatibility Query.
Checks if *this and another layout have the same patch configuration. This is to say, both layouts have boxes in the same tile positions and on the same processors, but the boxes themselves may be different sizes. If true, objects built from these layouts can be processed together in the same DataIterator loop.
- Parameters
-
◆ compatible() [2/3]
bool Proto::DisjointBoxLayout::compatible |
( |
const LevelIterator & |
a_iter | ) |
const |
|
inline |
Compatibility Query.
Checks if this layout can be iterated through using a DataIterator instance.
- Parameters
-
◆ compatible() [3/3]
bool Proto::DisjointBoxLayout::compatible |
( |
const LevelIndex & |
a_iter | ) |
const |
|
inline |
◆ coarsen() [1/2]
Simple Coarsen.
Coarsens the layout by an input (possibly anisotropic) refinement ratio. coarsenable(a_refRatio) must be true or this function will result in an error. The output of this function will always have the same size as the input and will always be compatible in the DataIterator sense.
The coarsened layout has: crseLayout.domain().box() == fineLayout.problemDomain.box().coarsen(refRatio)
crseLayout[ii] == fineLayout[ii].coarsen(refRatio)
for each ii in [0, size())
- Parameters
-
a_refRatio | A refinement ratio |
◆ coarsen() [2/2]
Coarsen.
Creates a new DisjointBoxLayout with a specified box size that has been coarsened by a valid ratio. coarsenable(refRatio) must be true or this function will result in an error. The output of this function will in general have a different size than the input and is not guaranteed to be compatible in the DataIterator sense.
- Parameters
-
a_refRatio | A refinement ratio |
a_boxSize | Size of the output layout's boxes |
◆ refine()
Refine.
Refines the layout by an input (possibly anisotropic) refinement ratio. Unline coarsen(...), this function should always be possible. The output of this function will always have the same size as the input and will always be compatible in the DataIterator sense.
The refined layout has: fineLayout.domain().box() == crseLayout.problemDomain.box().refine(refRatio)
fineLayout[ii] == crseLayout[ii].refine(refRatio)
for each ii in [0, size())
- Parameters
-
a_refRatio | A refinement ratio |
◆ boundingBox()
Box Proto::DisjointBoxLayout::boundingBox |
( |
| ) |
const |
|
inline |
Get Bounding Box.
Returns the smallest Box containing all of the boxes in the layout. Output is guaranteed to be coarsenable by boxSize().
◆ radialSymmetry()
bool Proto::DisjointBoxLayout::radialSymmetry |
( |
Point |
a_origin | ) |
const |
|
inlineprivate |
Check Radial Symmetry.
For debugging mesh refinement procedures
◆ mirrorSymmetry()
bool Proto::DisjointBoxLayout::mirrorSymmetry |
( |
Point |
a_origin, |
|
|
int |
a_coord |
|
) |
| const |
|
inlineprivate |
Check Mirror Symmetry.
For debugging mesh refinement procedures
◆ print()
void Proto::DisjointBoxLayout::print |
( |
std::string |
a_name = "" | ) |
const |
|
inline |
◆ DataIndex
◆ DataIterator
◆ NeighborIterator
◆ operator<<
◆ m_problemDomain
◆ m_boxSize
Point Proto::DisjointBoxLayout::m_boxSize |
|
private |
◆ m_partition
std::shared_ptr<BoxPartition> Proto::DisjointBoxLayout::m_partition |
|
private |
The documentation for this class was generated from the following file: