16 #ifndef SURGSIM_MATH_ODESOLVER_H 17 #define SURGSIM_MATH_ODESOLVER_H 20 #include <unordered_map> 22 #include <boost/assign/list_of.hpp> 52 boost::assign::map_list_of
91 const std::string
getName()
const;
95 void setLinearSolver(std::shared_ptr<LinearSparseSolveAndInverse> linearSolver);
106 virtual void solve(
double dt,
const OdeState& currentState,
OdeState* newState,
bool computeCompliance =
true) = 0;
130 bool computeRHS =
true) = 0;
165 #endif // SURGSIM_MATH_ODESOLVER_H Definition: CompoundShapeToGraphics.cpp:29
std::string m_name
Name for this solver.
Definition: OdeSolver.h:140
const std::unordered_map< IntegrationScheme, std::string, std::hash< int > > IntegrationSchemeNames
Definition: OdeSolver.h:51
Definition: OdeSolver.h:47
virtual void solve(double dt, const OdeState ¤tState, OdeState *newState, bool computeCompliance=true)=0
Solves the equation.
void computeComplianceMatrixFromSystemMatrix(const OdeState &state)
Helper method computing the compliance matrix from the system matrix and setting the boundary conditi...
Definition: OdeSolver.cpp:69
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
Definition: OdeSolver.h:40
Definition: OdeSolver.h:48
Definition: OdeSolver.h:42
Ode equation of 2nd order of the form with for initial conditions and a set of boundary conditions...
Definition: OdeEquation.h:54
The state of an ode of 2nd order of the form with boundary conditions.
Definition: OdeState.h:38
Vector m_solution
Linear system solution and rhs vectors (including boundary conditions)
Definition: OdeSolver.h:155
Definition: OdeSolver.h:46
virtual void assembleLinearSystem(double dt, const OdeState &state, const OdeState &newState, bool computeRHS=true)=0
Assemble the linear system (A.x=b) to be solved for the state and new states (useful for certain ode ...
const std::string getName() const
Gets the solver's name.
Definition: OdeSolver.cpp:31
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
A dynamic size column vector.
Definition: Vector.h:68
Eigen::SparseMatrix< double > SparseMatrix
A sparse matrix.
Definition: SparseMatrix.h:32
IntegrationScheme
The diverse numerical integration scheme supported Each Ode Solver should have its own entry in this ...
Definition: OdeSolver.h:36
Definition: OdeSolver.h:41
OdeSolver(OdeEquation *equation)
Constructor.
Definition: OdeSolver.cpp:25
virtual ~OdeSolver()
Virtual destructor.
Definition: OdeSolver.h:86
Vector m_rhs
Definition: OdeSolver.h:155
Definitions of small fixed-size square matrix types.
Definition: OdeSolver.h:44
OdeEquation & m_equation
The ode equation (API providing the necessary evaluation methods and the initial state) ...
Definition: OdeSolver.h:143
const Matrix & getComplianceMatrix() const
Definition: OdeSolver.cpp:51
Base class for all solvers of ode equation of order 2 of the form .
Definition: OdeSolver.h:78
const SparseMatrix & getSystemMatrix() const
Queries the current system matrix.
Definition: OdeSolver.cpp:46
Definition: OdeSolver.h:45
Definition: OdeSolver.h:39
SparseMatrix m_systemMatrix
Linear system matrix (can be M, K, combination of MDK depending on the solver), including boundary co...
Definition: OdeSolver.h:152
Definition: OdeSolver.h:43
Matrix m_complianceMatrix
Compliance matrix which is the inverse of the system matrix, including boundary conditions.
Definition: OdeSolver.h:158
std::shared_ptr< LinearSparseSolveAndInverse > getLinearSolver() const
Gets the specialized linear solver used with this Ode solver.
Definition: OdeSolver.cpp:41
void computeMatrices(double dt, const OdeState &state, bool computeCompliance=true)
Computes the system and compliance matrices for a given state.
Definition: OdeSolver.cpp:57
std::shared_ptr< LinearSparseSolveAndInverse > m_linearSolver
The specialized linear solver to use when solving the ode equation.
Definition: OdeSolver.h:146
void setLinearSolver(std::shared_ptr< LinearSparseSolveAndInverse > linearSolver)
Sets the specialized linear solver to use with this Ode solver.
Definition: OdeSolver.cpp:36
Definition: OdeSolver.h:38