![]() |
Base class for all solvers of ode equation of order 2 of the form M(x(t), v(t)).a(t) = f(t, x(t), v(t)) More...
#include <SurgSim/Math/OdeSolver.h>
Public Member Functions | |
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< LinearSolveAndInverse > linearSolver) |
Sets the specialized linear solver to use with this Ode solver. More... | |
std::shared_ptr< LinearSolveAndInverse > | getLinearSolver () const |
Gets the specialized linear solver used with this Ode solver. More... | |
virtual void | solve (double dt, const OdeState ¤tState, OdeState *newState)=0 |
Solves the equation. More... | |
const Matrix & | getSystemMatrix () const |
Queries the current system matrix. More... | |
const Matrix & | getCompliance () const |
Queries the current compliance matrix. More... | |
Protected Member Functions | |
void | allocate (size_t size) |
Allocates the system and compliance matrices. More... | |
Protected Attributes | |
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< LinearSolveAndInverse > | m_linearSolver |
The specialized linear solver to use when solving the ode equation. More... | |
Matrix | m_systemMatrix |
System matrix (can be M, K, combination of MDK depending on the solver) A static solver will have K for system matrix A dynamic explicit solver will have M for system matrix A dynamic implicit solver will have a combination of M, D and K for system matrix. More... | |
Matrix | m_compliance |
Compliance matrix which is the inverse of the system matrix. More... | |
Base class for all solvers of ode equation of order 2 of the form M(x(t), v(t)).a(t) = f(t, x(t), v(t))
|
explicit |
Constructor.
equation | The ode equation to be solved |
|
inlinevirtual |
Virtual destructor.
|
protected |
Allocates the system and compliance matrices.
size | The size to account for in the data structure |
const Matrix & SurgSim::Math::OdeSolver::getCompliance | ( | ) | const |
Queries the current compliance matrix.
std::shared_ptr< LinearSolveAndInverse > SurgSim::Math::OdeSolver::getLinearSolver | ( | ) | const |
Gets the specialized linear solver used with this Ode solver.
const std::string SurgSim::Math::OdeSolver::getName | ( | ) | const |
Gets the solver's name.
const Matrix & SurgSim::Math::OdeSolver::getSystemMatrix | ( | ) | const |
Queries the current system matrix.
void SurgSim::Math::OdeSolver::setLinearSolver | ( | std::shared_ptr< LinearSolveAndInverse > | linearSolver | ) |
Sets the specialized linear solver to use with this Ode solver.
linearSolver | the linear solver to use when solving the ode equation |
|
pure virtual |
Solves the equation.
dt | The time step | |
currentState | State at time t | |
[out] | newState | State at time t+dt |
Implemented in SurgSim::Math::OdeSolverRungeKutta4, SurgSim::Math::OdeSolverEulerExplicit, SurgSim::Math::OdeSolverEulerImplicit, SurgSim::Math::OdeSolverEulerExplicitModified, SurgSim::Math::OdeSolverStatic, SurgSim::Math::OdeSolverLinearEulerExplicit, SurgSim::Math::OdeSolverLinearEulerExplicitModified, SurgSim::Math::OdeSolverLinearEulerImplicit, SurgSim::Math::OdeSolverLinearRungeKutta4, and SurgSim::Math::OdeSolverLinearStatic.
|
protected |
Compliance matrix which is the inverse of the system matrix.
|
protected |
The ode equation (API providing the necessary evaluation methods and the initial state)
|
protected |
The specialized linear solver to use when solving the ode equation.
|
protected |
Name for this solver.
|
protected |
System matrix (can be M, K, combination of MDK depending on the solver) A static solver will have K for system matrix A dynamic explicit solver will have M for system matrix A dynamic implicit solver will have a combination of M, D and K for system matrix.