22 "Implements a forcing term RHS of the form PDE = RHS, where RHS = Sum_j c_j * m_j * v_j. " 23 "c_j, m_j, and v_j are provided as real coefficients, material properties, and coupled " 24 "variables, respectively.");
27 "coef",
"Coefficents ($\\sigma$) multiplier for the coupled force term.");
28 params.
addParam<std::vector<MaterialPropertyName>>(
"material_properties",
29 "The coupled material properties.");
35 _n_coupled(coupledComponents(
"v")),
36 _coupled_props(isParamValid(
"material_properties")),
37 _v_var(coupledIndices(
"v")),
38 _v(coupledValues(
"v")),
39 _coef(isParamValid(
"coef") ? getParam<
std::vector<
Real>>(
"coef")
40 :
std::vector<
Real>(_n_coupled, 1))
48 "Coupled variable 'v' needs to be different from 'variable' with MatCoupledForce, " 49 "consider using Reaction or somethig similar");
53 paramError(
"coef",
"Size of coef must be equal to size of v");
58 std::vector<MaterialPropertyName> names =
59 getParam<std::vector<MaterialPropertyName>>(
"material_properties");
61 paramError(
"material_properties",
"Size must be equal to number of coupled variables");
63 _mat_props[j] = &getMaterialPropertyByName<Real>(names[j]);
static InputParameters validParams()
const unsigned int _n_coupled
MooseVariable & _var
This is a regular kernel so we cast to a regular MooseVariable.
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 ...
unsigned int number() const
Get variable number coming from libMesh.
const std::vector< Real > _coef
const std::vector< unsigned int > _v_var
virtual Real computeQpJacobian() override
Compute this Kernel's contribution to the Jacobian at the current quadrature point.
const VariableTestValue & _test
the current test function
Represents a right hand side force term of the form Sum_j c_j * m_j * v_j, where c is a vector of rea...
unsigned int _i
current index for the test function
registerMooseObject("MooseApp", MatCoupledForce)
MatCoupledForce(const InputParameters ¶meters)
unsigned int _j
current index for the shape function
static InputParameters validParams()
const std::vector< const VariableValue * > _v
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
For coupling standard variables.
std::vector< const MaterialProperty< Real > * > _mat_props
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
const VariablePhiValue & _phi
the current shape functions
const bool _coupled_props
virtual Real computeQpResidual() override
Compute this Kernel's contribution to the residual at the current quadrature point.
unsigned int _qp
The current quadrature point index.
std::map< unsigned int, unsigned int > _v_var_to_index