18 params.
addClassDescription(
"Lagrange multiplier kernel to constrain the sum of all switching "
19 "functions in a multiphase system. This kernel acts on the Lagrange "
20 "multiplier variable.");
21 params.
addParam<std::vector<MaterialPropertyName>>(
"h_names",
"Switching function materials");
23 params.
addParam<Real>(
"epsilon", 1e-9,
"Shift factor to avoid a zero pivot");
30 _h_names(getParam<
std::vector<MaterialPropertyName>>(
"h_names")),
31 _num_h(_h_names.size()),
34 _eta_map(getParameterJvarMap(
"etas")),
35 _epsilon(getParam<Real>(
"epsilon"))
38 if (
_num_h != coupledComponents(
"etas"))
39 paramError(
"etas",
"Need to pass in as many etas as h_names");
42 for (std::size_t i = 0; i <
_num_h; ++i)
44 _h[i] = &getMaterialPropertyByName<Real>(
_h_names[i]);
47 for (std::size_t j = 0; j <
_num_h; ++j)
48 _dh[i][j] = &getMaterialPropertyDerivative<Real>(
_h_names[i], coupledName(
"etas", j));
56 for (std::size_t i = 0; i <
_num_h; ++i)
59 return _test[_i][_qp] * g;
65 return _test[_i][_qp] * -
_epsilon * _phi[_j][_qp];
75 for (std::size_t i = 0; i <
_num_h; ++i)
76 g += (*
_dh[i][
eta])[_qp] * _phi[_j][_qp];
77 return g * _test[_i][_qp];
registerMooseObject("PhaseFieldApp", SwitchingFunctionConstraintLagrange)
static InputParameters validParams()
SwitchingFunctionConstraintLagrange is a constraint kernel that acts on the lambda lagrange multiplie...
static InputParameters validParams()
std::vector< std::vector< const MaterialProperty< Real > * > > _dh
Switching function derivatives.
std::vector< const MaterialProperty< Real > * > _h
Switching functions.
unsigned int _num_h
number of switching functions
Real _epsilon
shift factor
virtual Real computeQpJacobian()
virtual Real computeQpResidual()
virtual Real computeQpOffDiagJacobian(unsigned int)
std::vector< MaterialPropertyName > _h_names
Switching function names.
SwitchingFunctionConstraintLagrange(const InputParameters ¶meters)
const JvarMap & _eta_map
map for getting the "etas" index from jvar