18 InputParameters params = validParams<Kernel>();
19 params.addClassDescription(
"Lagrange multiplier kernel to constrain the sum of all switching "
20 "functions in a multiphase system. This kernel acts on the Lagrange "
21 "multiplier variable.");
22 params.addParam<std::vector<MaterialPropertyName>>(
"h_names",
"Switching function materials");
23 params.addRequiredCoupledVar(
"etas",
"eta order parameters");
24 params.addParam<Real>(
"epsilon", 1e-9,
"Shift factor to avoid a zero pivot");
29 const InputParameters & parameters)
30 : DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
31 _h_names(getParam<std::vector<MaterialPropertyName>>(
"h_names")),
32 _num_h(_h_names.size()),
35 _eta_map(getParameterJvarMap(
"etas")),
36 _epsilon(getParam<Real>(
"epsilon"))
39 if (
_num_h != coupledComponents(
"etas"))
40 paramError(
"etas",
"Need to pass in as many etas as h_names");
43 for (std::size_t i = 0; i <
_num_h; ++i)
45 _h[i] = &getMaterialPropertyByName<Real>(
_h_names[i]);
48 for (std::size_t j = 0; j <
_num_h; ++j)
49 _dh[i][j] = &getMaterialPropertyDerivative<Real>(
_h_names[i], getVar(
"etas", j)->
name());
57 for (std::size_t i = 0; i <
_num_h; ++i)
60 return _test[_i][_qp] * g;
66 return _test[_i][_qp] * -
_epsilon * _phi[_j][_qp];
72 auto eta = mapJvarToCvar(jvar,
_eta_map);
76 for (std::size_t i = 0; i <
_num_h; ++i)
77 g += (*
_dh[i][eta])[_qp] * _phi[_j][_qp];
78 return g * _test[_i][_qp];