12#include "libmesh/utility.h"
21 params.
addParam<Real>(
"relative_tolerance",
22 relativeToleranceDefault(),
23 "Relative convergence tolerance for Newton iteration");
24 params.
addParam<Real>(
"absolute_tolerance",
25 absoluteToleranceDefault(),
26 "Absolute convergence tolerance for Newton iteration");
27 params.
addParam<Real>(
"step_size_tolerance",
29 "Minimum step size of linear iterations relative to value of the solution");
32 minIterationsDefault(),
33 "Minimum number of nonlinear iterations to execute before accepting convergence");
35 "max_iterations", maxIterationsDefault(),
"Maximum number of nonlinear iterations");
36 params.
addParam<Real>(
"acceptable_multiplier",
37 acceptableMultiplierDefault(),
38 "Factor applied to relative and absolute "
39 "tolerance for acceptable nonlinear convergence if "
40 "iterations are no longer making progress");
41 params.
addParam<Real>(
"damping_factor",
42 dampingFactorDefault(),
43 "Factor applied to step size if guess does not satisfy damping criteria");
45 "max_damping_iterations",
46 maxDampingIterationsDefault(),
47 "Maximum number of damping steps per linear iteration of nested solve");
53 : _relative_tolerance_square(
Utility::pow<2>(relativeToleranceDefault())),
54 _absolute_tolerance_square(
Utility::pow<2>(absoluteToleranceDefault())),
55 _delta_thresh(xToleranceDefault()),
56 _damping_factor(dampingFactorDefault()),
57 _max_damping_iterations(maxDampingIterationsDefault()),
58 _min_iterations(minIterationsDefault()),
59 _max_iterations(maxIterationsDefault()),
60 _acceptable_multiplier(acceptableMultiplierDefault()),
68 : _relative_tolerance_square(
Utility::pow<2>(params.get<Real>(
"relative_tolerance"))),
69 _absolute_tolerance_square(
Utility::pow<2>(params.get<Real>(
"absolute_tolerance"))),
70 _delta_thresh(params.get<Real>(
"step_size_tolerance")),
71 _damping_factor(params.get<Real>(
"damping_factor")),
72 _max_damping_iterations(params.get<unsigned
int>(
"max_damping_iterations")),
73 _min_iterations(params.get<unsigned
int>(
"min_iterations")),
74 _max_iterations(params.get<unsigned
int>(
"max_iterations")),
75 _acceptable_multiplier(params.get<Real>(
"acceptable_multiplier")),
87 const auto N = guess.size();
88 residual.resize(N, 1);
89 jacobian.resize(N, N);
void ErrorVector unsigned int
NestedSolveTempl<is_ad> and its instantiations NestedSolve and ADNestedSolve are utility classes that...
Moose::GenericType< RankTwoTensor, is_ad > NSRankTwoTensor
static bool isRelSmall(const V &a, const V &b, const V &c)
Check if |a| < |b * c| for all elements in a and b. This checks if 'a' is small relative to.
void sizeItems(const NestedSolveTempl< is_ad >::DynamicVector &guess, NestedSolveTempl< is_ad >::DynamicVector &residual, NestedSolveTempl< is_ad >::DynamicMatrix &jacobian) const
Size a dynamic Jacobian matrix correctly.
State
possible solver states
Moose::GenericType< Real, is_ad > NSReal
AD/non-AD switched type shortcuts.
Eigen::Matrix< NSReal, Eigen::Dynamic, 1 > DynamicVector
Eigen type shortcuts.
Moose::GenericType< RealVectorValue, is_ad > NSRealVectorValue
static InputParameters validParams()
void linear(const J &A, V &x, const V &b) const
Solve A*x=b for x.
static Real normSquare(const V &v)
Compute squared norm of v (dropping derivatives as this is only for convergence checking)
Eigen::Matrix< NSReal, Eigen::Dynamic, Eigen::Dynamic > DynamicMatrix
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.