sofa::core::componentmodel::behavior::LinearSolver Class Reference

Abstract interface for linear system solvers. More...

#include <LinearSolver.h>

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

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

Collaboration graph
[legend]

Public Types

typedef BaseMechanicalState::VecId VecId

Public Member Functions

 LinearSolver ()
virtual ~LinearSolver ()
virtual void resetSystem ()=0
 Reset the current linear system.
virtual void setSystemMBKMatrix (double mFact=0.0, double bFact=0.0, double kFact=0.0)=0
 Set the linear system matrix, combining the mechanical M,B,K matrices using the given coefficients.
virtual void setSystemRHVector (VecId v)=0
 Set the linear system right-hand term vector, from the values contained in the (Mechanical/Physical)State objects.
virtual void setSystemLHVector (VecId v)=0
 Set the initial estimate of the linear system left-hand term vector, from the values contained in the (Mechanical/Physical)State objects This vector will be replaced by the solution of the system once solveSystem is called.
virtual void solveSystem ()=0
 Solve the system as constructed using the previous methods.
virtual bool addMInvJt (defaulttype::BaseMatrix *, defaulttype::BaseMatrix *, double)
 Multiply the inverse of the system matrix by the transpose of the given matrix J.
virtual bool addJMInvJt (defaulttype::BaseMatrix *, defaulttype::BaseMatrix *, double)
 Multiply the inverse of the system matrix by the transpose of the given matrix, and multiply the result with the given matrix J.
virtual defaulttype::BaseMatrix * getSystemBaseMatrix ()
 Get the linear system matrix, or NULL if this solver does not build it.
virtual defaulttype::BaseVector * getSystemRHBaseVector ()
 Get the linear system right-hand term vector, or NULL if this solver does not build it.
virtual defaulttype::BaseVector * getSystemLHBaseVector ()
 Get the linear system left-hand term vector, or NULL if this solver does not build it.
virtual defaulttype::BaseMatrix * getSystemInverseBaseMatrix ()
 Get the linear system inverse matrix, or NULL if this solver does not build it.

Detailed Description

Abstract interface for linear system solvers.

Definition at line 51 of file LinearSolver.h.


Member Typedef Documentation


Constructor & Destructor Documentation

sofa::core::componentmodel::behavior::LinearSolver::LinearSolver (  ) 

Definition at line 41 of file LinearSolver.cpp.

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

Definition at line 44 of file LinearSolver.cpp.


Member Function Documentation

virtual bool sofa::core::componentmodel::behavior::LinearSolver::addJMInvJt ( defaulttype::BaseMatrix *  ,
defaulttype::BaseMatrix *  ,
double   
) [inline, virtual]

Multiply the inverse of the system matrix by the transpose of the given matrix, and multiply the result with the given matrix J.

Parameters:
result the variable where the result will be added
J the matrix J to use
Returns:
false if the solver does not support this operation, of it the system matrix is not invertible

Reimplemented in sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >, and sofa::component::linearsolver::LULinearSolver< Matrix, Vector >.

Definition at line 93 of file LinearSolver.h.

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

virtual bool sofa::core::componentmodel::behavior::LinearSolver::addMInvJt ( defaulttype::BaseMatrix *  ,
defaulttype::BaseMatrix *  ,
double   
) [inline, virtual]

Multiply the inverse of the system matrix by the transpose of the given matrix J.

Parameters:
result the variable where the result will be added
J the matrix J to use
Returns:
false if the solver does not support this operation, of it the system matrix is not invertible

Definition at line 83 of file LinearSolver.h.

virtual defaulttype::BaseMatrix* sofa::core::componentmodel::behavior::LinearSolver::getSystemBaseMatrix (  )  [inline, virtual]

virtual defaulttype::BaseMatrix* sofa::core::componentmodel::behavior::LinearSolver::getSystemInverseBaseMatrix (  )  [inline, virtual]

Get the linear system inverse matrix, or NULL if this solver does not build it.

Definition at line 108 of file LinearSolver.h.

virtual defaulttype::BaseVector* sofa::core::componentmodel::behavior::LinearSolver::getSystemLHBaseVector (  )  [inline, virtual]

virtual defaulttype::BaseVector* sofa::core::componentmodel::behavior::LinearSolver::getSystemRHBaseVector (  )  [inline, virtual]

virtual void sofa::core::componentmodel::behavior::LinearSolver::resetSystem (  )  [pure virtual]

virtual void sofa::core::componentmodel::behavior::LinearSolver::setSystemLHVector ( VecId  v  )  [pure virtual]

Set the initial estimate of the linear system left-hand term vector, from the values contained in the (Mechanical/Physical)State objects This vector will be replaced by the solution of the system once solveSystem is called.

Implemented in sofa::simulation::MatrixLinearSolver< Matrix, Vector >, sofa::simulation::MatrixLinearSolver< TMatrix, TVector >, sofa::simulation::MatrixLinearSolver< Matrix, Vector >, and sofa::simulation::MatrixLinearSolver< Matrix, Vector >.

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

virtual void sofa::core::componentmodel::behavior::LinearSolver::setSystemMBKMatrix ( double  mFact = 0.0,
double  bFact = 0.0,
double  kFact = 0.0 
) [pure virtual]

Set the linear system matrix, combining the mechanical M,B,K matrices using the given coefficients.

Todo:
Should we put this method in a specialized class for mechanical systems, or express it using more general terms (i.e. coefficients of the second order ODE to solve)

Implemented in sofa::simulation::MatrixLinearSolver< Matrix, Vector >, sofa::simulation::MatrixLinearSolver< TMatrix, TVector >, sofa::simulation::MatrixLinearSolver< Matrix, Vector >, and sofa::simulation::MatrixLinearSolver< Matrix, Vector >.

Referenced by sofa::simulation::OdeSolverImpl::m_setSystemMBKMatrix().

virtual void sofa::core::componentmodel::behavior::LinearSolver::setSystemRHVector ( VecId  v  )  [pure virtual]

virtual void sofa::core::componentmodel::behavior::LinearSolver::solveSystem (  )  [pure virtual]


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

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