29 mooseError(
"Classes derived from PiecewiseLinearBase need to call buildInterpolation()");
40 catch (std::domain_error & e)
94 return value(t1, p) * (t2 - t1);
DualNumber< Real, DNDerivativeType, true > ADReal
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
const std::string & _name
The name of this class.
virtual void setData(const std::vector< Real > &x, const std::vector< Real > &y)
Provides a means for explicitly setting the x and y data.
std::vector< Real > _raw_x
raw function data as read
std::vector< Real > _raw_y
virtual Real integral() const override
Returns the integral of the function over its domain.
std::unique_ptr< LinearInterpolation > _linear_interp
helper object to perform the linear interpolation of the function data
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
virtual Real average() const override
Returns the average of the function over its domain.
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,...
virtual RealGradient gradient(Real, const Point &p) const override
Function objects can optionally provide a gradient at a point.
virtual Real timeIntegral(Real t1, Real t2, const Point &p) const override
Computes the time integral at a spatial point between two time values.
PiecewiseLinearBase(const InputParameters ¶meters)
void buildInterpolation(const bool extrap=false)
Builds the linear interpolation object from the x/y data.
static InputParameters validParams()
virtual void setData(const std::vector< Real > &x, const std::vector< Real > &y) override
Provides a means for explicitly setting the x and y data.
virtual Real timeDerivative(Real t, const Point &) const override
Get the time derivative of the function.
Function base which provides a piecewise approximation to a provided (x,y) point data set via input p...
static InputParameters validParams()
const Real & _scale_factor
function value scale factor
unsigned int _axis
if _has_axis is true point component to use as function argument, otherwise use t