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. | |
An analytical evaluator to be used for exact comparisons in tests.
|
inline |
A constructor taking the range over which the evaluator will be applied.
This sets the equation to: \( cos(2 \pi x) \)
[in] | idx_range | The range of the grid over which the evaluator will be applied. |
|
inline |
A constructor parametrising the equation.
This sets the equation to: \( cos(2 \pi (c_0 x + c_1)) \)
[in] | c0 | The first parameter of the equation. |
[in] | c1 | The second parameter of the equation. |
|
inlinenoexcept |
Evaluate the equation at x.
[in] | x | The position where the equation is evaluated. |
|
inline |
Evaluate the equation at the positions on which chunk is defined.
[out] | chunk | The result of the equation. |
|
inlinenoexcept |
Evaluate the derivative of the equation at x.
[in] | x | The position where the equation is evaluated. |
[in] | derivative | The order of the derivative. |
|
inline |
Evaluate the derivative of the equation at the positions on which chunk is defined.
[out] | chunk | The result of the equation. |
[in] | derivative | The order of the derivative. |
|
inline |
The maximum norm of this equation.
Used for normalisation.
[in] | diff | The derivative whose max norm should be returned. |