Description

Base class for solvers aimed at solving complementarity problems arising from QP optimization problems.

This is an abstract class and specific solution methods are implemented in derived classes (e.g., SOR, APGD, etc.) The problem is described by a variational inequality VI(Z*x-d,K):

| M -Cq'|*|q|- | f|= |0| , l Y, C Ny, normal cone to Y | Cq -E | |l| |-b| |c|

Also Z symmetric by flipping sign of l_i: |M Cq'|*| q|-| f|=|0| |Cq E | |-l| |-b| |c|

  • case linear problem: all Y_i = R, Ny=0, ex. all bilaterals
  • case LCP: all Y_i = R+: c>=0, l>=0, l*c=0
  • case CCP: Y_i are friction cones

#include <ChSolver.h>

Inheritance diagram for chrono::ChSolver:

Public Types

enum  Type {
  SOR = 0, SYMMSOR, JACOBI, SOR_MULTITHREAD,
  PMINRES, BARZILAIBORWEIN, PCG, APGD,
  MINRES, SOLVER_DEM, CUSTOM
}
 Available types of solvers.
 

Public Member Functions

virtual Type GetType () const
 Return type of the solver. More...
 
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.
 
bool GetVerbose () const
 
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
 

Member Function Documentation

virtual Type chrono::ChSolver::GetType ( ) const
virtual

Return type of the solver.

Default is CUSTOM. Derived classes should override this function.

Reimplemented in chrono::ChSolverMINRES, chrono::ChSolverBB, chrono::ChSolverPMINRES, chrono::ChSolverJacobi, chrono::ChSolverSOR, chrono::ChSolverSymmSOR, chrono::ChSolverAPGD, chrono::ChSolverDEM, and chrono::ChSolverPCG.

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

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. This function is called only as frequently it is determined that it is appropriate to perform the setup phase.

Parameters
sysdsystem description with constraints and variables

Reimplemented in chrono::ChSolverMKL< Matrix >.

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. Returns true if it successfully solves the problem and false otherwise.

Parameters
sysdsystem description with constraints and variables

Implemented in chrono::ChSolverMKL< Matrix >, chrono::ChSolverMINRES, chrono::ChSolverBB, chrono::ChSolverPMINRES, chrono::ChSolverJacobi, chrono::ChSolverSOR, chrono::ChSolverSymmSOR, chrono::ChSolverAPGD, chrono::ChSolverDEM, chrono::ChSolverPCG, and chrono::ChSolverMatlab.

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::ChSolverMKL< Matrix >, chrono::ChIterativeSolver, and chrono::ChSolverMatlab.