Functions System

Overview

Functions 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 Functions should override the following member functions

  • Real value(Real, Point) - returning the value of the function at a point in space and time

  • Real value(ADReal, ADPoint) - the AD enabled version of the above function

  • Real 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 time

  • RealVectorValue 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
  • Functional Expansion Tools App
  • FunctionSeriesThis function uses a convolution of functional series (functional expansion or FX) to create a 1D, 2D, or 3D function
  • Porous Flow App
  • MovingPlanarFrontThis function defines the position of a moving front. The front is an infinite plane with normal pointing from start_posn to end_posn. The front's distance from start_posn is defined by 'distance', so if the 'distance' function is time dependent, the front's position will change with time. Roughly speaking, the function returns true_value for points lying in between start_posn and start_posn + distance. Precisely speaking, two planes are constructed, both with normal pointing from start_posn to end_posn. The first plane passes through start_posn; the second plane passes through end_posn. Given a point p and time t, this function returns false_value if ANY of the following are true: (a) t<activation_time; (b) t>=deactivation_time; (c) p is 'behind' start_posn (ie, p lies on one side of the start_posn plane and end_posn lies on the other side); (d) p is 'ahead' of the front (ie, p lies one one side of the front and start_posn lies on the other side); (e) the distance between p and the front is greater than active_length. Otherwise, the point is 'in the active zone' and the function returns true_value.
  • Phase Field App
  • FourierNoiseGenerate noise from a fourier series
  • Fluid Properties App
  • SaturationPressureFunctionComputes saturation pressure from temperature function and 2-phase fluid properties object
  • SaturationTemperatureFunctionComputes saturation temperature from pressure function and 2-phase fluid properties object
  • Thermal Hydraulics App
  • CircularAreaHydraulicDiameterFunctionComputes hydraulic diameter for a circular area from its area function
  • CosineHumpFunctionComputes a cosine hump of a user-specified width and height
  • CosineTransitionFunctionComputes a cosine transtition of a user-specified width between two values
  • CubicTransitionFunctionComputes a cubic polynomial transition between two functions
  • GeneralizedCircumference
  • PiecewiseFunctionFunction which provides a piecewise representation of arbitrary functions
  • TimeRampFunctionRamps up to a value from another value over time.
  • Reactor App
  • MultiControlDrumFunctionA function that returns an absorber fraction for multiple control drums application.
  • Level Set App
  • LevelSetOlssonBubbleImplementation of 'bubble' ranging from 0 to 1.
  • LevelSetOlssonPlaneImplementation of a level set function to represent a plane.
  • LevelSetOlssonVortexA function for creating vortex velocity fields for level set equation benchmark problems.

Available Actions