13#ifndef DUMUX_ASSEMBLY_NUMERIC_EPSILON_HH
14#define DUMUX_ASSEMBLY_NUMERIC_EPSILON_HH
18#include <dune/common/fvector.hh>
30template<
class Scalar,
int numEq>
33 using Magnitude = std::decay_t<decltype(abs(std::declval<Scalar>()))>;
34 using NumEqVector = Dune::FieldVector<Magnitude, numEq>;
49 Scalar
operator() (Scalar priVar,
int priVarIdx)
const noexcept
51 return magnitude_[priVarIdx] > 0.0 ? Scalar(baseEps_*magnitude_[priVarIdx])
static Scalar epsilon(const Scalar value, const Scalar baseEps=1e-10)
Computes the epsilon used for numeric differentiation.
Definition numericdifferentiation.hh:36
NumericEpsilon(const std::string ¶mGroup="")
Definition numericepsilon.hh:37
Scalar operator()(Scalar priVar, int priVarIdx) const noexcept
get the epsilon
Definition numericepsilon.hh:49
typename NumEqVectorTraits< PrimaryVariables >::type NumEqVector
A vector with the same size as numbers of equations This is the default implementation and has to be ...
Definition numeqvector.hh:34
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:149
A class for numeric differentiation.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.