20 "Demonstrates the multiple ways that scalar values can be introduced " 21 "into kernels, e.g. (controllable) constants, functions, and " 22 "postprocessors. Implements the weak form $(\\vec{\\psi_i}, -\\vec{f})$.");
23 params.
addParam<
Real>(
"value", 1.0,
"Coefficient to multiply by the body force term");
24 params.
addParam<FunctionName>(
"function",
25 "A function that defines a vectorValue method. This cannot be " 26 "supplied with the component parameters.");
28 "function_x",
"1",
"A function that describes the x-component of the body force");
30 "function_y",
"0",
"A function that describes the y-component of the body force");
32 "function_z",
"0",
"A function that describes the z-component of the body force");
34 "postprocessor", 1,
"A postprocessor whose value is multiplied by the body force");
41 _scale(getParam<
Real>(
"value")),
42 _function(isParamValid(
"function") ? &getFunction(
"function") : nullptr),
43 _function_x(getFunction(
"function_x")),
44 _function_y(getFunction(
"function_y")),
45 _function_z(getFunction(
"function_z")),
46 _postprocessor(getPostprocessorValue(
"postprocessor"))
50 paramError(
"function_x",
"The 'function' and 'function_x' parameters cannot both be set.");
52 paramError(
"function_y",
"The 'function' and 'function_y' parameters cannot both be set.");
54 paramError(
"function_z",
"The 'function' and 'function_z' parameters cannot both be set.");
const Function & _function_x
Optional component function value.
const VectorVariableTestValue & _test
the current test function
const Function *const _function
Optional vectorValue function.
virtual Real computeQpResidual() override
Compute this Kernel's contribution to the residual at the current quadrature point.
const Function & _function_y
unsigned int _i
current index for the test function
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
VectorBodyForce(const InputParameters ¶meters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
virtual RealVectorValue vectorValue(Real t, const Point &p) const
Override this to evaluate the vector function at a point (t,x,y,z), by default this returns a zero ve...
const InputParameters & parameters() const
Get the parameters of the object.
This kernel implements a generic functional body force term: $ - c {f} {} $.
registerMooseObject("MooseApp", VectorBodyForce)
virtual Real value(Real t, const Point &p) const
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
const PostprocessorValue & _postprocessor
Optional Postprocessor value.
const Function & _function_z
const Real & _scale
Scale factor.
const MooseArray< Point > & _q_point
The physical location of the element's quadrature Points, indexed by _qp.
static InputParameters validParams()
unsigned int _qp
The current quadrature point index.