Description

Base class for all Chrono solvers (for linear problems or complementarity problems).


See ChSystemDescriptor for more information about the problem formulation and the data structures passed to the solver.

#include <ChSolver.h>

Inheritance diagram for chrono::ChSolver:

Public Types

enum  Type {
  Type::PSOR = 0, Type::PSSOR, Type::PJACOBI, Type::PMINRES,
  Type::BARZILAIBORWEIN, Type::APGD, Type::ADDM, Type::SPARSE_LU,
  Type::SPARSE_QR, Type::PARDISO_MKL, Type::PARDISO_PROJECT, Type::MUMPS,
  Type::GMRES, Type::MINRES, Type::BICGSTAB, CUSTOM
}
 Available types of solvers. More...
 

Public Member Functions

virtual Type GetType () const
 Return type of the solver.
 
virtual bool SolveRequiresMatrix () const =0
 Indicate whether or not the Solve() phase requires an up-to-date problem matrix. More...
 
virtual double Solve (ChSystemDescriptor &sysd)=0
 Performs the solution of the problem. More...
 
virtual bool Setup (ChSystemDescriptor &sysd)
 This function does the setup operations for the solver. More...
 
void SetVerbose (bool mv)
 Set verbose output from solver.
 
void EnableWrite (bool val, const std::string &frame, const std::string &out_dir=".")
 Enable/disable debug output of matrix, RHS, and solution vector.
 
virtual void ArchiveOUT (ChArchiveOut &marchive)
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIN (ChArchiveIn &marchive)
 Method to allow de-serialization of transient data from archives.
 

Protected Attributes

bool verbose
 
bool write_matrix
 
std::string output_dir
 
std::string frame_id
 

Member Enumeration Documentation

◆ Type

Available types of solvers.

Enumerator
PSOR 

Projected SOR (Successive Over-Relaxation)

PSSOR 

Projected symmetric SOR.

PJACOBI 

Projected Jacobi.

PMINRES 

Projected MINRES.

BARZILAIBORWEIN 

Barzilai-Borwein.

APGD 

Accelerated Projected Gradient Descent.

ADDM 

Alternating Direction Method of Multipliers.

SPARSE_LU 

Sparse supernodal LU factorization.

SPARSE_QR 

Sparse left-looking rank-revealing QR factorization.

PARDISO_MKL 

Pardiso MKL (super-nodal sparse direct solver)

PARDISO_PROJECT 

Pardiso (from PardisoProject) (super-nodal sparse direct solver)

MUMPS 

Mumps (MUltifrontal Massively Parallel sparse direct Solver)

GMRES 

Generalized Minimal RESidual Algorithm.

MINRES 

MINimum RESidual method.

BICGSTAB 

Bi-conjugate gradient stabilized.

Member Function Documentation

◆ Setup()

virtual bool chrono::ChSolver::Setup ( ChSystemDescriptor sysd)
inlinevirtual

This function does the setup operations for the solver.

The purpose of this function is to prepare the solver for subsequent calls to the solve function. The system descriptor contains the constraints and variables. This function is called only as frequently it is determined that it is appropriate to perform the setup phase.

Reimplemented in chrono::ChDirectSolverLS, chrono::ChIterativeSolverLS, and chrono::ChSolverPardisoProject.

◆ Solve()

virtual double chrono::ChSolver::Solve ( ChSystemDescriptor sysd)
pure virtual

Performs the solution of the problem.

This function MUST be implemented in children classes, with specialized methods such as iterative or direct solvers. The system descriptor contains the constraints and variables. Returns true if it successfully solves the problem and false otherwise.

Implemented in chrono::ChDirectSolverLS, chrono::ChIterativeSolverLS, chrono::ChSolverADMM, chrono::ChSolverPMINRES, chrono::ChSolverMatlab, chrono::ChSolverPSSOR, chrono::ChIterativeSolverMulticore, chrono::ChSolverBB, chrono::ChSolverPJacobi, chrono::ChSolverPSOR, and chrono::ChSolverAPGD.

◆ SolveRequiresMatrix()

virtual bool chrono::ChSolver::SolveRequiresMatrix ( ) const
pure virtual

Indicate whether or not the Solve() phase requires an up-to-date problem matrix.

Typically, direct solvers only need the matrix for the Setup() phase. However, iterative solvers likely require the matrix to perform the necessary matrix-vector operations.

Implemented in chrono::ChIterativeSolverLS, chrono::ChDirectSolverLS, chrono::ChIterativeSolverVI, and chrono::ChSolverMatlab.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/solver/ChSolver.h
  • /builds/uwsbel/chrono/src/chrono/solver/ChSolver.cpp