Proto
3.2
|
Multiblock Level Box Data. More...
#include <Proto_MBLevelBoxData.H>
Public Types | |
typedef std::tuple< Point, BlockIndex, Point > | boundsKey_t |
Public Member Functions | |
MBLevelBoxData () | |
MBLevelBoxData (const MBDisjointBoxLayout &a_layout, const Array< Point, DIM+1 > &a_ghost, Point a_boundGhost=Point::Zeros()) | |
Main Constructor. More... | |
MBLevelBoxData (const MBDisjointBoxLayout &a_layout, Point a_ghost, Point a_boundGhost=Point::Zeros()) | |
Simplified Constructor. More... | |
void | define (const MBDisjointBoxLayout &a_layout, const Array< Point, DIM+1 > &a_ghost, Point a_boundGhost=Point::Zeros()) |
Lazy Constructor. More... | |
void | define (const MBDisjointBoxLayout &a_layout, Point a_ghost, Point a_boundGhost=Point::Zeros()) |
Lazy Constructor. More... | |
template<typename Func , typename... Srcs> | |
void | initialize (Func &a_func, Srcs &... a_srcs) |
Initialize FIXME (NOT CURRENTLY WORKING) More... | |
void | setVal (T a_value) |
Constant Initialization. More... | |
void | setBoundary (T a_val, int a_comp=-1) |
Initialize Boundary Ghost Cells. More... | |
void | setRandom (T a_low, T a_high) |
Initialize with Random Noise. More... | |
template<typename Func , typename... Srcs> | |
void | initConvolve (Func &a_func, Srcs &... a_srcs) |
FIXME (NOT CURRENTLY WORKING) More... | |
void | exchange () |
Exchange Ghost Data. More... | |
template<MemType DST_MEM> | |
void | copyTo (MBLevelBoxData< T, C, DST_MEM, CTR > &a_rhs) const |
Parallel Data Copy. More... | |
template<MemType DST_MEM> | |
void | copyToFull (MBLevelBoxData< T, C, DST_MEM, CTR > &a_rhs) const |
Array< Point, DIM+1 > | ghost () const |
Get Ghost Size Array. More... | |
BoxData< T, C, MEM > & | operator[] (MBIndex a_index) |
Get Patch Reference. More... | |
const BoxData< T, C, MEM > & | operator[] (MBIndex a_index) const |
Get Patch Reference (Const Overload) More... | |
void | increment (const MBLevelBoxData< T, C, MEM, CTR > &a_data, T a_scale=1.0) |
Increment. More... | |
LevelBoxData< T, C, MEM, CTR > & | getBlock (BlockIndex a_block) |
Get Block Data. More... | |
const LevelBoxData< T, C, MEM, CTR > & | getBlock (BlockIndex a_block) const |
Get Block Data (Const Overload) More... | |
const MBDisjointBoxLayout & | layout () const |
Get Layout. More... | |
Box | patchBox (const MBIndex &a_index) const |
Get Patch Box. More... | |
unsigned int | patchSize (BlockIndex a_block) const |
Get Patch Size. More... | |
size_t | linearSize (const MBIndex &a_index) const |
Linear Size of Patch. More... | |
size_t | linearSize () const |
Linear Size. More... | |
void | linearOut (void *a_buffer, const MBIndex &a_index, const Box &a_box) const |
Linear Out. More... | |
void | linearOut (void *a_buffer, const MBIndex &a_index) const |
Linear Out. More... | |
void | linearOut (void *a_buffer) const |
Linear Out. More... | |
void | linearIn (void *a_buffer, const Box &a_box, const MBIndex &a_index) |
Linear In. More... | |
void | linearIn (void *a_buffer, const MBIndex &a_index) |
Linear In. More... | |
void | linearIn (void *a_buffer) |
Linear In. More... | |
size_t | offset (unsigned int a_proc) const |
Linear Offset. More... | |
std::vector< MBBoundaryData< T, C, MEM > > & | bounds (MBIndex a_index, Point a_dir) |
Get Boundary Buffers. More... | |
const std::vector< MBBoundaryData< T, C, MEM > > & | bounds (MBIndex a_index, Point a_dir) const |
Get Boundary Buffers (Const Overload) More... | |
bool | isBlockBoundary (MBIndex a_index, Point a_dir, BlockIndex a_adjBlock) const |
Detect Block Boundary. More... | |
MBBoundaryData< T, C, MEM > & | bound (MBIndex a_index, Point a_dir, BlockIndex a_adjBlock) |
Get Block Boundary. More... | |
const MBBoundaryData< T, C, MEM > & | bound (MBIndex a_index, Point a_dir, BlockIndex a_adjBlock) const |
Get Block Boundary (Const Overload) More... | |
bool | compatible (const MBDisjointBoxLayout &a_layout) const |
Compatibility Check. More... | |
Var< T, C, MEM > | operator[] (const MBDataPoint &a_point) |
Convert MBDataPoint to Var. More... | |
Var< T, C, MEM > | operator[] (const MBDataPoint &a_point) const |
Convert MBDataPoint to Var (Const Overload) More... | |
std::vector< Point > | onDomainBoundary (const Point &a_point, const MBIndex &a_index) const |
Get BoxData containing the destination of the DataPoint. More... | |
template<Proto::Operation OP> | |
T | reduce (unsigned int c=0) const |
Reduction. More... | |
T | absMax (unsigned int c=0) const |
T | max (unsigned int c=0) const |
T | min (unsigned int c=0) const |
T | sum (unsigned int c=0) const |
void | printBounds (const MBIndex &a_index, int a_prec=4) |
Print Boundary Buffer Data. More... | |
unsigned int | numBlocks () const |
Get Number of Blocks. More... | |
MBIterator | begin () |
MBIterator | end () |
const MBIterator | begin () const |
const MBIterator | end () const |
Private Attributes | |
MBLevelExchangeCopier< T, C, MEM, CTR > | m_exchangeCopier |
Array< Point, DIM+1 > | m_ghost |
MBDisjointBoxLayout | m_layout |
std::vector< std::shared_ptr< LevelBoxData< T, C, MEM, CTR > > > | m_data |
std::map< boundsKey_t, std::vector< MBBoundaryData< T, C, MEM > > > | m_bounds |
Friends | |
template<typename _T , unsigned int _C, MemType _MEM, Centering _CTR> | |
class | MBAMRData |
Multiblock Level Box Data.
This class is the analog of LevelBoxData in the context of mapped multiblock applications. The most critical differences between this object and the single block version are the presence of additional data buffers allocated at block boundaries which are utilized for block boundary interpolation.
typedef std::tuple<Point, BlockIndex, Point> Proto::MBLevelBoxData< T, C, MEM, CTR >::boundsKey_t |
|
inline |
|
inline |
Main Constructor.
Creates and allocates data for an MBLevelBoxData defined on a specified layout and allocating a specified number of ghost cells.
The ghost input has different semantics from the non- multiblock context. Here, ghost[0] refers to the number of ghost cells that each patch will allocate - this is the same as the ghost input used for LevelBoxData. The additional inputs ghost[n] for n > 0 define the size of the block boundary data buffers that will be allocated for a block boundary of codimension-n. For 4th order interpolation at block boundaries, it is recommended that ghost[n] for n>0 be greater than ghost[0] by at least 2 units in each direction. This recommendation holds even for cases where ghost[0] is equal to zero in one or more coordinate directions.
a_layout | A mapped multiblock layout |
a_ghost | An array of ghost sizes. See the description above. |
a_boundGhost | Additional allocation for block boundary buffers. Use this if there is a need for block boundary buffers to overlap with the domain interior. This should remain defaulted unless you really know what you are doing. |
|
inline |
Simplified Constructor.
The ghost input for this constructor corresponds to ghost[0] in the general constructor. The boundary data buffers are constructed conservatively assuming 4th order block-boundary interpolation is desired.
|
inline |
Lazy Constructor.
|
inline |
Lazy Constructor.
|
inline |
Initialize FIXME (NOT CURRENTLY WORKING)
Initialize the data in this using forall-style syntax. Func should be a valid forall kernel with the following signature:
void foo(Point& p, Var<T,C,MEM>& d, unsigned int b, ...);
p: The point of evaluation d: A data point in this b: The block in which foo is being evaluated ...: Other arguments. These may be MBLevelBoxData, MBLevelMap, or any kind of POD If MBLevelMap is used as an input, the argument will be converted to an MBLevelBoxData containing the coordinate variables with the same centering as *this.
|
inline |
Constant Initialization.
|
inline |
Initialize Boundary Ghost Cells.
|
inline |
Initialize with Random Noise.
|
inline |
FIXME (NOT CURRENTLY WORKING)
|
inline |
Exchange Ghost Data.
Executes the parallel copy necessary to fill ghost regions.This includes exchanging data between patches inside of the same block as well as filling block boundary buffers. In order to fill ghost cells which lie on a block boundary, an MBInterpOp operation must be applied after this function is called.
|
inline |
Parallel Data Copy.
Executes a parallel copy between two compatible MBLevelBoxData. Only copies valid data; ghost data will need to be initialized afterwards by calling exchange(). TODO: exchange might actually be copied as well, but I need to test this -CLG
|
inline |
Array< Point, DIM+1 > Proto::MBLevelBoxData< T, C, MEM, CTR >::ghost | ( | ) | const |
Get Ghost Size Array.
|
inline |
Get Patch Reference.
|
inline |
Get Patch Reference (Const Overload)
|
inline |
Increment.
|
inline |
Get Block Data.
Returns the normal LevelBoxData associated with a specified block
|
inline |
Get Block Data (Const Overload)
|
inline |
Get Layout.
|
inline |
Get Patch Box.
multiblock analog of LevelBoxData::patchBox. Returns the Box which defines the domain of a specified patch index, correcting for centering
|
inline |
Get Patch Size.
Multiblock analog of LevelBoxData::patchSize. Returns the number of data points in any patch within the specified block accounting for centering and ghost size.
|
inline |
Linear Size of Patch.
|
inline |
Linear Size.
|
inline |
Linear Out.
|
inline |
Linear Out.
|
inline |
Linear Out.
|
inline |
Linear In.
|
inline |
Linear In.
|
inline |
Linear In.
|
inline |
Linear Offset.
|
inline |
Get Boundary Buffers.
Returns the block boundary buffers for the block boundary specified by an MBIndex and a direction in the coordinate system of the block specified by the MBIndex.
This function is mostly used for debugging and is not recommended for public use.
|
inline |
Get Boundary Buffers (Const Overload)
|
inline |
Detect Block Boundary.
Determine if a specified index and direction correspond to a block boundary with a specified block index
|
inline |
Get Block Boundary.
Retrieve the block boundary buffer associated with the specified block boundary information. This function yields an error if isBlockBoundary is false for these inputs.
|
inline |
Get Block Boundary (Const Overload)
|
inline |
Compatibility Check.
This is the same as this->layout().compatible(a_layout)
|
inline |
Convert MBDataPoint to Var.
Used by interpolation API. Not recommended for public use.
|
inline |
Convert MBDataPoint to Var (Const Overload)
Used by interpolation API. Not recommended for public use.
|
inline |
Get BoxData containing the destination of the DataPoint.
For points inside of block boundaries, this is the localData variable of the appropriate MBBoundaryData. Otherwise, this is simply the patch associated with the index of the DataPoint Get BoxData containing the source of the DataPoint For points inside of block boundaries, this is the adjData variable of the appropriate MBBoundaryData. Otherwise, this is simply the patch associated with the index of the DataPoint Domain Boundary Check Determines which domain boundaries - if any - a specified Point in a specified patch resides on. The output is a vector of directions which correspond to the domain boundaries the specified point abuts. If the specified point is not adjacent to a domain boundary, an empty vector is returned.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Print Boundary Buffer Data.
Prints the contents of the boundary buffers associated with a specified index.
|
inline |
Get Number of Blocks.
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |