20 "iteration to solve the equal chemical " 21 "potential and concentration conservation equations. This class is " 22 "intended to be used with KKSPhaseConcentrationDerivatives.");
24 params.
addRequiredParam<MaterialPropertyName>(
"h_name",
"Switching function h(eta).");
27 "Phase concentrations. The order must match Fa, Fb, and global_cs, for example, c1, c2, b1, " 30 "Initial values of ci in the same order as ci_names.");
33 params.
addParam<MaterialPropertyName>(
35 "The output number of nested Newton iterations at each quadrature point.");
36 params.
addCoupledVar(
"args",
"The coupled variables of Fa and Fb.");
38 "damped_Newton",
false,
"Whether or not to use the damped Newton's method.");
39 params.
addParam<MaterialName>(
"conditions",
41 "Material property that checks bounds and conditions on the " 42 "material properties being solved for.");
49 _prop_c(coupledValues(
"global_cs")),
50 _num_c(coupledComponents(
"global_cs")),
51 _prop_h(getMaterialProperty<
Real>(
"h_name")),
52 _ci_names(getParam<
std::vector<MaterialPropertyName>>(
"ci_names")),
55 _ci_IC(getParam<
std::vector<
Real>>(
"ci_IC")),
56 _Fa_name(getParam<MaterialName>(
"fa_name")),
57 _Fb_name(getParam<MaterialName>(
"fb_name")),
61 _dFidci_copy(_num_c * 2),
63 _d2Fadc1db1_copy(_num_c),
64 _args_names(coupledNames(
"args")),
65 _n_args(coupledComponents(
"args")),
67 _dFadarg_copy(_n_args),
69 _dFbdarg_copy(_n_args),
70 _d2Fadcadarg(_n_args),
71 _d2Fadcadarg_copy(_n_args),
72 _iter(declareProperty<
Real>(
"nested_iterations")),
73 _abs_tol(getParam<
Real>(
"absolute_tolerance")),
74 _rel_tol(getParam<
Real>(
"relative_tolerance")),
75 _damped_newton(getParam<bool>(
"damped_Newton")),
76 _condition_name(getParam<MaterialName>(
"conditions")),
123 _d2Fidcidbi[1][n][l] = &getMaterialPropertyDerivative<Real>(
190 for (
unsigned int m = 0; m <
_num_c * 2; ++m)
226 jacobian(m * 2 + 1, m * 2) = 1 -
_prop_h[
_qp];
227 jacobian(m * 2 + 1, m * 2 + 1) =
_prop_h[
_qp];
245 mooseException(
"Nested Newton iteration did not converge.");
const std::size_t & getIterations()
virtual void initQpStatefulProperties() override
const std::vector< Real > _ci_IC
static InputParameters validParams()
std::vector< std::vector< MaterialProperty< Real > * > > _d2Fadcadarg_copy
std::vector< MaterialProperty< Real > * > _dFidci_copy
KKSPhaseConcentrationMaterial(const InputParameters ¶meters)
const Real _abs_tol
Absolute and relative tolerance of nested Newton iteration.
virtual void initialSetup() override
std::vector< const MaterialProperty< Real > * > _prop_Fi
const MaterialName _Fb_name
const unsigned int _n_args
Number of coupled variables of free energies.
const MaterialName _Fa_name
Free energies.
const std::vector< const VariableValue * > _prop_c
Global concentrations.
MaterialBase * _Fa
Free energy instantiation of the MaterialBase class.
typename std::conditional< N==1, NSReal, typename std::conditional< N==0, NestedSolveTempl< false >::DynamicVector, Eigen::Matrix< NSReal, N, 1 > >::type >::type Value
std::vector< const MaterialProperty< Real > * > _ci_old
const unsigned int _num_c
Number of global concentrations.
std::vector< const MaterialProperty< Real > * > _dFadarg
Derivative of free energies wrt coupled variables .
void nonlinear(V &guess, T &&compute)
const bool _damped_newton
Add damping functionality to nested Newton solve.
InputParameters validParams()
MaterialBase & getMaterial(const std::string &name)
NestedSolve _nested_solve
Instantiation of the NestedSolve class.
std::vector< std::vector< const MaterialProperty< Real > * > > _d2Fadcadarg
registerMooseObject("PhaseFieldApp", KKSPhaseConcentrationMaterial)
std::vector< MaterialProperty< Real > * > _dFadarg_copy
typename std::conditional< N==1, NSReal, typename std::conditional< N==0, NestedSolveTempl< false >::DynamicMatrix, Eigen::Matrix< NSReal, N, N > >::type >::type Jacobian
std::vector< std::vector< MaterialProperty< Real > * > > _d2Fadc1db1_copy
void setRelativeTolerance(Real rel)
MaterialProperty< Real > & _iter
Number of nested Newton iteration.
std::vector< MaterialProperty< Real > * > _Fi_copy
const MaterialProperty< Real > & _prop_h
Switching functions.
MaterialBase & getMaterialByName(const std::string &name, bool no_warn=false, bool no_dep=false)
virtual void computeQpProperties() override
MaterialName _condition_name
Material property that defines the confidence bounds for the newton solve.
std::vector< MaterialProperty< Real > * > _prop_ci
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d2Fidcidbi
const std::vector< MaterialPropertyName > _ci_names
Phase concentrations.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void setAbsoluteTolerance(Real abs)
IntRange< T > make_range(T beg, T end)
static InputParameters validParams()
virtual void computePropertiesAtQp(unsigned int qp)
const std::vector< VariableName > _args_names
Coupled variables of free energies.
std::vector< const MaterialProperty< Real > * > _dFidci
Derivative of free energies wrt phase concentrations .
void nonlinearDamped(V &guess, T &&compute, C &&computeCondition)
MaterialBase * _condition
const MaterialProperty< Real > * _C
std::vector< MaterialProperty< Real > * > _dFbdarg_copy
std::vector< const MaterialProperty< Real > * > _dFbdarg
Derivative of free energies wrt coupled variables .
const State & getState() const