18 InputParameters params = validParams<Kernel>();
19 params.addCoupledVar(
"v",
20 "Set this to make v a coupled variable, otherwise it will use the "
21 "kernel's nonlinear variable for v");
22 params.addClassDescription(
"Kernel to add -L*v, where L=reaction rate, v=variable");
23 params.addParam<MaterialPropertyName>(
"mob_name",
"L",
"The reaction rate used with the kernel");
24 params.addCoupledVar(
"args",
"Vector of nonlinear variable arguments this object depends on");
29 : DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
30 _is_coupled(isCoupled(
"v")),
31 _v_name(_is_coupled ? getVar(
"v", 0)->
name() : _var.
name()),
32 _v(_is_coupled ? coupledValue(
"v") : _u),
33 _v_var(_is_coupled ? coupled(
"v") : _var.number()),
34 _L(getMaterialProperty<Real>(
"mob_name")),
35 _eta_name(_var.
name()),
36 _dLdop(getMaterialPropertyDerivative<Real>(
"mob_name", _eta_name)),
37 _dLdv(getMaterialPropertyDerivative<Real>(
"mob_name", _v_name)),
38 _nvar(_coupled_moose_vars.size()),
42 for (
unsigned int i = 0; i <
_nvar; ++i)
44 MooseVariableFEBase * ivar = _coupled_moose_vars[i];
45 _dLdarg[i] = &getMaterialPropertyDerivative<Real>(
"mob_name", ivar->name());
52 validateNonlinearCoupling<Real>(
"mob_name");
58 return -
_L[_qp] * _test[_i][_qp] *
_v[_qp];
65 return -
_dLdop[_qp] *
_v[_qp] * _phi[_j][_qp] * _test[_i][_qp];
67 return -(
_L[_qp] +
_dLdop[_qp] *
_v[_qp]) * _phi[_j][_qp] * _test[_i][_qp];
77 return -(
_L[_qp] +
_dLdv[_qp] *
_v[_qp]) * _test[_i][_qp] * _phi[_j][_qp];
80 const unsigned int cvar = mapJvarToCvar(jvar);
82 return -(*
_dLdarg[cvar])[_qp] *
_v[_qp] * _test[_i][_qp] * _phi[_j][_qp];