20 params.
addClassDescription(
"Gradient energy term for when kappa as a function of the variable");
21 params.
addParam<MaterialPropertyName>(
"mob_name",
"L",
"The mobility used with the kernel");
22 params.
addParam<MaterialPropertyName>(
"kappa_name",
"kappa_op",
"The kappa function name");
29 _L(this->template getGenericMaterialProperty<
Real, is_ad>(
"mob_name")),
30 _kappa_name(this->template getParam<MaterialPropertyName>(
"kappa_name")),
31 _dkappadvar(this->template getGenericMaterialProperty<
Real, is_ad>(
32 this->derivativePropertyNameFirst(_kappa_name, _var.
name()))),
33 _v_num(this->coupledComponents(
"v")),
36 for (
unsigned int i = 0; i <
_v_num; ++i)
37 _grad_v[i] = &this->
template coupledGenericGradient<is_ad>(
"v", i);
42 _dLdvar(getMaterialPropertyDerivative<
Real>(
"mob_name", _var.
name())),
43 _d2kappadvar2(getMaterialPropertyDerivative<
Real>(_kappa_name, _var.
name(), _var.
name())),
44 _v_map(getParameterJvarMap(
"v")),
46 _d2kappadvardv(_v_num)
48 for (
unsigned int i = 0; i <
_v_num; ++i)
50 auto v_name = coupledName(
"v", i);
51 _dLdv[i] = &getMaterialPropertyDerivative<Real>(
"mob_name", v_name);
60 return 0.5 * _test[_i][_qp] * _L[_qp] * _dkappadvar[_qp] * computeFg();
66 Real pre_jac = 0.5 * _test[_i][_qp] * _phi[_j][_qp] *
computeFg();
67 Real term1 = _test[_i][_qp] *
_L[_qp] *
_dkappadvar[_qp] * _grad_u[_qp] * _grad_phi[_j][_qp];
75 auto i = mapJvarToCvar(jvar,
_v_map);
78 const Real pre_jac = 0.5 * _test[_i][_qp] * _phi[_j][_qp] *
computeFg();
93 for (
unsigned int i = 0; i < _v_num; ++i)
94 sum_grad_etai2 += (*_grad_v[i])[_qp] * (*_grad_v[i])[_qp];
96 return sum_grad_etai2 + _grad_u[_qp] * _grad_u[_qp];
virtual Real computeQpJacobian() override
static InputParameters validParams()
ACKappaFunction(const InputParameters ¶meters)
std::vector< const GenericVariableGradient< is_ad > * > _grad_v
virtual GenericReal< is_ad > computeQpResidual() override
const MaterialProperty< Real > & _dLdvar
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
registerMooseObject("PhaseFieldApp", ACKappaFunction)
std::vector< const MaterialProperty< Real > * > _dLdv
When kappa is a function of phase field variables, this kernel should be used to calculate the term w...
GenericReal< is_ad > computeFg()
ACKappaFunctionTempl(const InputParameters ¶meters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const GenericMaterialProperty< Real, is_ad > & _L
std::vector< const MaterialProperty< Real > * > _d2kappadvardv
const MaterialProperty< Real > & _d2kappadvar2
typename Moose::GenericType< Real, is_ad > GenericReal
const MaterialPropertyName _kappa_name
const unsigned int _v_num
const GenericMaterialProperty< Real, is_ad > & _dkappadvar
static InputParameters validParams()