SurgSim::Math::OdeSolverLinearEulerImplicit Class Reference

Linear Version of the Euler Implicit ode solver This solver assumes that the system is linear, ie that Mass, Damping, and Stiffness matrices do not change. More...

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

Inheritance diagram for SurgSim::Math::OdeSolverLinearEulerImplicit:

## Public Member Functions

| OdeSolverLinearEulerImplicit (OdeEquation *equation)
| Constructor. More...
void | setNewtonRaphsonMaximumIteration (size_t maximumIteration) override
void | solve (double dt, const OdeState &currentState, OdeState *newState, bool computeCompliance=true) override
| The parameter computeCompliance is irrelevant for any Linear solver as it is a constant matrix. More...
Public Member Functions inherited from SurgSim::Math::OdeSolverEulerImplicit
| OdeSolverEulerImplicit (OdeEquation *equation)
| Constructor. More...
size_t | getNewtonRaphsonMaximumIteration () const
void | setNewtonRaphsonEpsilonConvergence (double epsilonConvergence)
double | getNewtonRaphsonEpsilonConvergence () const
Public Member Functions inherited from SurgSim::Math::OdeSolver
| OdeSolver (OdeEquation *equation)
| Constructor. More...
virtual | ~OdeSolver ()
| Virtual destructor. More...
const std::string | getName () const
| Gets the solver's name. More...
void | setLinearSolver (std::shared_ptr< LinearSparseSolveAndInverse > linearSolver)
| Sets the specialized linear solver to use with this Ode solver. More...
std::shared_ptr< LinearSparseSolveAndInverse > | getLinearSolver () const
| Gets the specialized linear solver used with this Ode solver. More...
void | computeMatrices (double dt, const OdeState &state, bool computeCompliance=true)
| Computes the system and compliance matrices for a given state. More...
const SparseMatrix & | getSystemMatrix () const
| Queries the current system matrix. More...
const Matrix & | getComplianceMatrix () const

## Private Attributes

SparseMatrix | m_constantK
| The constant stiffness matrix. More...
bool | m_initialized
| Has the solver been initialized. More...

## Additional Inherited Members

Protected Member Functions inherited from SurgSim::Math::OdeSolverEulerImplicit
void | assembleLinearSystem (double dt, const OdeState &state, const OdeState &newState, bool computeRHS=true) override
| Assemble the linear system (A.x=b) to be solved for the state and new states (useful for certain ode solver). More...
Protected Member Functions inherited from SurgSim::Math::OdeSolver
void | computeComplianceMatrixFromSystemMatrix (const OdeState &state)
| Helper method computing the compliance matrix from the system matrix and setting the boundary conditions. More...
Protected Attributes inherited from SurgSim::Math::OdeSolverEulerImplicit
size_t | m_maximumIteration
| Newton-Raphson maximum number of iteration (1 => linearization) More...
double | m_epsilonConvergence
| Newton-Raphson convergence criteria (variation of the solution over time) More...
Vector | m_previousSolution
| Newton-Raphson previous solution (we solve a problem to find deltaV, the variation in velocity) More...
Protected Attributes inherited from SurgSim::Math::OdeSolver
std::string | m_name
| Name for this solver. More...
OdeEquation & | m_equation
| The ode equation (API providing the necessary evaluation methods and the initial state) More...
std::shared_ptr< LinearSparseSolveAndInverse > | m_linearSolver
| The specialized linear solver to use when solving the ode equation. More...
SparseMatrix | m_systemMatrix
| Linear system matrix (can be M, K, combination of MDK depending on the solver), including boundary conditions. More...
Vector | m_solution
| Linear system solution and rhs vectors (including boundary conditions) More...
Vector | m_rhs
Matrix | m_complianceMatrix
| Compliance matrix which is the inverse of the system matrix, including boundary conditions. More...

## Detailed Description

Linear Version of the Euler Implicit ode solver This solver assumes that the system is linear, ie that Mass, Damping, and Stiffness matrices do not change.

Note
  If the matrices are all constant, the problem to solve becomes linear,
  therefore the Newton-Raphson algorithm will be exact in only 1 iteration.
  Therefore this solver uses a number of maximum iteration of 1 unless overriden.

## Constructor & Destructor Documentation

## OdeSolverLinearEulerImplicit()

SurgSim::Math::OdeSolverLinearEulerImplicit::OdeSolverLinearEulerImplicit | ( | OdeEquation * | equation | ) |

explicit

Constructor.

Parameters

  equation | The ode equation to be solved

## Member Function Documentation

## setNewtonRaphsonMaximumIteration()

void SurgSim::Math::OdeSolverLinearEulerImplicit::setNewtonRaphsonMaximumIteration | ( | size_t | maximumIteration | ) |

override virtual

Parameters

  maximumIteration | The Newton-Raphson algorithm maximum number of iterations

Reimplemented from SurgSim::Math::OdeSolverEulerImplicit.

## solve()

void SurgSim::Math::OdeSolverLinearEulerImplicit::solve | ( | double | dt,
|  | const OdeState & | currentState,
|  | OdeState * | newState,
|  | bool | computeCompliance = `true`
| ) |  |

override virtual

The parameter computeCompliance is irrelevant for any Linear solver as it is a constant matrix.

It will be precomputed on the first call and use in the following calls, no matter what the parameter value is.

Reimplemented from SurgSim::Math::OdeSolverEulerImplicit.

## Member Data Documentation

## m_constantK

SparseMatrix SurgSim::Math::OdeSolverLinearEulerImplicit::m_constantK

private

The constant stiffness matrix.

## m_initialized

bool SurgSim::Math::OdeSolverLinearEulerImplicit::m_initialized

private

Has the solver been initialized.

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

- SurgSim/Math/OdeSolverLinearEulerImplicit.h
- SurgSim/Math/OdeSolverLinearEulerImplicit.cpp