19 "functions",
"This function will return Sum_over_i(w_i * functions_i)");
21 "w",
"This function will return Sum_over_i(w_i * functions_i)");
29 const auto fname_w = getParam<FunctionName, Real>(
"functions",
"w");
31 for (
const auto & fw : fname_w)
33 if (
name() == fw.first)
34 paramError(
"functions",
"A LinearCombinationFunction must not reference itself");
44 for (
const auto & fw :
_fw)
45 val += fw.first->value(t, p) * fw.second;
53 for (
const auto & fw :
_fw)
54 val += fw.first->value(t, p) * fw.second;
62 for (
const auto & fw :
_fw)
63 g += fw.first->gradient(t, p) * fw.second;
71 for (
const auto & fw :
_fw)
72 v += fw.first->vectorValue(t, p) * fw.second;
Sum_over_i (w_i * functions_i)
Base class for function objects.
registerMooseObject("MooseApp", LinearCombinationFunction)
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
static InputParameters validParams()
virtual RealVectorValue vectorValue(Real t, const Point &p) const override
Override this to evaluate the vector function at a point (t,x,y,z), by default this returns a zero ve...
LinearCombinationFunction(const InputParameters ¶meters)
std::vector< std::pair< const Function *, Real > > _fw
DualNumber< Real, DNDerivativeType, true > ADReal
const std::string & name() const
Get the name of the class.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Function & getFunctionByName(const FunctionName &name) const
Get a function with a given name.
virtual Real value(Real t, const Point &pt) const override
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
virtual RealGradient gradient(Real t, const Point &p) const override
Function objects can optionally provide a gradient at a point.
static InputParameters validParams()
Class constructor.
Interface for objects that need to use functions.