Gyselalib++
 
Loading...
Searching...
No Matches
CosineEvaluator::Evaluator< Grid1D > Class Template Reference

An analytical evaluator to be used for exact comparisons in tests. More...

Public Types

using Dim = Grid1D
 The grid dimension.
 

Public Member Functions

template<class IdxRange >
 Evaluator (IdxRange idx_range)
 A constructor taking the range over which the evaluator will be applied.
 
 Evaluator (double c0, double c1)
 A constructor parametrising the equation.
 
double operator() (double const x) const noexcept
 Evaluate the equation at x.
 
void operator() (ddc::ChunkSpan< double, ddc::DiscreteDomain< Grid1D > > chunk) const
 Evaluate the equation at the positions on which chunk is defined.
 
double deriv (double const x, int const derivative) const noexcept
 Evaluate the derivative of the equation at x.
 
void deriv (ddc::ChunkSpan< double, ddc::DiscreteDomain< Grid1D > > chunk, int const derivative) const
 Evaluate the derivative of the equation at the positions on which chunk is defined.
 
double max_norm (int diff=0) const
 The maximum norm of this equation.
 

Detailed Description

template<class Grid1D>
class CosineEvaluator::Evaluator< Grid1D >

An analytical evaluator to be used for exact comparisons in tests.

Constructor & Destructor Documentation

◆ Evaluator() [1/2]

template<class Grid1D >
template<class IdxRange >
CosineEvaluator::Evaluator< Grid1D >::Evaluator ( IdxRange  idx_range)
inline

A constructor taking the range over which the evaluator will be applied.

This sets the equation to: \( cos(2 \pi x) \)

Parameters
[in]idx_rangeThe range of the grid over which the evaluator will be applied.

◆ Evaluator() [2/2]

template<class Grid1D >
CosineEvaluator::Evaluator< Grid1D >::Evaluator ( double  c0,
double  c1 
)
inline

A constructor parametrising the equation.

This sets the equation to: \( cos(2 \pi (c_0 x + c_1)) \)

Parameters
[in]c0The first parameter of the equation.
[in]c1The second parameter of the equation.

Member Function Documentation

◆ operator()() [1/2]

template<class Grid1D >
double CosineEvaluator::Evaluator< Grid1D >::operator() ( double const  x) const
inlinenoexcept

Evaluate the equation at x.

Parameters
[in]xThe position where the equation is evaluated.
Returns
The result of the equation.

◆ operator()() [2/2]

template<class Grid1D >
void CosineEvaluator::Evaluator< Grid1D >::operator() ( ddc::ChunkSpan< double, ddc::DiscreteDomain< Grid1D > >  chunk) const
inline

Evaluate the equation at the positions on which chunk is defined.

Parameters
[out]chunkThe result of the equation.

◆ deriv() [1/2]

template<class Grid1D >
double CosineEvaluator::Evaluator< Grid1D >::deriv ( double const  x,
int const  derivative 
) const
inlinenoexcept

Evaluate the derivative of the equation at x.

Parameters
[in]xThe position where the equation is evaluated.
[in]derivativeThe order of the derivative.
Returns
The result of the equation.

◆ deriv() [2/2]

template<class Grid1D >
void CosineEvaluator::Evaluator< Grid1D >::deriv ( ddc::ChunkSpan< double, ddc::DiscreteDomain< Grid1D > >  chunk,
int const  derivative 
) const
inline

Evaluate the derivative of the equation at the positions on which chunk is defined.

Parameters
[out]chunkThe result of the equation.
[in]derivativeThe order of the derivative.

◆ max_norm()

template<class Grid1D >
double CosineEvaluator::Evaluator< Grid1D >::max_norm ( int  diff = 0) const
inline

The maximum norm of this equation.

Used for normalisation.

Parameters
[in]diffThe derivative whose max norm should be returned.
Returns
The maximum value of the infinite norm.

The documentation for this class was generated from the following file: