Proto
|
Data Structures | |
class | Proto::Shift |
Stencil Shift. More... | |
class | Proto::BoxData< T, C, MEMTYPE, D, E > |
Multidimensional Rectangular Array. More... | |
class | Proto::LazyStencil< T, C, MEMTYPE, D, E > |
An Unevaluated Stencil Operation. More... | |
struct | Proto::Stencil< T >::coeff_holder |
class | Proto::Stencil< T > |
A Linear Stencil Operation. More... | |
class | Proto::InterpStencil< T > |
Interpolation Stencil. More... | |
struct | Proto::sIndexer3< T, C > |
Functions | |
template<unsigned int C, MemType MEMTYPE, unsigned char D, unsigned char E> | |
void | Proto::Stencil< T >::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... | |
Proto::InterpStencil< T >::InterpStencil (int a_ratio) | |
Isotropic Constructor. More... | |
Proto::InterpStencil< T >::InterpStencil (Point a_ratio) | |
Anisotropic Constructor. More... | |
void | Proto::InterpStencil< T >::define (Point a_ratio) |
Define. More... | |
Stencil< T > & | Proto::InterpStencil< T >::operator() (Point a_p) |
Get Read-Write Stencil Subcomponent. More... | |
const Stencil< T > & | Proto::InterpStencil< T >::get (Point a_p) const |
Get Read-Only Stencil Subcomponent. More... | |
Box | Proto::InterpStencil< T >::span () |
Span. More... | |
template<unsigned int C, MemType MEMTYPE, unsigned char D, unsigned char E> | |
LazyStencil< T, C, MEMTYPE, D, E > | Proto::InterpStencil< T >::operator() (const BoxData< T, C, MEMTYPE, D, E > &a_src, T a_scale=1) const |
Lazy Apply. More... | |
template<unsigned int C, MemType MEMTYPE, unsigned char D, unsigned char E> | |
LazyStencil< T, C, MEMTYPE, D, E > | Proto::InterpStencil< T >::operator() (const BoxData< T, C, MEMTYPE, D, E > &a_src, Box a_box, T a_scale=1) const |
Lazy Apply. More... | |
Box | Proto::InterpStencil< T >::kernel () const |
Return Shift Kernel. | |
Point | Proto::InterpStencil< T >::ratio () const |
Return Destination Refinement Ratio. | |
std::vector< Stencil< T > >::iterator | Proto::InterpStencil< T >::begin () |
Iterate Over Stencil Components. | |
std::vector< Stencil< T > >::iterator | Proto::InterpStencil< T >::end () |
Iterate Over Stencil Components. | |
bool | Proto::InterpStencil< T >::empty () |
Empty Query. | |
unsigned long long int | Proto::InterpStencil< T >::size () const |
Size Query. More... | |
double | Proto::fineCoef (Point p, Point s, double h, int refRatio) |
Non-Member Functions | |
template<typename T > | |
Stencil< T > | Proto::operator* (T a_coef, Shift a_shift) |
Coefficient Shift Product "Constructor". More... | |
template<typename T > | |
Stencil< T > | Proto::operator* (T a_coef, const Stencil< T > a_stencil) |
Scalar Multiplication of Stencil Coefficients. More... | |
template<typename T , unsigned int C, MemType MEMTYPE, unsigned char D, unsigned char E> | |
BoxData< T, C, MEMTYPE, D, E > & | Proto::operator|= (BoxData< T, C, MEMTYPE, D, E > &a_dest, LazyStencil< T, C, MEMTYPE, D, E > &&a_op) |
Application by Replacement. More... | |
template<class T , unsigned int C, MemType MEMTYPE, unsigned char D, unsigned char E> | |
BoxData< T, C, MEMTYPE, D, E > & | Proto::operator+= (BoxData< T, C, MEMTYPE, D, E > &a_dest, LazyStencil< T, C, MEMTYPE, D, E > &&a_op) |
Application by Increment. More... | |
Constructors | |
Proto::Shift::Shift () | |
Default Constructor. | |
Proto::Shift::Shift (const Point &a_pt) | |
Point Constructor. More... | |
template<typename... vals> | |
Proto::Shift::Shift (vals... args) | |
Variadic Constructor. More... | |
Methods | |
static Shift | Proto::Shift::Basis (int a_dir, int a_scale=1) |
Basis Shift. More... | |
static Shift | Proto::Shift::Zeros () |
Zero Shift. More... | |
static Shift | Proto::Shift::Ones (int a_scale=1) |
Unit Shift. More... | |
Point & | Proto::Shift::shift () |
Get Shift Point. | |
template<typename T > | |
Stencil< T > | Proto::Shift::operator* (T a_coef) const |
Scalar Multiplication. More... | |
Shift | Proto::Shift::operator* (const Shift &a_shift) const |
Convolution. More... | |
int & | Proto::Shift::operator[] (int a_dir) |
Componentwise Access. | |
Constructors | |
Proto::Stencil< T >::Stencil () | |
Default Constructor. | |
Proto::Stencil< T >::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... | |
Operators | |
Stencil< T > | Proto::Stencil< T >::operator* (const Stencil< T > &a_stencil) const |
Stencil Composition. More... | |
Stencil< T > | Proto::Stencil< T >::operator* (const T a_coef) const |
Scalar Multiplication. More... | |
void | Proto::Stencil< T >::operator*= (const Stencil< T > &a_stencil) |
In Place Stencil Composition. More... | |
void | Proto::Stencil< T >::operator*= (const T a_coef) |
In Place Scalar Multiplication. | |
Stencil< T > | Proto::Stencil< T >::operator+ (const Stencil< T > &a_stencil) const |
Stencil Addition. More... | |
Stencil< T > | Proto::Stencil< T >::operator- (const Stencil< T > &a_stencil) const |
Stencil Subtraction (Convenience) More... | |
void | Proto::Stencil< T >::operator+= (const Stencil< T > &a_stencil) |
In Place Stencil Addition. More... | |
void | Proto::Stencil< T >::operator-= (const Stencil< T > &a_stencil) |
In Place Stencil Subtraction. More... | |
Accessors and Queries | |
bool | Proto::Stencil< T >::operator== (Stencil< T > &a_stencil) const |
bool | Proto::Stencil< T >::operator!= (Stencil< T > &a_stencil) const |
Inquality Operator. More... | |
const std::vector< T > & | Proto::Stencil< T >::coefs () const |
Get Vector of Coefficients. More... | |
const T * | Proto::Stencil< T >::devCoefs () const |
Get Vector of Coefficients. More... | |
const Point * | Proto::Stencil< T >::devOffsets () const |
Get Vector of Offsets. More... | |
const std::vector< Point > & | Proto::Stencil< T >::offsets () const |
Get Vector of Offsets. More... | |
unsigned long long int | Proto::Stencil< T >::size () const |
Size. More... | |
Box | Proto::Stencil< T >::span () const |
Span. More... | |
Point | Proto::Stencil< T >::spanPoint () const |
Span. More... | |
Point | Proto::Stencil< T >::ghost () const |
Ghost. More... | |
Point & | Proto::Stencil< T >::srcRatio () |
Get Source Refinement Ratio. More... | |
const Point & | Proto::Stencil< T >::srcRatio () const |
Get Source Refinement Ratio (Const) | |
Point & | Proto::Stencil< T >::destRatio () |
Get Destination Refinement Ratio. More... | |
const Point & | Proto::Stencil< T >::destRatio () const |
Get Destination Refinement Ratio (Const) | |
Point & | Proto::Stencil< T >::destShift () |
Get Destination Shift. More... | |
const Point & | Proto::Stencil< T >::destShift () const |
Get Destination Shift (Const) | |
Stencil Binding and Application | |
template<unsigned int C, MemType MEMTYPE, unsigned char D, unsigned char E> | |
LazyStencil< T, C, MEMTYPE, D, E > | Proto::Stencil< T >::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 char D, unsigned char E> | |
LazyStencil< T, C, MEMTYPE, D, E > | Proto::Stencil< T >::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... | |
Utility | |
void | Proto::Stencil< T >::invert (int a_dir) |
Invert Stencil. More... | |
void | Proto::Stencil< T >::transpose (unsigned char a, unsigned char b) |
Transpose Stencil. More... | |
Box | Proto::Stencil< T >::indexRange (Box a_domain) const |
Get Max Index Range. More... | |
Box | Proto::Stencil< T >::indexDomain (Box a_range) const |
Get Max Index Domain. More... | |
Box | Proto::Stencil< T >::range (Box a_domain) const |
Get Max Range Box. More... | |
Box | Proto::Stencil< T >::domain (Box a_range) const |
Get Min Domain Box. More... | |
T | Proto::Stencil< T >::diagonalValue () const |
Get Diagonal Value. More... | |
void | Proto::Stencil< T >::print () const |
Print. More... | |
void Proto::Stencil< T >::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.
Manually appy *this to a source and destination BoxData in a functional programming style. Not recommended for public use, but useful for debugging in some cases.
a_src | Source data |
a_dest | Output data |
a_bx | Iteration box for this computation. Can be created with indexDomain or indexRange functions. |
a_replace | (Optional) If true, zero out the data in a_dest and replace with the computation result. If true, solution will be added to existing data. Default false. |
a_scale | (Optional) Scale the computation by some value. |
|
inlinestatic |
Basis Shift.
Shortcut for Shift(Point::Basis(...))
a_dir | Direction of basis vector in [0,DIM) |
a_scale | (OptionL) Amount to scale the basis vector by. (Default 1). |
|
inline |
Get Vector of Coefficients.
Returned vector is read-only. Ordering corresponds to the output of Stencil::offsets()
|
inline |
Define.
Builds an InterpStencil with a destination refinement a_ratio.
a_ratio | destination refinement |
|
inline |
Get Destination Refinement Ratio.
returned reference is mutable. Use this function to set the destination refinement ratio of custom Stencils
|
inline |
Get Destination Shift.
returned reference is mutable. Use this function to set the destination shift of custom Stencils
|
inline |
Get Vector of Coefficients.
Returned vector is read-only. Ordering corresponds to the output of Stencil::offsets()
|
inline |
Get Vector of Offsets.
Returned vector is read-only. Ordering corresponds to the output of Stencil::coefs()
T Proto::Stencil< T >::diagonalValue | ( | ) | const |
Get Diagonal Value.
Returns the coefficient multiplying the identity shift (0,0,...,0)
|
inline |
Get Min Domain Box.
Given a range, compute the smallest associated physical domain, taking refinement AND destination shifting into account. The output of this function is NOT a valid input for a Stencil operation when refinement is present. Thisfunction is best used for defining input BoxData when the output range is known.
a_range | A computational range |
Returns <x^p> over the fine cell s with coarse spacing h
|
inline |
|
inline |
Ghost.
An alias for spanPoint
.
|
inline |
Get Max Index Domain.
Given a domain, compute the largest possible iteration Box, taking source / destination refinement into account. The output of this function is always a valid input for a Stencil operation. For Stencils without source or destination refinement, this function is identical to Stencil::domain.
a_range | A computational range |
|
inline |
Get Max Index Range.
Given a domain, compute the largest possible iteration Box, taking source/ destination refinement into account. For Stencils without source or destination refinement, this function is identical to Stencil::range.
a_domain | A computational domain |
|
inline |
Isotropic Constructor.
Builds an InterpStencil assuming a destination refinement of a_ratio
in all directions.
a_ratio | destination refinement |
|
inline |
Anisotropic Constructor.
Builds an InterpStencil with a destination refinement of a_ratio;
a_ratio | destination refinement |
|
inline |
Invert Stencil.
Inverts the coefficients of this stencil across a given dimension.
|
inline |
Get Vector of Offsets.
Returned vector is read-only. Ordering corresponds to the output of Stencil::coefs()
|
inlinestatic |
Unit Shift.
Shortcut for Shift(Point::Ones(...))
a_scale | (Optional) Used to scale the default output of (1,1,...,1). |
|
inline |
Inquality Operator.
a_stencil | Another Stencil |
|
inline |
|
inline |
|
inline |
|
inline |
Lazy Apply.
Gathers inputs for the composite Stencil operation and stores them in an intermediate LazyStencil to be consumed by a left hand side operator ("=", "|=", or "+="). The syntax is intentionally identical to that used by Stencil.
a_src | Source data |
a_scale | (Optional) value to scale the output of *this by. |
|
inline |
Lazy Apply.
Gathers inputs for the composite Stencil operation and stores them in an intermediate LazyStencil to be consumed by a left hand side operator ("=", "|=", or "+="). The syntax is intentionally identical to that used by Stencil. Explicitly defining a Box input is not recommended unless absolutely necessary.
a_src | Source data |
a_box | Iteration box |
a_scale | (Optional) value to scale the output of *this by. |
|
inline |
Convolution.
The product of two Shift objects is defined as their sum.
Stencil< T > Proto::Stencil< T >::operator* | ( | const Stencil< T > & | a_stencil | ) | const |
Stencil< T > Proto::Stencil< T >::operator* | ( | const T | a_coef | ) | const |
Scalar Multiplication.
The product of a Stencil S and a coefficient v of type T results in the scaling of all the coefficients of S by v.
a_coef | Scaling coefficient |
Coefficient Shift Product "Constructor".
Syntactical sugar that allows a Stencil to be constructed with coef*Shift(Point) syntax
Example:
Scalar Multiplication of Stencil Coefficients.
Allows for pre multiplication by a T scalar
void Proto::Stencil< T >::operator*= | ( | const Stencil< T > & | a_stencil | ) |
Stencil< T > Proto::Stencil< T >::operator+ | ( | const Stencil< T > & | a_stencil | ) | const |
void Proto::Stencil< T >::operator+= | ( | const Stencil< T > & | a_stencil | ) |
BoxData< T, C, MEMTYPE, D, E > & Proto::operator+= | ( | BoxData< T, C, MEMTYPE, D, E > & | a_dest, |
LazyStencil< T, C, MEMTYPE, D, E > && | a_op | ||
) |
Application by Increment.
Applies a LazyStencil and replaces a subset of a_dest with the result:
Usage:
See the main documentation for Stencil for additional examples
a_dest | Destination array |
a_op | Uncomputed Stencil operation |
Stencil< T > Proto::Stencil< T >::operator- | ( | const Stencil< T > & | a_stencil | ) | const |
void Proto::Stencil< T >::operator-= | ( | const Stencil< T > & | a_stencil | ) |
|
inline |
Equality Operator
Equality between Stencils is determined by value
a_stencil | Another Stencil |
|
inline |
Application by Replacement.
Applies a LazyStencil and replaces a subset of a_dest with the result:
Usage:
See the main documentation for Stencil for additional examples
a_dest | Destination array |
a_op | Uncomputed Stencil operation |
|
inline |
Print.
Print *this to the command line. Useful for debugging.
|
inline |
Get Max Range Box.
Given a domain, compute the largest associated physical range, taking refinement AND destination shifting into account. The output of this function is NOT a valid input for a Stencil operation when refinement is present. This function is best used for defining output BoxData when the input domain is known.
a_domain | A computational domain |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
Size.
Defined as the number of coefficient-offset pairs in the stencil
|
inline |
Size Query.
Returns the number of Stencil components in *this.
|
inline |
|
inline |
Span.
Computes the composite span of all Stencils in the InterpStencil
|
inline |
Span.
Returns the span as a Point. Useful when interested only in isotropic ghost regions. this computation will always allow for at least the correct number of ghost cells, and will overestimate in the case of non-isotropic spans.
|
inline |
Get Source Refinement Ratio.
returned reference is mutable. Use this function to set the source refinement ratio of custom Stencils
Proto::Stencil< T >::Stencil | ( | Shift | a_shift, |
T | a_coef, | ||
Point | a_destRefratio = Point::Ones() , |
||
Point | a_destShift = Point::Zeros() , |
||
Point | a_srcRefratio = Point::Ones() |
||
) |
General Constructor.
Creates a Stencil with a single shift and coefficent.
Not recommended for public use; see the Stencil class documentation for examples of how to build a Stencil with Shift - coefficient syntax.
a_shift | Shift of this operation |
a_coef | Coefficient of this operation |
a_destRefratio | (Optional) Destination refinement ratio. Defaults to (1,...,1) (no refinement) |
a_destShift | (Optional) Destination shift. Defaults to (0,...,0) (no shift) |
a_srcRefratio | (Optional) Source refinement ratio. Defaults to (1,...,1) (no refinement) |
|
inline |
Transpose Stencil.
Transposes *this across two directions in [0,DIM). After transpose, coefficients associated with the offset (a,...,b,...) will be associated instead with (b,...,a,...)