18 params.
addParam<std::vector<FunctionName>>(
"functions",
19 "The functions to be multiplied together.");
20 params.
addParam<
Real>(
"scale_factor", 1.0,
"Scale factor to be applied to the ordinate values");
29 const std::vector<FunctionName> & names = getParam<std::vector<FunctionName>>(
"functions");
30 const unsigned int len = names.size();
32 mooseError(
"A composite function must reference at least one other function");
36 for (
unsigned i = 0; i < len; ++i)
38 if (
name() == names[i])
39 mooseError(
"A composite function must not reference itself");
44 std::string msg(
"Error in composite function ");
48 msg +=
" referenced but not found.";
60 for (
const auto & func :
_f)
61 val *= func->value(t, p);
71 for (
const auto & func :
_f)
72 val *= func->value(t, p);
static InputParameters validParams()
Base class for function objects.
virtual const std::string & name() const
Get the name of the class.
Base class for function objects.
CompositeFunction(const InputParameters ¶meters)
registerMooseObject("MooseApp", CompositeFunction)
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...
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.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
static InputParameters validParams()
Class constructor.
Interface for objects that need to use functions.
std::vector< const Function * > _f