Project Chrono: chrono::ChIterativeSolver Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
chrono::ChIterativeSolver Class Referenceabstract
Chrono::Engine » Solver

## Description

Base class for iterative solvers.

Provides basic settings, common to both linear and complementarity iterative solvers.

`#include <ChIterativeSolver.h>`

Inheritance diagram for chrono::ChIterativeSolver:
[legend]

## Public Member Functions
virtual void | SetMaxIterations (int max_iterations)
| Set the maximum number of iterations.
void | SetTolerance (double tolerance)
| Set the tolerance threshold used by the stopping criteria.
void | EnableDiagonalPreconditioner (bool val)
| Enable/disable use of a simple diagonal preconditioner (default: true).
void | EnableWarmStart (bool val)
| Enable/disable warm starting by providing an initial guess (default: false).
int | GetMaxIterations () const
| Get the current maximum number of iterations.
double | GetTolerance () const
| Get the current tolerance value.
virtual int | GetIterations () const =0
| Return the number of iterations performed during the last solve.
virtual double | GetError () const =0
| Return the tolerance error reached during the last solve.

## Protected Member Functions
| ChIterativeSolver (int max_iterations, double tolerance, bool use_precond, bool warm_start)
void | WriteMatrices (ChSystemDescriptor &sysd, bool one_indexed=true)
double | CheckSolution (ChSystemDescriptor &sysd, const ChVectorDynamic<> &x)

## Protected Attributes
bool | m_use_precond
| use diagonal preconditioning?
bool | m_warm_start
| use initial guesss?
int | m_max_iterations
| maximum number of iterations
double | m_tolerance
| tolerance threshold in stopping criteria

## Friends
class | ChSystem

## Member Function Documentation

## ◆ EnableDiagonalPreconditioner()

void chrono::ChIterativeSolver::EnableDiagonalPreconditioner | ( | bool | val | ) |
| inline

Enable/disable use of a simple diagonal preconditioner (default: true).

If enabled, solver that support this feature will use the diagonal of the system matrix for preconditioning.

## ◆ EnableWarmStart()

void chrono::ChIterativeSolver::EnableWarmStart | ( | bool | val | ) |
| inline

Enable/disable warm starting by providing an initial guess (default: false).

If enabled, the solvers use as an initial guess the current values for [x; -lambda].
ATTENTION: enable this option only if using the Euler implicit linearized integrator!

## ◆ GetError()

virtual double chrono::ChIterativeSolver::GetError | ( |  | ) | const
| pure virtual

Return the tolerance error reached during the last solve.

Implemented in chrono::ChIterativeSolverMulticore, chrono::ChSolverADMM, chrono::ChSolverAPGD, chrono::ChSolverBB, chrono::ChSolverBiCGSTAB, chrono::ChSolverGMRES, chrono::ChSolverMINRES, chrono::ChSolverPJacobi, chrono::ChSolverPMINRES, chrono::ChSolverPSOR, and chrono::ChSolverPSSOR.

## ◆ GetIterations()

virtual int chrono::ChIterativeSolver::GetIterations | ( |  | ) | const
| pure virtual

Return the number of iterations performed during the last solve.

Implemented in chrono::ChIterativeSolverVI, chrono::ChSolverBiCGSTAB, chrono::ChSolverGMRES, and chrono::ChSolverMINRES.

## ◆ SetMaxIterations()

virtual void chrono::ChIterativeSolver::SetMaxIterations | ( | int | max_iterations | ) |
| inlinevirtual

Set the maximum number of iterations.

Reimplemented in chrono::ChIterativeSolverVI.

The documentation for this class was generated from the following files:

- D:/W/B/src/chrono-9.0.1/src/chrono/solver/ChIterativeSolver.h
- D:/W/B/src/chrono-9.0.1/src/chrono/solver/ChIterativeSolver.cpp