SuperDex Physics C++ API
Loading...
Searching...
No Matches
superdex::NonLinearSolverParams Struct Reference

Parameters for the non-linear solver. More...

#include <nonlinear_solver_params.h>

Public Member Functions

bool operator== (NonLinearSolverParams const &) const =default

Public Attributes

real absDivTol = 1e9_r
 Absolute divergence tolerance.
real absTol = 1e-3_r
 Absolute residual norm tolerance for convergence.
NonLinearSolverConvergenceMode convergenceMode = NonLinearSolverConvergenceMode::Default
 Convergence monitoring mode.
int dResidualAssemblyPeriod = 1
 Every how many non-linear iterations to assemble the dresidual matrix.
bool explosionControl = true
 Enable heuristic explosion prevention.
LinearToleranceStrategy linearToleranceStrategy = LinearToleranceStrategy::Default
 Strategy for adaptive linear solver tolerance (forcing term).
real lineSearchAlpha = 0.5_r
 Step length reduction factor for line search.
int lineSearchMaxIter = 8
 Maximum number of line search iterations.
real lineSearchMaxRelIncrease = 0.0_r
 Maximum relative increase in the merit to accept the step.
LineSearchType lineSearchType = LineSearchType::Default
 Line search type.
real lineSearchWolfe1 = 1e-4_r
 Wolfe condition parameter c1 (sufficient decrease).
real lineSearchWolfe2 = 0.9_r
 Wolfe condition parameter c2 (curvature).
double maxElapsedTimeSeconds = 0
 Maximum elapsed time [s].
int maxIter = 4
 Maximum number of non-linear iterations.
PsdProjectionMode psdProjMode = PsdProjectionMode::Default
 Positive Semi-Definite (PSD) projection mode for the dresidual matrix.
real relDivTol = 1e4_r
 Relative divergence tolerance, relative to the initial residual.
real relStepTol = kDefaultRelStepTol
 Relative tolerance on the L2 norm of the raw linear-solve increment before line search scaling.
real relTol = 0_r
 Relative residual norm tolerance for convergence, relative to the initial residual.
NonLinearSolverType solverType = NonLinearSolverType::Default
 Non-linear solver type.
bool stopIfNoImprovement = false
 Stop the solve if the line search figure of merit does not improve from the previous iteration.
VerbosityLevel verbosity = VerbosityLevel::Warning
 Verbosity level for logging output.

Detailed Description

Parameters for the non-linear solver.

Definition at line 328 of file nonlinear_solver_params.h.

Member Function Documentation

◆ operator==()

bool superdex::NonLinearSolverParams::operator== ( NonLinearSolverParams const & ) const
default

Member Data Documentation

◆ absDivTol

real superdex::NonLinearSolverParams::absDivTol = 1e9_r

Absolute divergence tolerance.

Note
Triggers explosion control if residual norm exceeds this value.
Used only if explosionControl is true.

Definition at line 411 of file nonlinear_solver_params.h.

◆ absTol

real superdex::NonLinearSolverParams::absTol = 1e-3_r

Absolute residual norm tolerance for convergence.

Note
Also the residual below which LinearSolverConvergenceNorm::ResidualPerActorWeighted stops normalizing an actor by its own residual.
With a negative LinearSolverParams::absTol, it also determines the linear solver's absolute tolerance where supported (see LinearSolverParams::absTol).

Definition at line 369 of file nonlinear_solver_params.h.

◆ convergenceMode

NonLinearSolverConvergenceMode superdex::NonLinearSolverParams::convergenceMode = NonLinearSolverConvergenceMode::Default

Convergence monitoring mode.

Note
Applies to absTol and relTol.

Definition at line 359 of file nonlinear_solver_params.h.

◆ dResidualAssemblyPeriod

int superdex::NonLinearSolverParams::dResidualAssemblyPeriod = 1

Every how many non-linear iterations to assemble the dresidual matrix.

Note
For Newton's method, set to >1 to reuse the dresidual across iterations.
For quasi-Newton methods (e.g., BFGS, SR1), it must be >1 and indicates every how many iterations to restart the algorithm with the actual dresidual.

Definition at line 339 of file nonlinear_solver_params.h.

◆ explosionControl

bool superdex::NonLinearSolverParams::explosionControl = true

Enable heuristic explosion prevention.

Definition at line 403 of file nonlinear_solver_params.h.

◆ linearToleranceStrategy

LinearToleranceStrategy superdex::NonLinearSolverParams::linearToleranceStrategy = LinearToleranceStrategy::Default

Strategy for adaptive linear solver tolerance (forcing term).

Definition at line 471 of file nonlinear_solver_params.h.

◆ lineSearchAlpha

real superdex::NonLinearSolverParams::lineSearchAlpha = 0.5_r

Step length reduction factor for line search.

Note
Must be in (0, 1).

Definition at line 435 of file nonlinear_solver_params.h.

◆ lineSearchMaxIter

int superdex::NonLinearSolverParams::lineSearchMaxIter = 8

Maximum number of line search iterations.

Note
Must be >= 1 unless lineSearchType is LineSearchType::None.

Definition at line 428 of file nonlinear_solver_params.h.

◆ lineSearchMaxRelIncrease

real superdex::NonLinearSolverParams::lineSearchMaxRelIncrease = 0.0_r

Maximum relative increase in the merit to accept the step.

Note
Only applies to LineSearchType::Simple.
An increase beyond this maximum is tested on the slope of the merit along the step instead if it is within an estimate of the merit's rounding error or the step is so short that rounding error can dominate the increase (see LineSearchType).

Definition at line 463 of file nonlinear_solver_params.h.

◆ lineSearchType

LineSearchType superdex::NonLinearSolverParams::lineSearchType = LineSearchType::Default

Line search type.

Definition at line 466 of file nonlinear_solver_params.h.

◆ lineSearchWolfe1

real superdex::NonLinearSolverParams::lineSearchWolfe1 = 1e-4_r

Wolfe condition parameter c1 (sufficient decrease).

Note
Must be in (0, 1).
Used only by LineSearchType::Armijo, LineSearchType::WolfeWeak, and LineSearchType::WolfeStrong line search types.

Definition at line 444 of file nonlinear_solver_params.h.

◆ lineSearchWolfe2

real superdex::NonLinearSolverParams::lineSearchWolfe2 = 0.9_r

Wolfe condition parameter c2 (curvature).

Note
Must be in (lineSearchWolfe1, 1).
Used only by LineSearchType::WolfeWeak and LineSearchType::WolfeStrong line search types.

Definition at line 453 of file nonlinear_solver_params.h.

◆ maxElapsedTimeSeconds

double superdex::NonLinearSolverParams::maxElapsedTimeSeconds = 0

Maximum elapsed time [s].

Note
The solve terminates if the elapsed time exceeds this threshold.
0 means no time limit.

Definition at line 352 of file nonlinear_solver_params.h.

◆ maxIter

int superdex::NonLinearSolverParams::maxIter = 4

Maximum number of non-linear iterations.

Definition at line 344 of file nonlinear_solver_params.h.

◆ psdProjMode

PsdProjectionMode superdex::NonLinearSolverParams::psdProjMode = PsdProjectionMode::Default

Positive Semi-Definite (PSD) projection mode for the dresidual matrix.

Definition at line 398 of file nonlinear_solver_params.h.

◆ relDivTol

real superdex::NonLinearSolverParams::relDivTol = 1e4_r

Relative divergence tolerance, relative to the initial residual.

Note
Triggers explosion control if relative residual norm exceeds this value.
Used only if explosionControl is true.

Definition at line 419 of file nonlinear_solver_params.h.

◆ relStepTol

real superdex::NonLinearSolverParams::relStepTol = kDefaultRelStepTol

Relative tolerance on the L2 norm of the raw linear-solve increment before line search scaling.

Note
The solve terminates with ConvergenceStatus::Stopped status if |dx|/|x| is below this threshold (i.e., the step norm is below this fraction of the current solution norm).
0 disables this criterion.
Default is kDefaultRelStepTol.

Definition at line 389 of file nonlinear_solver_params.h.

◆ relTol

real superdex::NonLinearSolverParams::relTol = 0_r

Relative residual norm tolerance for convergence, relative to the initial residual.

Note
With a negative LinearSolverParams::absTol, it also determines the linear solver's absolute tolerance where supported (see LinearSolverParams::absTol).
0 disables this criterion.

Definition at line 378 of file nonlinear_solver_params.h.

◆ solverType

NonLinearSolverType superdex::NonLinearSolverParams::solverType = NonLinearSolverType::Default

Non-linear solver type.

Definition at line 330 of file nonlinear_solver_params.h.

◆ stopIfNoImprovement

bool superdex::NonLinearSolverParams::stopIfNoImprovement = false

Stop the solve if the line search figure of merit does not improve from the previous iteration.

Definition at line 393 of file nonlinear_solver_params.h.

◆ verbosity

VerbosityLevel superdex::NonLinearSolverParams::verbosity = VerbosityLevel::Warning

Verbosity level for logging output.

Definition at line 476 of file nonlinear_solver_params.h.


The documentation for this struct was generated from the following file: