18 InputParameters params = validParams<Kernel>();
19 params.addClassDescription(
"Kernel that implements the first derivative of a function material "
20 "property with respect to a coupled variable.");
21 params.addRequiredCoupledVar(
"v",
"Variable to take the derivative with respect to");
22 params.addParam<MaterialPropertyName>(
"f_name",
24 "Function material to take the derivative of (should "
25 "provide derivative properties - such as a "
26 "DerivativeParsedMaterial)");
29 "Vector of other nonlinear variables F depends on (used for computing Jacobian entries)");
34 : DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
35 _v_name(getVar(
"v", 0)->
name()),
37 _dFdv(getMaterialPropertyDerivative<Real>(
"f_name", _v_name)),
38 _d2Fdvdu(getMaterialPropertyDerivative<Real>(
"f_name", _v_name, _var.
name())),
39 _nvar(_coupled_moose_vars.size()),
43 for (
unsigned int i = 0; i <
_nvar; ++i)
45 MooseVariableFEBase * ivar = _coupled_moose_vars[i];
46 _d2Fdvdarg[i] = &getMaterialPropertyDerivative<Real>(
"f_name",
_v_name, ivar->name());
53 validateNonlinearCoupling<Real>(
"f_name");
59 return _dFdv[_qp] * _test[_i][_qp];
65 return _d2Fdvdu[_qp] * _test[_i][_qp] * _phi[_j][_qp];
71 const unsigned int cvar = mapJvarToCvar(jvar);
72 return (*
_d2Fdvdarg[cvar])[_qp] * _test[_i][_qp] * _phi[_j][_qp];