22 "h_name",
"Name of the switching function material property for the given phase");
26 "multi-phase, multi-order parameter model");
34 _h_name(this->getParam<MaterialPropertyName>(
"h_name")),
35 _num_eta_p(coupledComponents(
"phase_etas")),
36 _eta_p(coupledGenericValues<is_ad>(
"phase_etas")),
37 _eta_p_names(coupledNames(
"phase_etas")),
38 _num_eta(coupledComponents(
"all_etas")),
39 _eta(coupledGenericValues<is_ad>(
"all_etas")),
40 _eta_names(coupledNames(
"all_etas")),
42 _prop_h(declareGenericProperty<
Real, is_ad>(_h_name)),
47 for (
unsigned int i = 0; i <
_num_eta; ++i)
50 for (
unsigned int i = 0; i <
_num_eta; ++i)
61 for (
unsigned int i = 0; i <
_num_eta; ++i)
79 for (
unsigned int i = 0; i < _num_eta_p; ++i)
80 sum_p += (*_eta_p[i])[_qp] * (*_eta_p[i])[_qp];
82 for (
unsigned int i = 0; i < _num_eta; ++i)
83 sum_all += (*_eta[i])[_qp] * (*_eta[i])[_qp];
87 _prop_h[_qp] = sum_p / sum_all;
89 for (
unsigned int i = 0; i < _num_eta; ++i)
93 (*_prop_dh[i])[_qp] = 2.0 * (*_eta[i])[_qp] * sum_notp / (sum_all * sum_all);
95 (*_prop_dh[i])[_qp] = -2.0 * (*_eta[i])[_qp] * sum_p / (sum_all * sum_all);
98 for (
unsigned int j = 0;
j < _num_eta; ++
j)
103 (*_prop_d2h[i][
j])[_qp] =
104 (2.0 * sum_all * sum_notp - 8.0 * (*_eta[i])[_qp] * (*_eta[i])[_qp] * sum_notp) /
105 (sum_all * sum_all * sum_all);
107 (*_prop_d2h[i][
j])[_qp] =
108 (-2.0 * sum_p * sum_all + 8.0 * (*_eta[i])[_qp] * (*_eta[i])[_qp] * sum_p) /
109 (sum_all * sum_all * sum_all);
111 else if (_is_p[i] && _is_p[
j])
112 (*_prop_d2h[i][
j])[_qp] =
113 -8.0 * (*_eta[i])[_qp] * (*_eta[
j])[_qp] * sum_notp / (sum_all * sum_all * sum_all);
114 else if (!_is_p[i] && !_is_p[
j])
115 (*_prop_d2h[i][
j])[_qp] =
116 8.0 * (*_eta[i])[_qp] * (*_eta[
j])[_qp] * sum_p / (sum_all * sum_all * sum_all);
118 (*_prop_d2h[i][
j])[_qp] = (4.0 * sum_all - 8.0 * sum_notp) * (*_eta[i])[_qp] *
119 (*_eta[
j])[_qp] / (sum_all * sum_all * sum_all);
std::vector< bool > _is_p
List of which order parameters in the full list of all etas belong to phase p.
std::vector< std::vector< GenericMaterialProperty< Real, is_ad > * > > _prop_d2h
const unsigned int _num_eta
Order parameters for all phases (including alpha)
const std::vector< VariableName > _eta_p_names
MaterialPropertyName _h_name
Name of the function.
registerMooseObject("PhaseFieldApp", SwitchingFunctionMultiPhaseMaterial)
SwitchingFunctionMultiPhaseMaterial is a switching function for a multi-phase, multi-order parameter ...
SwitchingFunctionMultiPhaseMaterialTempl(const InputParameters ¶meters)
static InputParameters validParams()
const unsigned int _num_eta_p
Order parameters for phase alpha.
const std::vector< VariableName > _eta_names
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< GenericMaterialProperty< Real, is_ad > * > _prop_dh
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
typename Moose::GenericType< Real, is_ad > GenericReal
virtual void computeQpProperties()