sofa::core::componentmodel::behavior::OdeSolver Class Reference

Component responsible for timestep integration, i.e. More...

#include <OdeSolver.h>

Inheritance diagram for sofa::core::componentmodel::behavior::OdeSolver:

Inheritance graph
[legend]
Collaboration diagram for sofa::core::componentmodel::behavior::OdeSolver:

Collaboration graph
[legend]

Public Types

typedef BaseMechanicalState::VecId VecId

Public Member Functions

 OdeSolver ()
virtual ~OdeSolver ()
virtual void solve (double dt)=0
 Main computation method.
virtual void propagatePositionAndVelocity (double t, BaseMechanicalState::VecId x, BaseMechanicalState::VecId v)=0
 Propagate the given state (time, position and velocity) through all mappings.
virtual double getIntegrationFactor (int inputDerivative, int outputDerivative) const =0
 Given an input derivative order (0 for position, 1 for velocity, 2 for acceleration), how much will it affect the output derivative of the given order.
virtual double getSolutionIntegrationFactor (int outputDerivative) const =0
 Given a solution of the linear system, how much will it affect the output derivative of the given order.
virtual double getVelocityIntegrationFactor () const
 Given the solution dx of the linear system inversion, how much will it affect the velocity.
virtual double getPositionIntegrationFactor () const
 Given the solution dx of the linear system inversion, how much will it affect the position.

Detailed Description

Component responsible for timestep integration, i.e.

advancing the state from time t to t+dt.

This class currently control both the integration scheme (explicit, implicit, static, etc), and the linear system resolution algorithm (conjugate gradient, matrix direct inversion, etc). Those two aspect will propably be separated in a future version.

While all computations required to do the integration step are handled by this object, they should not be implemented directly in it, but instead the solver propagates orders (or Visitor) to the other components in the scenegraph that will locally execute them. This allow for greater flexibility (the solver can just ask for the forces to be computed without knowing what type of forces are present), as well as performances (some computations can be executed in parallel).

Definition at line 66 of file OdeSolver.h.


Member Typedef Documentation

Reimplemented in sofa::simulation::OdeSolverImpl.

Definition at line 69 of file OdeSolver.h.


Constructor & Destructor Documentation

sofa::core::componentmodel::behavior::OdeSolver::OdeSolver (  ) 

Definition at line 43 of file OdeSolver.cpp.

sofa::core::componentmodel::behavior::OdeSolver::~OdeSolver (  )  [virtual]

Definition at line 46 of file OdeSolver.cpp.


Member Function Documentation

virtual double sofa::core::componentmodel::behavior::OdeSolver::getIntegrationFactor ( int  inputDerivative,
int  outputDerivative 
) const [pure virtual]

Given an input derivative order (0 for position, 1 for velocity, 2 for acceleration), how much will it affect the output derivative of the given order.

This method is used to compute the compliance for contact corrections. For example, a backward-Euler dynamic implicit integrator would use: Input: x_t v_t a_{t+dt} x_{t+dt} 1 dt dt^2 v_{t+dt} 0 1 dt

If the linear system is expressed on s = a_{t+dt} dt, then the final factors are: Input: x_t v_t a_t s x_{t+dt} 1 dt 0 dt v_{t+dt} 0 1 0 1 a_{t+dt} 0 0 0 1/dt The last column is returned by the getSolutionIntegrationFactor method.

Implemented in sofa::component::odesolver::CentralDifferenceSolver, sofa::component::odesolver::CGImplicitSolver, sofa::component::odesolver::DampVelocitySolver, sofa::component::odesolver::EulerImplicitSolver, sofa::component::odesolver::EulerSolver, sofa::component::odesolver::RungeKutta2Solver, sofa::component::odesolver::RungeKutta4Solver, and sofa::component::odesolver::StaticSolver.

virtual double sofa::core::componentmodel::behavior::OdeSolver::getPositionIntegrationFactor (  )  const [inline, virtual]

Given the solution dx of the linear system inversion, how much will it affect the position.

This method is used to compute the compliance for contact corrections

Reimplemented in sofa::component::odesolver::EulerImplicitSolver.

Definition at line 120 of file OdeSolver.h.

References getSolutionIntegrationFactor().

Referenced by sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::applyContactForce(), and sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::getCompliance().

virtual double sofa::core::componentmodel::behavior::OdeSolver::getSolutionIntegrationFactor ( int  outputDerivative  )  const [pure virtual]

virtual double sofa::core::componentmodel::behavior::OdeSolver::getVelocityIntegrationFactor (  )  const [inline, virtual]

Given the solution dx of the linear system inversion, how much will it affect the velocity.

This method is used to compute the compliance for contact corrections

Reimplemented in sofa::component::odesolver::EulerImplicitSolver.

Definition at line 112 of file OdeSolver.h.

References getSolutionIntegrationFactor().

Referenced by sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::applyContactForce().

virtual void sofa::core::componentmodel::behavior::OdeSolver::propagatePositionAndVelocity ( double  t,
BaseMechanicalState::VecId  x,
BaseMechanicalState::VecId  v 
) [pure virtual]

Propagate the given state (time, position and velocity) through all mappings.

Why is this necessary in the OdeSolver API ? (Jeremie A. 03/02/2008)

Implemented in sofa::simulation::OdeSolverImpl.

Referenced by sofa::simulation::MechanicalIntegrationVisitor::fwdOdeSolver().

virtual void sofa::core::componentmodel::behavior::OdeSolver::solve ( double  dt  )  [pure virtual]


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

Generated on Sun Nov 23 04:23:14 2008 for Sofa by  doxygen 1.5.7.1