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

Parameters for the linear solve performed in each iteration of the non-linear solver. More...

#include <linear_solver_params.h>

Public Member Functions

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

Public Attributes

bool abortIfNotSpd = false
 Abort solve if matrix is not SPD.
real absTol = 1e-9_r
 Absolute residual norm tolerance for convergence.
int maxIter = kAutoLinearSolverMaxIter
 Maximum number of iterations for iterative solvers.
LinearSolverConvergenceNorm normType = LinearSolverConvergenceNorm::Default
 Norm used for the stopping criteria.
PreconditionerType preconditionerType = PreconditionerType::Default
 Preconditioner type.
real relDivTol = 1e10_r
 Relative residual norm tolerance for divergence, relative to the same norm of the right-hand side.
real relTol = 1e-5_r
 Relative residual norm tolerance for convergence, relative to the same norm of the right-hand side.
int restartSize = 1000
 Krylov subspace dimension before restarting.
LinearSolverType solverType = LinearSolverType::Default
 Linear solver type.
VerbosityLevel verbosity = VerbosityLevel::Warning
 Verbosity level for logging output.

Detailed Description

Parameters for the linear solve performed in each iteration of the non-linear solver.

Definition at line 376 of file linear_solver_params.h.

Member Function Documentation

◆ operator==()

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

Member Data Documentation

◆ abortIfNotSpd

bool superdex::LinearSolverParams::abortIfNotSpd = false

Abort solve if matrix is not SPD.

Note
Applies only to iterative SPD solvers (e.g., LinearSolverType::CG, LinearSolverType::CudaCG, LinearSolverType::AugmentedCG).

Definition at line 456 of file linear_solver_params.h.

◆ absTol

real superdex::LinearSolverParams::absTol = 1e-9_r

Absolute residual norm tolerance for convergence.

Note
Applies only to iterative solvers.
When the solver stops on LinearSolverConvergenceNorm::ResidualPerActorWeighted, the absolute stop ends the solve only once every actor's weighted residual \(\|r_a\|_W\) is at most absTol. Otherwise, it bounds the solver's stopping norm.
0 leaves only the relative test.
A negative value lets Mochi select it. When the solver stops on LinearSolverConvergenceNorm::ResidualPerActorWeighted, Mochi selects 1% of the residual at which the non-linear solver accepts each actor: NonLinearSolverParams::relTol times the actor's initial residual, or NonLinearSolverParams::absTol if larger. When it stops on LinearSolverConvergenceNorm::ResidualL2 in NonLinearSolverConvergenceMode::Global mode, Mochi selects 1% of the residual at which the non-linear solver accepts the island. Otherwise, it selects 1e-9. The selection is 0 when NonLinearSolverParams::absTol is 0 and either NonLinearSolverParams::relTol or the initial residual of an actor or the island is 0, which leaves only the relative test.

Definition at line 412 of file linear_solver_params.h.

◆ maxIter

int superdex::LinearSolverParams::maxIter = kAutoLinearSolverMaxIter

Maximum number of iterations for iterative solvers.

Note
Applies only to iterative solvers.
Must be positive or kAutoLinearSolverMaxIter.
kAutoLinearSolverMaxIter lets Mochi select the maximum number of iterations based on the problem.

Definition at line 440 of file linear_solver_params.h.

◆ normType

LinearSolverConvergenceNorm superdex::LinearSolverParams::normType = LinearSolverConvergenceNorm::Default

Norm used for the stopping criteria.

Note
Applies only to the solvers documented in LinearSolverConvergenceNorm.

Definition at line 392 of file linear_solver_params.h.

◆ preconditionerType

PreconditionerType superdex::LinearSolverParams::preconditionerType = PreconditionerType::Default

Preconditioner type.

Note
Applies only to iterative solvers.

Definition at line 385 of file linear_solver_params.h.

◆ relDivTol

real superdex::LinearSolverParams::relDivTol = 1e10_r

Relative residual norm tolerance for divergence, relative to the same norm of the right-hand side.

Note
Applies only to iterative solvers.

Definition at line 430 of file linear_solver_params.h.

◆ relTol

real superdex::LinearSolverParams::relTol = 1e-5_r

Relative residual norm tolerance for convergence, relative to the same norm of the right-hand side.

Note
Applies only to iterative solvers.
Ignored when using LinearToleranceStrategy::EisenstatWalker1 or LinearToleranceStrategy::EisenstatWalker2 in the non-linear solver.

Definition at line 422 of file linear_solver_params.h.

◆ restartSize

int superdex::LinearSolverParams::restartSize = 1000

Krylov subspace dimension before restarting.

Note
Applies only to GMRES solvers (e.g., LinearSolverType::GMRES, LinearSolverType::CudaGMRES).

Definition at line 448 of file linear_solver_params.h.

◆ solverType

LinearSolverType superdex::LinearSolverParams::solverType = LinearSolverType::Default

Linear solver type.

Definition at line 378 of file linear_solver_params.h.

◆ verbosity

VerbosityLevel superdex::LinearSolverParams::verbosity = VerbosityLevel::Warning

Verbosity level for logging output.

Definition at line 459 of file linear_solver_params.h.


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