23 "N-1 coordinates in the chosen axis, in increasing order, delimiting the N function regions");
24 params.
addRequiredParam<std::vector<FunctionName>>(
"functions",
"Functions in the N regions");
27 "Function which provides a piecewise representation of arbitrary functions");
37 _use_time(_component == 3),
38 _axis_coordinates(getParam<
std::vector<
Real>>(
"axis_coordinates")),
40 _function_names(getParam<
std::vector<FunctionName>>(
"functions")),
41 _n_functions(_function_names.size()),
42 _functions(_n_functions)
47 ": The number of entries in the parameter 'axis_coordinates' must" 48 " equal the number of entries in the parameter 'functions' minus one.");
51 Real previous_coordinate = 0;
56 ": The entries in the parameter 'axis_coordinates' must be in ascending order.");
64 mooseError(
name(),
": This function cannot use its own name in the 'functions' parameter.");
const std::vector< Real > & _axis_coordinates
N-1 coordinates in the chosen axis, in increasing order, delimiting the N function regions...
const unsigned int _n_functions
Number of functions, N.
const std::vector< FunctionName > & _function_names
Names of the functions in the N regions.
Base class for function objects.
virtual Real timeDerivative(Real t, const Point &p) const override
Get the time derivative of the function.
registerMooseObject("MooseApp", PiecewiseFunction)
virtual Real value(Real t, const Point &p) const override
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
const bool _use_time
Use the time axis?
const std::string & name() const
Get the name of the class.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
virtual RealVectorValue gradient(Real t, const Point &p) const override
Function objects can optionally provide a gradient at a point.
static InputParameters validParams()
PiecewiseFunction(const InputParameters ¶meters)
Function which provides a piecewise representation of arbitrary functions.
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.
unsigned int getFunctionIndex(Real t, const Point &p) const
Gets the index of the function at the specified time and spatial point.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
std::vector< const Function * > _functions
Functions in the N regions.
static InputParameters validParams()
Class constructor.
Interface for objects that need to use functions.
const unsigned int _component
Axis on which the N-1 delimiting points lie.