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.
bool gradientDescentFallback = false
 Fall back to gradient descent direction if the solver search direction fails.
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 = 4
 Maximum number of line search iterations.
real lineSearchMaxRelIncrease = 0.0_r
 Maximum relative increase in the objective 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 = 1e-6_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 327 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 400 of file nonlinear_solver_params.h.

◆ absTol

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

Absolute residual norm tolerance for convergence.

Definition at line 361 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 358 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 338 of file nonlinear_solver_params.h.

◆ explosionControl

bool superdex::NonLinearSolverParams::explosionControl = true

Enable heuristic explosion prevention.

Definition at line 392 of file nonlinear_solver_params.h.

◆ gradientDescentFallback

bool superdex::NonLinearSolverParams::gradientDescentFallback = false

Fall back to gradient descent direction if the solver search direction fails.

Definition at line 387 of file nonlinear_solver_params.h.

◆ linearToleranceStrategy

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

Strategy for adaptive linear solver tolerance (forcing term).

Definition at line 457 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 424 of file nonlinear_solver_params.h.

◆ lineSearchMaxIter

int superdex::NonLinearSolverParams::lineSearchMaxIter = 4

Maximum number of line search iterations.

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

Definition at line 417 of file nonlinear_solver_params.h.

◆ lineSearchMaxRelIncrease

real superdex::NonLinearSolverParams::lineSearchMaxRelIncrease = 0.0_r

Maximum relative increase in the objective to accept the step.

Note
Only applies to LineSearchType::Simple.

Definition at line 449 of file nonlinear_solver_params.h.

◆ lineSearchType

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

Line search type.

Definition at line 452 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, LineSearchType::WolfeStrong, and LineSearchType::ArmijoOrResidualNorm line search types.

Definition at line 433 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 442 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 351 of file nonlinear_solver_params.h.

◆ maxIter

int superdex::NonLinearSolverParams::maxIter = 4

Maximum number of non-linear iterations.

Definition at line 343 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 384 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 408 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 375 of file nonlinear_solver_params.h.

◆ relTol

real superdex::NonLinearSolverParams::relTol = 1e-6_r

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

Definition at line 364 of file nonlinear_solver_params.h.

◆ solverType

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

Non-linear solver type.

Definition at line 329 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 379 of file nonlinear_solver_params.h.

◆ verbosity

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

Verbosity level for logging output.

Definition at line 462 of file nonlinear_solver_params.h.


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