|
template<unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E> |
void | apply (const BoxData< T, C, MEMTYPE, D, E > &a_src, BoxData< T, C, MEMTYPE, D, E > &a_dest, const Box &a_bx, bool a_initToZero=false, const T a_scale=1) const |
| Apply Stencil Helper function. More...
|
|
template<unsigned int C, unsigned int D, unsigned int E> |
void | protoApply (const BoxData< T, C, HOST, D, E > &a_src, BoxData< T, C, HOST, D, E > &a_dst, const Box &a_box, bool a_initToZero=false, T a_scale=1) |
|
template<unsigned int C, unsigned int D, unsigned int E> |
void | protoApply (const BoxData< T, C, DEVICE, D, E > &a_src, BoxData< T, C, DEVICE, D, E > &a_dst, const Box &a_box, bool a_initToZero=false, T a_scale=1) |
|
template<unsigned int C, unsigned int D, unsigned int E> |
void | hostApply (const BoxData< T, C, MemType::HOST, D, E > &a_src, BoxData< T, C, MemType::HOST, D, E > &a_dst, const Box &a_box, bool a_initToZero=false, T a_scale=1) const |
|
|
| Stencil () |
| Default Constructor. More...
|
|
| Stencil (Shift a_shift, T a_coef, Point a_destRefratio=Point::Ones(), Point a_destShift=Point::Zeros(), Point a_srcRefratio=Point::Ones()) |
| General Constructor. More...
|
|
| ~Stencil () |
|
|
bool | operator== (const Stencil< T > &a_stencil) const |
| Equality Operator. More...
|
|
bool | operator!= (const Stencil< T > &a_stencil) const |
| Inquality Operator. More...
|
|
Stencil< T > | operator* (const Stencil< T > &a_stencil) const |
| Stencil Composition. More...
|
|
Stencil< T > | operator* (const T a_coef) const |
| Scalar Multiplication. More...
|
|
void | operator*= (const Stencil< T > &a_stencil) |
| In Place Stencil Composition. More...
|
|
void | operator*= (const T a_coef) |
| In Place Scalar Multiplication. More...
|
|
Stencil< T > | operator+ (const Stencil< T > &a_stencil) const |
| Stencil Addition. More...
|
|
Stencil< T > | operator- (const Stencil< T > &a_stencil) const |
| Stencil Subtraction (Convenience) More...
|
|
void | operator+= (const Stencil< T > &a_stencil) |
| In Place Stencil Addition. More...
|
|
void | operator-= (const Stencil< T > &a_stencil) |
| In Place Stencil Subtraction. More...
|
|
|
template<unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E> |
LazyStencil< T, C, MEMTYPE, D, E > | operator() (const BoxData< T, C, MEMTYPE, D, E > &a_src, T a_scale=1) const |
| Operate on BoxData. More...
|
|
template<unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E> |
LazyStencil< T, C, MEMTYPE, D, E > | operator() (const BoxData< T, C, MEMTYPE, D, E > &a_src, Box a_box, T a_scale=1) const |
| Operate on BoxData (Overload with Box Input) More...
|
|
|
|
static Stencil< T > | Identity () |
|
static Stencil< T > | Derivative (int a_n, int a_dir, int a_order=2) |
| Stencil Library: Derivative. More...
|
|
static Stencil< T > | Laplacian () |
| Stencil Library: Laplacian. More...
|
|
static Stencil< T > | LaplacianFace (int a_dir, int a_order=2) |
| Stencil Library: Perpendicular Laplacian. More...
|
|
static Stencil< T > | CellToFace (int a_dir, Side::LoHiSide a_side=Side::Lo, int a_order=4) |
| Stencil Library: Cell to Face Interpolation. More...
|
|
static Stencil< T > | DiffCellToFace (int a_dir, Side::LoHiSide a_side=Side::Lo, int a_order=4) |
| Stencil Library: Cell to Face Differentiation. More...
|
|
static Stencil< T > | CellToFaceL (int a_dir, int a_order=4) |
| Stencil Library: Upwind Cell to Face Interpolation. More...
|
|
static Stencil< T > | CellToFaceH (int a_dir, int a_order=4) |
| Stencil Library: Upwind Cell to Face Interpolation. More...
|
|
static Stencil< T > | AvgDown (int a_refRatio) |
| Stencil Library: Simple Average. More...
|
|
static Stencil< T > | AvgDown (Point a_refRatio) |
| Stencil Library: Anisotropic Average. More...
|
|
static Stencil< T > | Sum (int a_refRatio) |
| Stencil Library: Sum. More...
|
|
static Stencil< T > | Sum (Point a_refRatio) |
| Stencil Library: Sum. More...
|
|
static Stencil< T > | AvgDownFace (int a_normDir, Side::LoHiSide a_side, int a_refRatio) |
| Stencil Library: Simple Average over a Face. More...
|
|
static Stencil< T > | AvgDownFace (int a_dir, Side::LoHiSide a_side, Point a_refRatio) |
| Stencil Library: Simple Average over a Face. More...
|
|
static Stencil< T > | FluxDivergence (int a_dir) |
| Stencil Library: Flux Divergence. More...
|
|
static Stencil< T > | faceToCell (int a_dir, int a_order=4) |
| Interpolate from face average to cell average. More...
|
|
static Stencil< T > | cornersToFaces (int a_dir, int a_order=4) |
| Interpolate from corners to face average. More...
|
|
static Stencil< T > | CornersToCells (int a_order=4) |
| Interpolate from corners to cell average. More...
|
|
|
template<typename TT , unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E> |
class | BoxData |
|
template<typename TT , unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E> |
BoxData< TT, C, MEMTYPE, D, E > & | operator|= (BoxData< TT, C, MEMTYPE, D, E > &a_dest, LazyStencil< TT, C, MEMTYPE, D, E > &&a_op) |
|
template<typename TT , unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E> |
BoxData< TT, C, MEMTYPE, D, E > & | operator+= (BoxData< TT, C, MEMTYPE, D, E > &a_dest, LazyStencil< TT, C, MEMTYPE, D, E > &&a_op) |
|
template<typename T>
class Proto::Stencil< T >
A Linear Stencil Operation.
Encapsulates a linear stencil operation where coefficients are of type T. Stencil objects are built and used in a way that conforms to their nature as operators. For illustrative usage examples, refer to the following code snippets:
Examples: Build a Stencil from Shifts and coefficients:
Apply a Stencil with no Source / Dest Refinement to a BoxData:
The above examples illustrate the usage of Stencil to do computations in which the source and destination arrays are at the same refinement. Stencil is also capable of "prolong" and "restrict" type operations in which the destination and source respectively are refined. This functionality is useful for operations such as averaging and interpolation, or for algorithms like Red-Black Gauss Seidel Iteration in which it is necessary to evaluate a Stencil on "every other cell".
To facilitate these more exotic operations, the Stencil API allows the user to designate a source and/or destination refinement ratio. If these values are different from (1,...,1), then input Box object will be interpreted as an "index range" instead of a physical Box domain. The following code snippets illustrate some examples of this functionality.
Examples: Non-Trivial Source Refinement Ratio
Non-Trivial Destination Refinement Ratio
In the case of non-trivial destination refinement, an array of refRatio^DIM Stencils is often needed to fully populate the output. Proto provides a convenience structure called InterpStencil which is designed to mitigate this form of pedantry. See the associated documentation for additional information and example usage.