12 #include "libmesh/utility.h" 22 relativeToleranceDefault(),
23 "Relative convergence tolerance for Newton iteration");
25 absoluteToleranceDefault(),
26 "Absolute convergence tolerance for Newton iteration");
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");
37 acceptableMultiplierDefault(),
38 "Factor applied to relative and absolute " 39 "tolerance for acceptable nonlinear convergence if " 40 "iterations are no longer making progress");
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);
101 template <
bool is_ad>
108 template <
bool is_ad>
115 template <
bool is_ad>
123 template <
bool is_ad>
138 template <
bool is_ad>
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
Moose::GenericType< RankTwoTensor, is_ad > NSRankTwoTensor
State
possible solver states
static InputParameters validParams()
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
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...
Eigen::Matrix< NSReal, Eigen::Dynamic, Eigen::Dynamic > DynamicMatrix
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.
void linear(const J &A, V &x, const V &b) const
Solve A*x=b for x.
Eigen::Matrix< NSReal, Eigen::Dynamic, 1 > DynamicVector
Eigen type shortcuts.
static Real normSquare(const V &v)
Compute squared norm of v (dropping derivatives as this is only for convergence checking) ...
NestedSolveTempl<is_ad> and its instantiations NestedSolve and ADNestedSolve are utility classes that...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Moose::GenericType< Real, is_ad > NSReal
AD/non-AD switched type shortcuts.
IntRange< T > make_range(T beg, T end)
Moose::GenericType< RealVectorValue, is_ad > NSRealVectorValue
void ErrorVector unsigned int
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template pow< 2 >(tan(_arg))+1.0) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(sqrt