20 "Computes the KKS phase concentrations by using a nested Newton iteration " 21 "to solve the equal chemical potential and concentration conservation equations for " 22 "multiphase systems. This class is intented to be used with " 23 "KKSPhaseConcentrationMultiPhaseDerivatives.");
27 "hj_names",
"Switching functions in the same order as all_etas.");
29 "Fj_names",
"Free energy material objects in the same order as all_etas.");
32 "Phase concentrations. They must have the same order as Fj_names and global_cs, for " 33 "example, c1, c2, b1, b2.");
35 "Initial values of ci in the same order of ci_names");
36 params.
addParam<MaterialPropertyName>(
38 "The output number of nested Newton iterations at each quadrature point.");
39 params.
addCoupledVar(
"args",
"The coupled variables of free energies.");
41 "damped_Newton",
false,
"Whether or not to use the damped Newton's method.");
42 params.
addParam<MaterialName>(
"conditions",
44 "Material property that checks bounds and conditions on the " 45 "material properties being solved for.");
53 _prop_c(coupledValues(
"global_cs")),
54 _num_c(coupledComponents(
"global_cs")),
55 _num_j(coupledComponents(
"all_etas")),
56 _hj_names(getParam<
std::vector<MaterialPropertyName>>(
"hj_names")),
58 _Fj_names(getParam<
std::vector<MaterialName>>(
"Fj_names")),
60 _ci_names(getParam<
std::vector<MaterialPropertyName>>(
"ci_names")),
61 _prop_ci(_num_c * _num_j),
62 _ci_old(_num_c * _num_j),
63 _ci_IC(getParam<
std::vector<
Real>>(
"ci_IC")),
66 _args_names(coupledNames(
"args")),
67 _n_args(coupledComponents(
"args")),
70 _iter(declareProperty<
Real>(
"nested_iterations")),
71 _abs_tol(getParam<
Real>(
"absolute_tolerance")),
72 _rel_tol(getParam<
Real>(
"relative_tolerance")),
73 _damped_newton(getParam<bool>(
"damped_Newton")),
74 _condition_name(getParam<MaterialName>(
"conditions")),
103 for (
unsigned int l = 0; l <
_num_c; ++l)
105 _d2Fidcidbi[m][n][l] = &getMaterialPropertyDerivative<Real>(
150 for (
unsigned int m = 0; m <
_num_j; ++m)
229 mooseException(
"Nested Newton iteration did not converge.");
const std::size_t & getIterations()
NestedSolve _nested_solve
Instantiation of the NestedSolve class.
static InputParameters validParams()
virtual void computeQpProperties() override
const Real _abs_tol
Absolute and relative tolerance of nested Newton iteration.
std::vector< MaterialBase * > _Fj_mat
Free energy instantiation of the MaterialBase class.
const std::vector< MaterialName > _Fj_names
Free energies.
std::vector< MaterialPropertyName > _hj_names
Switching functions.
std::vector< std::vector< const MaterialProperty< Real > * > > _dFidci
Derivative of free energies wrt phase concentrations .
static InputParameters validParams()
virtual void initQpStatefulProperties() override
std::vector< MaterialPropertyName > _ci_names
Phase concentrations.
MaterialName _condition_name
Condition that must be violated for damping to occur.
const bool _damped_newton
Check whether to use damping.
typename std::conditional< N==1, NSReal, typename std::conditional< N==0, NestedSolveTempl< false >::DynamicVector, Eigen::Matrix< NSReal, N, 1 > >::type >::type Value
std::vector< std::vector< const MaterialProperty< Real > * > > _d2F1dc1darg
std::vector< Real > _ci_IC
std::vector< MaterialProperty< Real > * > _prop_ci
void nonlinear(V &guess, T &&compute)
std::vector< const MaterialProperty< Real > * > _ci_old
InputParameters validParams()
std::vector< const MaterialProperty< Real > * > _prop_hj
typename std::conditional< N==1, NSReal, typename std::conditional< N==0, NestedSolveTempl< false >::DynamicMatrix, Eigen::Matrix< NSReal, N, N > >::type >::type Jacobian
void setRelativeTolerance(Real rel)
std::vector< const MaterialProperty< Real > * > _prop_Fi
const std::vector< VariableName > _args_names
Coupled variables of free energies.
const unsigned int _num_c
Number of global concentrations.
MaterialBase & getMaterialByName(const std::string &name, bool no_warn=false, bool no_dep=false)
const MaterialProperty< Real > * _C
KKSPhaseConcentrationMultiPhaseMaterial(const InputParameters ¶meters)
virtual void initialSetup() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void setAbsoluteTolerance(Real abs)
const unsigned int _n_args
Number of coupled variables of free energies.
IntRange< T > make_range(T beg, T end)
MaterialBase * _condition
MaterialProperty< Real > & _iter
Number of nested Newton iteration.
virtual void computePropertiesAtQp(unsigned int qp)
void nonlinearDamped(V &guess, T &&compute, C &&computeCondition)
std::vector< std::vector< const MaterialProperty< Real > * > > _dFidarg
Derivative of free energies wrt coupled variables .
const unsigned int _num_j
Number of phase parameters.
const std::vector< const VariableValue * > _prop_c
Global concentrations.
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d2Fidcidbi
const State & getState() const
registerMooseObject("PhaseFieldApp", KKSPhaseConcentrationMultiPhaseMaterial)