SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::component::linearsolver::LULinearSolver< Matrix, Vector > Class Template Reference

#include <LULinearSolver.h>

Linear system solver using the default (LU factorization) algorithm. More...

Inheritance diagram for sofa::component::linearsolver::LULinearSolver< Matrix, Vector >:

Detailed Description

template<class Matrix, class Vector>
class sofa::component::linearsolver::LULinearSolver< Matrix, Vector >

Linear system solver using the default (LU factorization) algorithm.

Public Attributes

Data< boolf_verbose
 Dump system state at each iteration. More...
 
Matrix::LUSolver * solver
 
Matrix::InvMatrixType Minv
 
bool computedMinv
 

Public Member Functions

 SOFA_CLASS (SOFA_TEMPLATE2(LULinearSolver, Matrix, Vector), SOFA_TEMPLATE2(sofa::component::linearsolver::MatrixLinearSolver, Matrix, Vector))
 
void invert (Matrix &M) override
 Invert M. More...
 
void solve (Matrix &M, Vector &x, Vector &b) override
 Solve Mx=b. More...
 
void computeMinv ()
 
double getMinvElement (int i, int j)
 
template<class RMatrix , class JMatrix >
bool addJMInvJt (RMatrix &result, JMatrix &J, double fact)
 
bool addJMInvJt (defaulttype::BaseMatrix *result, defaulttype::BaseMatrix *J, double fact) override
 

Protected Member Functions

 LULinearSolver ()
 
 ~LULinearSolver ()
 

Attribute details

template<class Matrix , class Vector >
bool sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::computedMinv
template<class Matrix , class Vector >
Data<bool> sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::f_verbose

Dump system state at each iteration.

template<class Matrix , class Vector >
Matrix::InvMatrixType sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::Minv
template<class Matrix , class Vector >
Matrix::LUSolver* sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::solver

Constructor details

template<class Matrix , class Vector >
sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::LULinearSolver ( )
protected
template<class Matrix , class Vector >
sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::~LULinearSolver ( )
protected

Function details

template<class Matrix , class Vector >
template<class RMatrix , class JMatrix >
bool sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::addJMInvJt ( RMatrix &  result,
JMatrix &  J,
double  fact 
)
template<class Matrix , class Vector >
bool sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::addJMInvJt ( defaulttype::BaseMatrix result,
defaulttype::BaseMatrix J,
double  fact 
)
override

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

Parameters
resultthe variable where the result will be added
Jthe matrix J to use
Returns
false if the solver does not support this operation, of it the system matrix is not invertible
template<class Matrix , class Vector >
void sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::computeMinv ( )
template<class Matrix , class Vector >
double sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::getMinvElement ( int  i,
int  j 
)
template<class Matrix , class Vector >
void sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::invert ( Matrix &  M)
override

Invert M.

template<class Matrix , class Vector >
sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::SOFA_CLASS ( SOFA_TEMPLATE2(LULinearSolver< Matrix, Vector >, Matrix, Vector)  ,
SOFA_TEMPLATE2(sofa::component::linearsolver::MatrixLinearSolver, Matrix, Vector)   
)
template<class Matrix , class Vector >
void sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::solve ( Matrix &  M,
Vector &  x,
Vector &  b 
)
override

Solve Mx=b.