Functions System
Overview
Function
s are used to define functions depending only on spatial position and time: . These objects can serve a wide variety of purposes, including (but not limited to) the following:
defining initial conditions,
defining residual contributions (sources, boundary conditions, etc.), and
defining post-processing quantities.
Moose Function
s should override the following member functions
Real value(Real, Point)
- returning the value of the function at a point in space and timeReal value(ADReal, ADPoint)
- the AD enabled version of the above functionReal timeDerivative(Real, Point)
- retuning the derivative of the function with respect to the first argument (time)RealVectorValue gradient(Real, Point)
- the spatial derivative with respect to the second argument
For vector valued functions
RealVectorValue vectorValue(Real, Point)
- returning a vector value at a point in space and timeRealVectorValue vectorCurl(Real, Point)
- returning the curl of the function at a point in space and time
can be overridden. The optional Real integral()
and Real average()
methods can also be overridden. Note that two overloads exist for the value()
member function. This enables evaluation of functions with dual numbers. As most legacy function do not implement an AD overload of the value()
function, the Function
base class automatically provides one that uses the non-AD value()
, timeDerivative()
, and gradient()
member functions to construct an AD result. Check out PiecewiseBilinear
to see how to update a function to support AD by using a templated valueInternal()
function with virtual value()
forwarders.
Available Objects
- Moose App
- ADParsedFunctionFunction created by parsing a string
- ADPiecewiseLinearLinearly interpolates between pairs of x-y data
- Axisymmetric2D3DSolutionFunctionFunction for reading a 2D axisymmetric solution from file and mapping it to a 3D Cartesian model
- BicubicSplineFunctionDefine a bicubic spline function from interpolated data defined by input parameters.
- CoarsenedPiecewiseLinearPerform a point reduction of the tabulated data upon initialization, then evaluate using a linear interpolation.
- CompositeFunctionMultiplies an arbitrary set of functions together
- ConstantFunctionA function that returns a constant value as defined by an input parameter.
- ImageFunctionFunction with values sampled from an image or image stack.
- LinearCombinationFunctionReturns the linear combination of the functions
- ParsedFunctionFunction created by parsing a string
- ParsedGradFunctionDefines a function and its gradient using input file parameters.
- ParsedVectorFunctionReturn a vector component values based on a string function.
- PiecewiseBilinearInterpolates values from a csv file
- PiecewiseConstantDefines data using a set of x-y data pairs
- PiecewiseConstantFromCSVUses data read from CSV to assign values
- PiecewiseLinearLinearly interpolates between pairs of x-y data
- PiecewiseMulticonstantPiecewiseMulticonstant performs constant interpolation on 1D, 2D, 3D or 4D data. The data_file specifies the axes directions and the function values. If a point lies outside the data range, the appropriate end value is used.
- PiecewiseMultilinearPiecewiseMultilinear performs linear interpolation on 1D, 2D, 3D or 4D data. The data_file specifies the axes directions and the function values. If a point lies outside the data range, the appropriate end value is used.
- SolutionFunctionFunction for reading a solution from file.
- SplineFunctionDefine a spline function from interpolated data defined by input parameters.
- VectorPostprocessorFunctionProvides piecewise linear interpolation of from two columns of a VectorPostprocessor
- Aurora App
- VariableFunction
Available Actions
- Moose App
- AddFunctionActionAdd a Function object to the simulation.