Gyselalib++
 
Loading...
Searching...
No Matches
PolynomialEvaluator::Evaluator< Grid1D, Degree > 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.
 
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, std::size_t Degree>
class PolynomialEvaluator::Evaluator< Grid1D, Degree >

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

Constructor & Destructor Documentation

◆ Evaluator()

template<class Grid1D , std::size_t Degree>
template<class IdxRange >
PolynomialEvaluator::Evaluator< Grid1D, Degree >::Evaluator ( IdxRange  idx_range)
inline

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

The polynomial is initialised with random values between 0.0 and 1.0

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

Member Function Documentation

◆ operator()() [1/2]

template<class Grid1D , std::size_t Degree>
double PolynomialEvaluator::Evaluator< Grid1D, Degree >::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 , std::size_t Degree>
void PolynomialEvaluator::Evaluator< Grid1D, Degree >::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 , std::size_t Degree>
double PolynomialEvaluator::Evaluator< Grid1D, Degree >::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 , std::size_t Degree>
void PolynomialEvaluator::Evaluator< Grid1D, Degree >::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 , std::size_t Degree>
double PolynomialEvaluator::Evaluator< Grid1D, Degree >::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: