chrono::ChSolverMINRES Class Reference


An iterative solver based on modified Krylov iteration of MINRES type alternated with gradient projection (active set).

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

#include <ChSolverMINRES.h>

Inheritance diagram for chrono::ChSolverMINRES:
Collaboration diagram for chrono::ChSolverMINRES:

Public Member Functions

 ChSolverMINRES (int mmax_iters=50, bool mwarm_start=false, double mtolerance=0.0)
virtual Type GetType () const override
 Return type of the solver. More...
virtual double Solve (ChSystemDescriptor &sysd) override
 Performs the solution of the problem. More...
double Solve_SupportingStiffness (ChSystemDescriptor &sysd)
 Same as Solve(), but this also supports the presence of ChKblock blocks. More...
void SetFeasTolerance (double mf)
double GetFeasTolerance ()
void SetMaxFixedpointSteps (int mm)
int GetMaxFixedpointSteps ()
void SetRelTolerance (double mrt)
double GetRelTolerance ()
void SetDiagonalPreconditioning (bool mp)
bool GetDiagonalPreconditioning ()
virtual void ArchiveOUT (ChArchiveOut &marchive) override
 Method to allow serialization of transient data to archives.
virtual void ArchiveIN (ChArchiveIn &marchive) override
 Method to allow de-serialization of transient data from archives.
- Public Member Functions inherited from chrono::ChIterativeSolver
 ChIterativeSolver (int mmax_iters=50, bool mwarm_start=false, double mtolerance=0.0, double momega=1.0, double mshlambda=1.0)
virtual bool SolveRequiresMatrix () const override
 Indicate whether ot not the Solve() phase requires an up-to-date problem matrix. More...
void SetMaxIterations (int mval)
 Set the maximum number of iterations. More...
int GetMaxIterations () const
 Get the current value for the maximum allowed number of iterations.
int GetTotalIterations () const
 Get the number of total iterations taken by the solver.
void SetOmega (double mval)
 Set the overrelaxation factor. More...
double GetOmega () const
 Return the current value of the overrelaxation factor.
virtual void SetSharpnessLambda (double mval)
 Set the sharpness factor. More...
virtual double GetSharpnessLambda () const
 Return the current value of the sharpness factor.
void SetWarmStart (bool mval)
 Enable/disable 'warm start'. More...
bool GetWarmStart () const
 Return a flag indicating whether or not warm start is enabled.
void SetTolerance (double mval)
 Set the tolerance for stopping criterion. More...
double GetTolerance () const
 Return the current value of the solver tolerance.
void SetRecordViolation (bool mval)
 Enable/disable recording of the constraint violation history. More...
bool GetRecordViolation () const
 Return a flag indicating whether or not constraint violations are recorded.
const std::vector< double > & GetViolationHistory () const
 Access the vector of constraint violation history. More...
const std::vector< double > & GetDeltalambdaHistory () const
 Access the vector with history of maximum change in Lagrange multipliers Note that collection of constraint violations must be enabled through SetRecordViolation. More...
- Public Member Functions inherited from chrono::ChSolver
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

Protected Attributes

double feas_tolerance
int max_fixedpoint_steps
bool diag_preconditioning
double rel_tolerance
- Protected Attributes inherited from chrono::ChIterativeSolver
int max_iterations
 maximum allowed iterations
int tot_iterations
 total number of iterations performed by the solver
bool warm_start
 indicate whether or not to use warm starting
double tolerance
 tolerance for termination criteria
double omega
 over-relaxation factor
double shlambda
 sharpness factor
bool record_violation_history
std::vector< double > violation_history
std::vector< double > dlambda_history
- Protected Attributes inherited from chrono::ChSolver
bool verbose

Additional Inherited Members

- Public Types inherited from chrono::ChSolver
enum  Type {
 Available types of solvers.
- Protected Member Functions inherited from chrono::ChIterativeSolver
void AtIterationEnd (double mmaxviolation, double mdeltalambda, unsigned int iternum)
 This method MUST be called by all iterative methods INSIDE their iteration loops (at the end). More...

Constructor & Destructor Documentation

chrono::ChSolverMINRES::ChSolverMINRES ( int  mmax_iters = 50,
bool  mwarm_start = false,
double  mtolerance = 0.0 
mmax_itersmax.number of iterations
mwarm_startuses warm start?
mtolerancetolerance for termination criterion

Member Function Documentation

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

Return type of the solver.

Default is CUSTOM. Derived classes should override this function.

Reimplemented from chrono::ChSolver.

double chrono::ChSolverMINRES::Solve ( ChSystemDescriptor sysd)

Performs the solution of the problem.

the maximum constraint violation after termination.

sysd.ShurComplementProduct(Nr, mr, &en_l); // Nr = N * r (no, recompute only when mr changes, see later)

sysd.ShurComplementProduct(Np, mp, &en_l); // Np = N * p (no, see optimization at the end)

ml += mp*alpha; // l = l + alpha * p; done below, also with projection

sysdsystem description with constraints and variables

Implements chrono::ChSolver.

double chrono::ChSolverMINRES::Solve_SupportingStiffness ( ChSystemDescriptor sysd)

Same as Solve(), but this also supports the presence of ChKblock blocks.

If Solve() is called and stiffness is present, Solve() automatically falls back to this function.

sysdsystem description with constraints and variables