opensurgsim
Public Member Functions | List of all members
SurgSim::Math::OdeSolverLinearRungeKutta4 Class Reference

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

#include <OdeSolverLinearRungeKutta4.h>

Inheritance diagram for SurgSim::Math::OdeSolverLinearRungeKutta4:
SurgSim::Math::OdeSolverRungeKutta4 SurgSim::Math::OdeSolver

Public Member Functions

 OdeSolverLinearRungeKutta4 (OdeEquation *equation)
 Constructor. More...
 
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::OdeSolverRungeKutta4
 OdeSolverRungeKutta4 (OdeEquation *equation)
 Constructor. More...
 
void solve (double dt, const OdeState &currentState, OdeState *newState, bool computeCompliance=true) override
 Solves the equation. More...
 
- Public Member Functions inherited from SurgSim::Math::OdeSolver
 OdeSolver (OdeEquation *equation)
 Constructor. More...
 
virtual ~OdeSolver ()
 Virtual destructor.
 
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< LinearSparseSolveAndInversegetLinearSolver () 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 SparseMatrixgetSystemMatrix () const
 Queries the current system matrix. More...
 
const MatrixgetComplianceMatrix () const
 

Additional Inherited Members

- Protected Member Functions inherited from SurgSim::Math::OdeSolverRungeKutta4
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::OdeSolverRungeKutta4
RungeKuttaDerivedState m_k1
 
RungeKuttaDerivedState m_k2
 
RungeKuttaDerivedState m_k3
 
RungeKuttaDerivedState m_k4
 
- Protected Attributes inherited from SurgSim::Math::OdeSolver
std::string m_name
 Name for this solver. More...
 
OdeEquationm_equation
 The ode equation (API providing the necessary evaluation methods and the initial state)
 
std::shared_ptr< LinearSparseSolveAndInversem_linearSolver
 The specialized linear solver to use when solving the ode equation.
 
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)
 
Vector m_rhs
 
Matrix m_complianceMatrix
 Compliance matrix which is the inverse of the system matrix, including boundary conditions.
 

Detailed Description

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

Constructor & Destructor Documentation

§ OdeSolverLinearRungeKutta4()

SurgSim::Math::OdeSolverLinearRungeKutta4::OdeSolverLinearRungeKutta4 ( OdeEquation equation)
explicit

Constructor.

Parameters
equationThe ode equation to be solved

Member Function Documentation

§ solve()

void SurgSim::Math::OdeSolverLinearRungeKutta4::solve ( double  dt,
const OdeState currentState,
OdeState newState,
bool  computeCompliance = true 
)
overridevirtual

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.

Implements SurgSim::Math::OdeSolver.


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