Proto  3.2
Classes | Functions | Variables | Friends
Stencil Operations

Classes

class  Proto::InterpStencil1D< T >
 Interpolation Stencil. More...
 
class  Proto::Shift
 Stencil Shift. More...
 
class  Proto::Stencil< T >
 A Linear Stencil Operation. More...
 

Functions

Box Proto::InterpStencil1D< T >::span () const
 Span. More...
 
Point Proto::InterpStencil1D< T >::ghost () const
 Ghost Size. More...
 
template<unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E>
LazyStencil< T, C, MEMTYPE, D, E > Proto::InterpStencil1D< 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 int D, unsigned int E>
LazyStencil< T, C, MEMTYPE, D, E > Proto::InterpStencil1D< T >::operator() (const BoxData< T, C, MEMTYPE, D, E > &a_src, Box a_box, T a_scale=1) const
 Lazy Apply. More...
 
unsigned int Proto::InterpStencil1D< T >::ratio () const
 Return Destination Refinement Ratio. More...
 
std::vector< Stencil< T > >::iterator Proto::InterpStencil1D< T >::begin ()
 Iterate Over Stencil Components. More...
 
std::vector< Stencil< T > >::iterator Proto::InterpStencil1D< T >::end ()
 Iterate Over Stencil Components. More...
 
template<unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int 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...
 

Variables

Point Proto::Shift::m_shift
 

Friends

template<typename TT , unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E>
class Proto::Stencil< T >::BoxData
 
template<typename TT , unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E>
BoxData< TT, C, MEMTYPE, D, E > & Proto::Stencil< T >::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 > & Proto::Stencil< T >::operator+= (BoxData< TT, C, MEMTYPE, D, E > &a_dest, LazyStencil< TT, C, MEMTYPE, D, E > &&a_op)
 

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 >
Stencil< T > Proto::operator- (Stencil< T > a_stencil)
 Stencil Unary Negation. More...
 
template<typename T , unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int 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 int D, unsigned int 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. More...
 
 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...
 
static Shift Proto::Shift::X (int scale=1)
 
static Shift Proto::Shift::Y (int scale=1)
 
static Shift Proto::Shift::Z (int scale=1)
 
PointProto::Shift::point ()
 Get Shift Point. More...
 
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. More...
 

Constructors

 Proto::Stencil< T >::Stencil ()
 Default Constructor. More...
 
 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...
 
 Proto::Stencil< T >::~Stencil ()
 

Operators

bool Proto::Stencil< T >::operator== (const Stencil< T > &a_stencil) const
 Equality Operator. More...
 
bool Proto::Stencil< T >::operator!= (const Stencil< T > &a_stencil) const
 Inquality Operator. More...
 
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. More...
 
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

const std::vector< T > & Proto::Stencil< T >::coefs () const
 Get Vector of Coefficients. More...
 
const std::vector< Point > & Proto::Stencil< T >::offsets () const
 Get Vector of Coefficients (Primitive) More...
 
unsigned long long int Proto::Stencil< T >::size () const
 Get Vector of Offsets. More...
 
Box Proto::Stencil< T >::span () const
 Span. More...
 
Point Proto::Stencil< T >::ghost () const
 Ghost. More...
 
PointProto::Stencil< T >::srcRatio ()
 Get Source Refinement Ratio. More...
 
const PointProto::Stencil< T >::srcRatio () const
 Get Source Refinement Ratio (Const) More...
 
PointProto::Stencil< T >::destRatio ()
 Get Destination Refinement Ratio. More...
 
const PointProto::Stencil< T >::destRatio () const
 Get Destination Refinement Ratio (Const) More...
 
PointProto::Stencil< T >::destShift ()
 Get Destination Shift. More...
 
const PointProto::Stencil< T >::destShift () const
 Get Destination Shift (Const) More...
 
unsigned long long int Proto::Stencil< T >::numFlops (const Box &a_box) const
 Num Flops. More...
 
bool Proto::Stencil< T >::closed () const
 Stencil Closed Query. More...
 

Stencil Binding and Application

template<unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int 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 int D, unsigned int 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 int a, unsigned int 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...
 
Proto::Stencil< T >::diagonal () const
 Get Diagonal Value. More...
 
void Proto::Stencil< T >::print () const
 Print. More...
 

Detailed Description

Function Documentation

◆ span() [1/2]

template<class T >
Box Proto::InterpStencil1D< T >::span ( ) const
inline

Span.

Computes the composite span of all Stencils in the InterpStencil1D

◆ ghost() [1/2]

template<class T >
Point Proto::InterpStencil1D< T >::ghost ( ) const
inline

Ghost Size.

Conservatively computes the amount of ghost data needed to apply this InterpStencil1D. May overestimate in the case of assymmetric InterpStencil1D footprints.

◆ operator()() [1/4]

template<class T >
template<unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E>
LazyStencil< T, C, MEMTYPE, D, E > Proto::InterpStencil1D< T >::operator() ( const BoxData< T, C, MEMTYPE, D, E > &  a_src,
a_scale = 1 
) const
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 identical to that used by Stencil.

Parameters
a_srcSource data
a_scale(Optional) value to scale the output of *this by.

◆ operator()() [2/4]

template<class T >
template<unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E>
LazyStencil< T, C, MEMTYPE, D, E > Proto::InterpStencil1D< T >::operator() ( const BoxData< T, C, MEMTYPE, D, E > &  a_src,
Box  a_box,
a_scale = 1 
) const
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 identical to that used by Stencil. Explicitly defining a Box input is not recommended unless absolutely necessary.

Parameters
a_srcSource data
a_boxIteration box
a_scale(Optional) value to scale the output of *this by.

◆ ratio()

template<class T>
unsigned int Proto::InterpStencil1D< T >::ratio ( ) const
inline

Return Destination Refinement Ratio.

References Proto::InterpStencil1D< T >::m_r.

◆ begin()

template<class T>
std::vector<Stencil<T> >::iterator Proto::InterpStencil1D< T >::begin ( )
inline

Iterate Over Stencil Components.

References Proto::InterpStencil1D< T >::m_s.

◆ end()

template<class T>
std::vector<Stencil<T> >::iterator Proto::InterpStencil1D< T >::end ( )
inline

◆ Shift() [1/3]

Proto::Shift::Shift ( )
inline

◆ Shift() [2/3]

Proto::Shift::Shift ( const Point a_pt)
inlineexplicit

Point Constructor.

Builds a Shift from a Point

Parameters
a_ptPoint to base this Shift on

References Proto::Shift::m_shift.

◆ Shift() [3/3]

template<typename... vals>
Proto::Shift::Shift ( vals...  args)
inlineexplicit

Variadic Constructor.

More or less identical to the variadic Point constructor. Builds a Shift using the first DIM arguments and ignores the rest.

Parameters
argsAt least DIM int arguments, the first DIM of which define *this

◆ Basis()

static Shift Proto::Shift::Basis ( int  a_dir,
int  a_scale = 1 
)
inlinestatic

Basis Shift.

Shortcut for Shift(Point::Basis(...))

Parameters
a_dirDirection of basis vector in [0,DIM)
a_scale(Optional) Amount to scale the basis vector by. (Default: 1).

References Proto::Point::Basis(), and Proto::Shift::Shift().

◆ Zeros()

static Shift Proto::Shift::Zeros ( )
inlinestatic

Zero Shift.

Shortcut for Shift(Point::Zeros())

References Proto::Shift::Shift(), and Proto::Point::Zeros().

Referenced by Proto::Stencil< double >::Identity().

◆ Ones()

static Shift Proto::Shift::Ones ( int  a_scale = 1)
inlinestatic

Unit Shift.

Shortcut for Shift(Point::Ones(...))

Parameters
a_scale(Optional) Used to scale the output. (Default: 1).

References Proto::Point::Ones(), and Proto::Shift::Shift().

◆ X()

static Shift Proto::Shift::X ( int  scale = 1)
inlinestatic

◆ Y()

static Shift Proto::Shift::Y ( int  scale = 1)
inlinestatic

◆ Z()

static Shift Proto::Shift::Z ( int  scale = 1)
inlinestatic

◆ point()

Point& Proto::Shift::point ( )
inline

Get Shift Point.

References Proto::Shift::m_shift.

◆ operator*() [1/6]

template<typename T >
Stencil<T> Proto::Shift::operator* ( a_coef) const
inline

Scalar Multiplication.

Generates a Stencil<T> from the product of a scalar T coefficient and a Shift. This operator is what allows for a fluid Stencil construction syntax:

Parameters
a_coefA coefficient

Examples:

// DIM == 1
Stencil<double> S1 = 1.0*Shift(-1) - 2.0*Shift(0) + 1.0*Shift(1);
// DIM - independant
Stencil<double> S2 = (-2*DIM)*Shift::Zeros();
for (int dir = 0; dir < DIM; dir++)
{
S2 += 1.0*Shift::Basis(dir, -1);
S2 += 1.0*Shift::Basis(dir, +1);
}

Referenced by Proto::Stencil< double >::operator!=().

◆ operator*() [2/6]

Shift Proto::Shift::operator* ( const Shift a_shift) const
inline

Convolution.

The product of two Shift objects is defined as their sum.

Parameters
a_shiftAnother Shift.

References Proto::Shift::m_shift, and Proto::Shift::Shift().

◆ operator[]()

int& Proto::Shift::operator[] ( int  a_dir)
inline

Componentwise Access.

References Proto::Shift::m_shift, and PROTO_ASSERT.

◆ Stencil() [1/2]

template<typename T>
Proto::Stencil< T >::Stencil ( )

Default Constructor.

◆ Stencil() [2/2]

template<typename T>
Proto::Stencil< T >::Stencil ( Shift  a_shift,
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.

Parameters
a_shiftShift of this operation
a_coefCoefficient of this operation
a_destRefratio(Optional) Destination refinement ratio. [Default: (1,...,1) ]
a_destShift(Optional) Destination shift. [Default: (0,...,0) ]
a_srcRefratio(Optional) Source refinement ratio. [Default: (1,...,1) ]

◆ ~Stencil()

template<typename T>
Proto::Stencil< T >::~Stencil ( )

◆ operator==()

template<typename T>
bool Proto::Stencil< T >::operator== ( const Stencil< T > &  a_stencil) const
inline

Equality Operator.

Equality between Stencils is determined by value

Parameters
a_stencilAnother Stencil

◆ operator!=()

template<typename T>
bool Proto::Stencil< T >::operator!= ( const Stencil< T > &  a_stencil) const
inline

Inquality Operator.

Parameters
a_stencilAnother Stencil

◆ operator*() [3/6]

template<typename T>
Stencil<T> Proto::Stencil< T >::operator* ( const Stencil< T > &  a_stencil) const

Stencil Composition.

The product of two Stencils is defined as their composition.

Parameters
a_stencilAnother Stencil

◆ operator*() [4/6]

template<typename T>
Stencil<T> Proto::Stencil< T >::operator* ( const T  a_coef) const

Scalar Multiplication.

The product of a Stencil S and a coefficient v results in the scaling of all the coefficients of S by v.

Parameters
a_coefScaling coefficient

◆ operator*=() [1/2]

template<typename T>
void Proto::Stencil< T >::operator*= ( const Stencil< T > &  a_stencil)

In Place Stencil Composition.

Parameters
a_stencilAnother Stencil

◆ operator*=() [2/2]

template<typename T>
void Proto::Stencil< T >::operator*= ( const T  a_coef)

In Place Scalar Multiplication.

◆ operator+()

template<typename T>
Stencil<T> Proto::Stencil< T >::operator+ ( const Stencil< T > &  a_stencil) const

Stencil Addition.

Adding two Stencils results in a new Stencil which is the union of the coefficent-Shift pairs of the inputs. If the two input Stencils share a common Shift, the associated coefficients will be added together.

Parameters
a_stencilAnother Stencil

◆ operator-() [1/2]

template<typename T>
Stencil<T> Proto::Stencil< T >::operator- ( const Stencil< T > &  a_stencil) const

Stencil Subtraction (Convenience)

Equivalent to adding a_stencil*(-1)

Parameters
a_stencilAnother Stencil

◆ operator+=() [1/2]

template<typename T>
void Proto::Stencil< T >::operator+= ( const Stencil< T > &  a_stencil)

In Place Stencil Addition.

Parameters
a_stencilAnother Stencil

◆ operator-=()

template<typename T>
void Proto::Stencil< T >::operator-= ( const Stencil< T > &  a_stencil)

In Place Stencil Subtraction.

Parameters
a_stencilAnother Stencil

◆ coefs()

template<typename T>
const std::vector<T>& Proto::Stencil< T >::coefs ( ) const
inline

Get Vector of Coefficients.

Returned vector is read-only. Ordering corresponds to the output of Stencil::offsets()

◆ offsets()

template<typename T>
const std::vector<Point>& Proto::Stencil< T >::offsets ( ) const
inlineprivate

Get Vector of Coefficients (Primitive)

primitive version for testing purposes CURRENTLY UNUSED?Get Vector of Offsets

Returned vector is read-only. Ordering corresponds to the output of Stencil::coefs()

◆ size()

template<typename T>
unsigned long long int Proto::Stencil< T >::size ( ) const
inlineprivate

Get Vector of Offsets.

primitive version for testing purposes CURRENTLY UNUSED?Size

Defined as the number of coefficient-offset pairs in the stencil

◆ span() [2/2]

template<typename T>
Box Proto::Stencil< T >::span ( ) const
inline

Span.

Returns a Box which bounds all offsets in *this. Useful for automated ghost-cell checks.

Example:

//DIM = 2
using namespace Proto;
Stencil<T> S = 1.0*Shift(0,-1) +
2.0*Shift(0,2) +
3.0*Shift(1,3);
std::cout << S.span() << std::endl; //prints [(-1,0), (2,3)]

◆ ghost() [2/2]

template<typename T>
Point Proto::Stencil< T >::ghost ( ) const
inline

Ghost.

Returns the span as a Point. Useful when interested only in isotropic ghost regions. This function will always allow for at least the correct number of ghost cells, and will overestimate in the case of non-isotropic spans.

◆ srcRatio() [1/2]

template<typename T>
Point& Proto::Stencil< T >::srcRatio ( )
inline

Get Source Refinement Ratio.

◆ srcRatio() [2/2]

template<typename T>
const Point& Proto::Stencil< T >::srcRatio ( ) const
inline

Get Source Refinement Ratio (Const)

◆ destRatio() [1/2]

template<typename T>
Point& Proto::Stencil< T >::destRatio ( )
inline

Get Destination Refinement Ratio.

◆ destRatio() [2/2]

template<typename T>
const Point& Proto::Stencil< T >::destRatio ( ) const
inline

Get Destination Refinement Ratio (Const)

◆ destShift() [1/2]

template<typename T>
Point& Proto::Stencil< T >::destShift ( )
inline

Get Destination Shift.

◆ destShift() [2/2]

template<typename T>
const Point& Proto::Stencil< T >::destShift ( ) const
inline

Get Destination Shift (Const)

◆ numFlops()

template<typename T>
unsigned long long int Proto::Stencil< T >::numFlops ( const Box a_box) const
inlineprivate

Num Flops.

Compute the number of FLOPS needed to evaluate this Stencil on the box a_box

◆ closed()

template<typename T>
bool Proto::Stencil< T >::closed ( ) const
inline

Stencil Closed Query.

Ask if *this has been properly closed.

◆ operator()() [3/4]

template<typename T>
template<unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E>
LazyStencil<T,C,MEMTYPE,D,E> Proto::Stencil< T >::operator() ( const BoxData< T, C, MEMTYPE, D, E > &  a_src,
a_scale = 1 
) const
inline

Operate on BoxData.

Operate *this on a BoxData. This function works in tandem with the namespace-defined operators += and |=. See the example in the description of Stencil.

Parameters
a_scrSource BoxData
a_scale(Optional) Scale the output of the Stencil operation (Default: 1)

◆ operator()() [4/4]

template<typename T>
template<unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E>
LazyStencil<T,C,MEMTYPE,D,E> Proto::Stencil< T >::operator() ( const BoxData< T, C, MEMTYPE, D, E > &  a_src,
Box  a_box,
a_scale = 1 
) const
inline

Operate on BoxData (Overload with Box Input)

Operate *this on a BoxData. This function works in tandem with the namespace-defined operators += and |=. See the example in the description of Stencil.

Parameters
a_scrSource BoxData
a_boxConfinement Box. Must be a subset of the allowable range of *this
a_scale(Optional) Scale the output of the Stencil operation (Default: 1)

◆ invert()

template<typename T>
void Proto::Stencil< T >::invert ( int  a_dir)
inline

Invert Stencil.

Inverts the coefficients of this stencil across a given dimension.

◆ transpose()

template<typename T>
void Proto::Stencil< T >::transpose ( unsigned int  a,
unsigned int  b 
)
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,...)

◆ indexRange()

template<typename T>
Box Proto::Stencil< T >::indexRange ( Box  a_domain) const
inlineprivate

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. This function is used primarily for Box inference and probably shouldn't be used publically.

Parameters
a_domainA computational domain

◆ indexDomain()

template<typename T>
Box Proto::Stencil< T >::indexDomain ( Box  a_range) const
inlineprivate

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. This function is used primarily for Box inference and probably shouldn't be used publically.

Parameters
a_rangeA computational range

◆ range()

template<typename T>
Box Proto::Stencil< T >::range ( Box  a_domain) const
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.

Parameters
a_domainA computational domain

◆ domain()

template<typename T>
Box Proto::Stencil< T >::domain ( Box  a_range) const
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. This function is best used for defining input BoxData when the output range is known.

Parameters
a_rangeA computational range

◆ diagonal()

template<typename T>
T Proto::Stencil< T >::diagonal ( ) const

Get Diagonal Value.

Returns the coefficient multiplying the identity shift (0,0,...,0). If *this doesn't contain the identity shift, returns 0.

◆ print()

template<typename T>
void Proto::Stencil< T >::print ( ) const
inline

Print.

Print *this to the command line. Useful for debugging.

◆ apply()

template<typename T>
template<unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int 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.

Manually apply *this to a source and destination BoxData in a functional programming style. Not recommended for public use, but useful for debugging in some cases.

Parameters
a_srcSource data
a_destOutput data
a_bxIteration 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.

◆ operator*() [5/6]

template<typename T >
Stencil<T> Proto::operator* ( a_coef,
Shift  a_shift 
)
inline

Coefficient Shift Product "Constructor".

Syntactical sugar that allows a Stencil to be constructed with coef*Shift(Point) syntax

Example:

Stencil<double> S = 3.7*Shift(Point::Basis(0));

◆ operator*() [6/6]

template<typename T >
Stencil<T> Proto::operator* ( a_coef,
const Stencil< T >  a_stencil 
)
inline

Scalar Multiplication of Stencil Coefficients.

Allows for pre multiplication by a T scalar

◆ operator-() [2/2]

template<typename T >
Stencil<T> Proto::operator- ( Stencil< T >  a_stencil)
inline

Stencil Unary Negation.

References Proto::operator+=(), and Proto::operator|=().

◆ operator|=()

template<typename T , unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int 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 
)
inline

Application by Replacement.

Applies a Stencil and REPLACES a subset of a_dest with the result:

Usage:

Stencil<double> L = Stencil<double>::Laplacian(); //2*DIM+1 point Laplacian operator
Box rangeBox = Box::Cube(64); //define the data range
Box domainBox = L.domain(rangeBox); //compute the domain from the range
BoxData<double> Src(domainBox);
BoxData<double> Dst(rangeBox);
// ... initialize Src ...
Dst |= L(Src);
// NB: This call computes the Laplacian of Src and replaces the values of Dst
// inside rangeBox with the result. Only the cells in rangeBox & Dst.box()
// are affected. If rangeBox & Dst.box() is empty, |= is a null-op.

TODO: These examples are missing. See the main documentation for Stencil for additional examples

Parameters
a_destDestination array
a_opUncomputed Stencil operation (output of Stencil::operator())

◆ operator+=() [2/2]

template<class T , unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int 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.

Applies a Stencil and ADDS a subset of a_dest with the result

Usage:

Stencil<double> L = Stencil<double>::Laplacian(); //2*DIM+1 point Laplacian operator
Box rangeBox = Box::Cube(64); //define the data range
Box domainBox = L.domain(rangeBox); //compute the domain from the range
BoxData<double> Src(domainBox);
BoxData<double> Dst(rangeBox);
// ... initialize Src ...
Dst += L(Src);
// NB: This call computes the Laplacian of Src and addds the values of Dst
// inside rangeBox with the result. Only the cells in rangeBox & Dst.box()
// are affected. If rangeBox & Dst.box() is empty, |= is a null-op.

TODO: These examples are missing. See the main documentation for Stencil for additional examples

Parameters
a_destDestination array
a_opUncomputed Stencil operation (output of Stencil::operator())

Variable Documentation

◆ m_shift

Point Proto::Shift::m_shift
private

Friends

◆ BoxData

template<typename T>
template<typename TT , unsigned int C, MemType MEMTYPE, unsigned int D, unsigned int E>
friend class BoxData
friend

◆ operator|=

template<typename T>
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 
)
friend

◆ operator+=

template<typename T>
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 
)
friend