13 #include "libmesh/utility.h" 21 params.
addClassDescription(
"Calculate Grand Potential interface parameters for a specified " 22 "interfacial free energy and width");
23 params.
addRequiredParam<std::vector<Real>>(
"sigma",
"Interfacial free energies");
25 "width",
"width > 0",
"Interfacial width (for the interface with gamma = 1.5)");
26 params.
addParam<std::vector<MaterialPropertyName>>(
28 "Interfacial / grain boundary gamma parameter names (leave empty for gamma0... gammaN)");
29 params.
addParam<MaterialPropertyName>(
"kappa_name",
"kappa",
"Gradient interface parameter name");
30 params.
addParam<MaterialPropertyName>(
"mu_name",
"mu",
"Grain growth bulk energy parameter name");
33 "Sigma index to choose gamma = 1.5 for. Omit this to automatically chose the median sigma.");
40 _sigma(getParam<
std::vector<
Real>>(
"sigma")),
41 _width(getParam<
Real>(
"width")),
42 _n_pair(_sigma.size()),
44 _gamma_name(getParam<
std::vector<MaterialPropertyName>>(
"gamma_names")),
46 _kappa_prop(declareProperty<
Real>(getParam<MaterialPropertyName>(
"kappa_name"))),
47 _mu_prop(declareProperty<
Real>(getParam<MaterialPropertyName>(
"mu_name")))
51 paramError(
"sigma",
"Specify at least one interfacial energy");
55 "Specify either as many entries are sigma values or none at all for auto-naming the " 56 "gamma material properties.");
60 for (
unsigned int i = 0; i <
_n_pair; i++)
64 for (
unsigned int i = 0; i <
_n_pair; i++)
70 median = getParam<unsigned int>(
"sigma_index");
73 std::vector<size_t> indices;
75 median = indices[(indices.size() - 1) / 2];
84 for (
unsigned int i = 0; i <
_n_pair; ++i)
93 Real gamma = 1.0 / (-5.288 * Utility::pow<8>(g) - 0.09364 * Utility::pow<6>(g) +
94 9.965 * Utility::pow<4>(g) - 8.183 * Utility::pow<2>(g) + 2.007);
105 for (
unsigned int i = 0; i <
_n_pair; ++i)
static InputParameters validParams()
std::vector< MaterialPropertyName > _gamma_name
gamma material property names
MaterialProperty< Real > & _kappa_prop
void indirectSort(RandomAccessIterator beg, RandomAccessIterator end, std::vector< size_t > &b)
const unsigned int _n_pair
number of interface pairs
std::vector< Real > _gamma
Calculated gamma parameter values.
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
registerMooseObject("PhaseFieldApp", GrandPotentialInterface)
bool isParamValid(const std::string &name) const
std::vector< MaterialProperty< Real > * > _gamma_prop
Material properties for all interface pairs.
static InputParameters validParams()
const Real _width
Interface width for the interface with the median interfacial free energy.
Calculate Grand Potential interface parameters for a specified interfacial free energy and width...
void paramError(const std::string ¶m, Args... args) const
std::string stringify(const T &t)
MaterialProperty< Real > & _mu_prop
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::vector< Real > _sigma
list of interfacial free energies
GrandPotentialInterface(const InputParameters ¶meters)
virtual void computeQpProperties() override