SurgSim::Math::MlcpGaussSeidelSolver Class Reference

A solver for mixed LCP problems using the Gauss-Seidel iterative method. More...

`#include <SurgSim/Math/MlcpGaussSeidelSolver.h>`

Inheritance diagram for SurgSim::Math::MlcpGaussSeidelSolver:

## Public Member Functions

| MlcpGaussSeidelSolver ()
| Constructor. More...
| MlcpGaussSeidelSolver (double epsilonConvergence, double contactTolerance, size_t maxIterations)
| Constructor. More...
virtual | ~MlcpGaussSeidelSolver ()
| Destructor. More...
bool | solve (const MlcpProblem &problem, MlcpSolution *solution)
| Resolution of a given MLCP (Gauss Seidel iterative solver) More...
double | getEpsilonConvergence () const
void | setEpsilonConvergence (double precision)
| Set the precision. More...
double | getContactTolerance () const
void | setContactTolerance (double tolerance)
| Set the contact tolerance. More...
size_t | getMaxIterations () const
void | setMaxIterations (size_t maxIterations)
| Set the max number of iterations. More...
Public Member Functions inherited from SurgSim::Math::MlcpSolver
| MlcpSolver ()
| Constructor. More...
virtual | ~MlcpSolver ()

## Private Member Functions

void | computeEnforcementSystem (size_t problemSize, const MlcpProblem::Matrix &A, const MlcpProblem::Vector &b, const MlcpSolution::Vector &initialGuessAndSolution, const std::vector< MlcpConstraintType > &constraintsType, size_t constraintID, size_t matrixEntryForConstraintID)
void | calculateConvergenceCriteria (size_t problemSize, const MlcpProblem::Matrix &A, const MlcpProblem::Vector &b, const MlcpSolution::Vector &initialGuessAndSolution, const std::vector< MlcpConstraintType > &constraintsType, double constraintConvergenceCriteria[MLCP_NUM_CONSTRAINT_TYPES], double *convergenceCriteria, bool *validSignorini)
void | doOneIteration (size_t problemSize, const MlcpProblem::Matrix &A, const MlcpProblem::Vector &b, MlcpSolution::Vector *initialGuessAndSolution, const MlcpProblem::Vector &frictionCoefs, const std::vector< MlcpConstraintType > &constraintsType, double constraintConvergenceCriteria[MLCP_NUM_CONSTRAINT_TYPES], double *convergenceCriteria, bool *validSignorini)
void | printViolationsAndConvergence (size_t problemSize, const MlcpProblem::Matrix &A, const MlcpProblem::Vector &b, const MlcpSolution::Vector &initialGuessAndSolution, const std::vector< MlcpConstraintType > &constraintsType, double convergenceCriteria, bool validSignorini, size_t iterations)

## Private Attributes

double | m_epsilonConvergence
| The precision. More...
double | m_contactTolerance
| The contact tolerance. More...
size_t | m_maxIterations
| The maximum number of iterations. More...
size_t | m_numEnforcedAtomicConstraints
| The number of atomic constraints, aka the system size. More...
Matrix | m_lhsEnforcedLocalSystem
| The left-hand side matrix. More...
Vector | m_rhsEnforcedLocalSystem
| The right-hand side vector. More...
std::shared_ptr< SurgSim::Framework::Logger > | m_logger
| The logger. More...

## Detailed Description

A solver for mixed LCP problems using the Gauss-Seidel iterative method.

The problem can contain:

- CONSTRAINT = Bilateral constraint (all atomic, a fixed 3D point=3 atomics independents constraints)
- CONTACT = Unilateral constraint
  - frictionless => 1 atomic constraint per contact
  - frictional with Coulomb friction (1 mu parameter per contact) => 3 atomic dependent constraints per contact (1 directional + 2 tangentials)
- SUTURING = Sliding constraint for suturing
  - Frictionless suturing constraint => 2 atomic constraints per sliding point
  - Frictional suturing constraint => 3 atomic constraints per sliding point (2 directional + 1 tangential with friction on it) => 1 mu parameter per frictional suturing

See e.g.: Duriez, Christian; Dubois, F.; Kheddar, A.; Andriot, C., "Realistic haptic rendering of interacting deformable objects in virtual environments," IEEE Transactions on Visualization and Computer Graphics, vol.12, no.1, pp.36,47, Jan.-Feb. 2006.

## Constructor & Destructor Documentation

## MlcpGaussSeidelSolver() [1/2]

SurgSim::Math::MlcpGaussSeidelSolver::MlcpGaussSeidelSolver | ( |  | ) |

Constructor.

## MlcpGaussSeidelSolver() [2/2]

SurgSim::Math::MlcpGaussSeidelSolver::MlcpGaussSeidelSolver | ( | double | epsilonConvergence,
|  | double | contactTolerance,
|  | size_t | maxIterations
| ) |  |

Constructor.

Parameters

  epsilonConvergence | The precision.
  contactTolerance | The contact tolerance.
  maxIterations | The max iterations.

## ~MlcpGaussSeidelSolver()

SurgSim::Math::MlcpGaussSeidelSolver::~MlcpGaussSeidelSolver | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## calculateConvergenceCriteria()

void SurgSim::Math::MlcpGaussSeidelSolver::calculateConvergenceCriteria | ( | size_t | problemSize,
|  | const MlcpProblem::Matrix & | A,
|  | const MlcpProblem::Vector & | b,
|  | const MlcpSolution::Vector & | initialGuessAndSolution,
|  | const std::vector< MlcpConstraintType > & | constraintsType,
|  | double | constraintConvergenceCriteria[MLCP_NUM_CONSTRAINT_TYPES],
|  | double * | convergenceCriteria,
|  | bool * | validSignorini
| ) |  |

private

## computeEnforcementSystem()

void SurgSim::Math::MlcpGaussSeidelSolver::computeEnforcementSystem | ( | size_t | problemSize,
|  | const MlcpProblem::Matrix & | A,
|  | const MlcpProblem::Vector & | b,
|  | const MlcpSolution::Vector & | initialGuessAndSolution,
|  | const std::vector< MlcpConstraintType > & | constraintsType,
|  | size_t | constraintID,
|  | size_t | matrixEntryForConstraintID
| ) |  |

private

## doOneIteration()

void SurgSim::Math::MlcpGaussSeidelSolver::doOneIteration | ( | size_t | problemSize,
|  | const MlcpProblem::Matrix & | A,
|  | const MlcpProblem::Vector & | b,
|  | MlcpSolution::Vector * | initialGuessAndSolution,
|  | const MlcpProblem::Vector & | frictionCoefs,
|  | const std::vector< MlcpConstraintType > & | constraintsType,
|  | double | constraintConvergenceCriteria[MLCP_NUM_CONSTRAINT_TYPES],
|  | double * | convergenceCriteria,
|  | bool * | validSignorini
| ) |  |

private

## getContactTolerance()

double SurgSim::Math::MlcpGaussSeidelSolver::getContactTolerance | ( |  | ) | const

Returns
  The contact tolerance.

## getEpsilonConvergence()

double SurgSim::Math::MlcpGaussSeidelSolver::getEpsilonConvergence | ( |  | ) | const

Returns
  The precision.

## getMaxIterations()

size_t SurgSim::Math::MlcpGaussSeidelSolver::getMaxIterations | ( |  | ) | const

Returns
  The max number of iterations.

## printViolationsAndConvergence()

void SurgSim::Math::MlcpGaussSeidelSolver::printViolationsAndConvergence | ( | size_t | problemSize,
|  | const MlcpProblem::Matrix & | A,
|  | const MlcpProblem::Vector & | b,
|  | const MlcpSolution::Vector & | initialGuessAndSolution,
|  | const std::vector< MlcpConstraintType > & | constraintsType,
|  | double | convergenceCriteria,
|  | bool | validSignorini,
|  | size_t | iterations
| ) |  |

private

## setContactTolerance()

void SurgSim::Math::MlcpGaussSeidelSolver::setContactTolerance | ( | double | tolerance | ) |

Set the contact tolerance.

Parameters

  tolerance | The contact tolerance.

## setEpsilonConvergence()

void SurgSim::Math::MlcpGaussSeidelSolver::setEpsilonConvergence | ( | double | precision | ) |

Set the precision.

Parameters

  precision | The precision.

## setMaxIterations()

void SurgSim::Math::MlcpGaussSeidelSolver::setMaxIterations | ( | size_t | maxIterations | ) |

Set the max number of iterations.

Parameters

  maxIterations | The max number of iterations.

## solve()

bool SurgSim::Math::MlcpGaussSeidelSolver::solve | ( | const MlcpProblem & | problem,
|  | MlcpSolution * | solution
| ) |  |

virtual

Resolution of a given MLCP (Gauss Seidel iterative solver)

Parameters

  | problem | The mlcp problem
  [out] | solution | The mlcp solution

Returns
  true if successfully converged.

Implements SurgSim::Math::MlcpSolver.

## Member Data Documentation

## m_contactTolerance

double SurgSim::Math::MlcpGaussSeidelSolver::m_contactTolerance

private

The contact tolerance.

## m_epsilonConvergence

double SurgSim::Math::MlcpGaussSeidelSolver::m_epsilonConvergence

private

The precision.

## m_lhsEnforcedLocalSystem

Matrix SurgSim::Math::MlcpGaussSeidelSolver::m_lhsEnforcedLocalSystem

private

The left-hand side matrix.

## m_logger

std::shared_ptr<SurgSim::Framework::Logger> SurgSim::Math::MlcpGaussSeidelSolver::m_logger

private

The logger.

## m_maxIterations

size_t SurgSim::Math::MlcpGaussSeidelSolver::m_maxIterations

private

The maximum number of iterations.

## m_numEnforcedAtomicConstraints

size_t SurgSim::Math::MlcpGaussSeidelSolver::m_numEnforcedAtomicConstraints

private

The number of atomic constraints, aka the system size.

## m_rhsEnforcedLocalSystem

Vector SurgSim::Math::MlcpGaussSeidelSolver::m_rhsEnforcedLocalSystem

private

The right-hand side vector.

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

- SurgSim/Math/MlcpGaussSeidelSolver.h
- SurgSim/Math/MlcpGaussSeidelSolver.cpp