13#ifndef DUMUX_ASSEMBLY_NUMERIC_EPSILON_HH
14#define DUMUX_ASSEMBLY_NUMERIC_EPSILON_HH
18#include <dune/common/fvector.hh>
19#include <dune/common/ftraits.hh>
31template<
class Scalar,
int numEq>
34 using Magnitude =
typename Dune::FieldTraits<Scalar>::real_type;
35 using NumEqVector = Dune::FieldVector<Magnitude, numEq>;
51 Magnitude
operator() (Scalar priVar,
int priVarIdx)
const noexcept
53 return magnitude_[priVarIdx] > 0.0 ? baseEps_*magnitude_[priVarIdx]
static Magnitude epsilon(const Scalar value, const Magnitude baseEps=1e-10)
Computes the epsilon used for numeric differentiation.
Definition numericdifferentiation.hh:42
Magnitude operator()(Scalar priVar, int priVarIdx) const noexcept
get the epsilon
Definition numericepsilon.hh:51
NumericEpsilon(const std::string ¶mGroup="")
Definition numericepsilon.hh:38
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:165
A class for numeric differentiation.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.