opensurgsim
|
Static ode solver solves the following \(2^{nd}\) order ode \(M(x(t), v(t)).a(t) = f(t, x(t), v(t))\). More...
#include <OdeSolverStatic.h>
Public Member Functions | |
OdeSolverStatic (OdeEquation *equation) | |
Constructor. More... | |
void | solve (double dt, const OdeState ¤tState, OdeState *newState, bool computeCompliance=true) override |
Solves the equation. More... | |
![]() | |
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< 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 |
Protected Member Functions | |
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... | |
![]() | |
void | computeComplianceMatrixFromSystemMatrix (const OdeState &state) |
Helper method computing the compliance matrix from the system matrix and setting the boundary conditions. More... | |
Additional Inherited Members | |
![]() | |
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) | |
std::shared_ptr< LinearSparseSolveAndInverse > | m_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. | |
Static ode solver solves the following \(2^{nd}\) order ode \(M(x(t), v(t)).a(t) = f(t, x(t), v(t))\).
This ode equation is solved w.r.t. \(x\), by discarding all time derived variables (i.e. \(v\), \(a\)) reducing the equation to solve to:
\[ 0 = f(t, x(t)) = f_{ext} + f_{int}(t, x(t)) = f_{ext} - K(x).(x - x0) \]
|
explicit |
Constructor.
equation | The ode equation to be solved |
|
overrideprotectedvirtual |
Assemble the linear system (A.x=b) to be solved for the state and new states (useful for certain ode solver).
dt | The time step used in the system |
state,newState | The state and newState to be used to evaluate the system |
computeRHS | True to compute the RHS vector, False otherwise |
Implements SurgSim::Math::OdeSolver.
|
overridevirtual |
Solves the equation.
dt | The time step | |
currentState | State at time t | |
[out] | newState | State at time t+dt |
computeCompliance | True to explicitly compute the compliance matrix, False otherwise |
Implements SurgSim::Math::OdeSolver.