SOFA plugin: SofaNewmat  master
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< bool > f_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 (linearalgebra::BaseMatrix *result, linearalgebra::BaseMatrix *J, double fact) override
 
- Public Member Functions inherited from sofa::component::linearsolver::MatrixLinearSolver< Matrix, Vector >
void resetSystem ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void resetSystem ()
 
void resizeSystem (Size n)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void resizeSystem (Size)
 
void setSystemMBKMatrix (const core::MechanicalParams *mparams)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void setSystemMBKMatrix (const core::MechanicalParams *mparams)
 
void rebuildSystem (SReal, SReal)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void rebuildSystem (SReal massFactor, SReal forceFactor)
 
void setSystemLHVector (core::MultiVecDerivId v)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void setSystemLHVector (core::MultiVecDerivId v)
 
void applySystemSolution ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void applySystemSolution ()
 
void applyConstraintForce (const sofa::core::ConstraintParams *, sofa::core::MultiVecDerivId, const linearalgebra::BaseVector *)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void applyConstraintForce (const sofa::core::ConstraintParams *, sofa::core::MultiVecDerivId, const linearalgebra::BaseVector *)
 
void computeResidual (const core::ExecParams *, linearalgebra::BaseVector *)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void computeResidual (const core::ExecParams *params, linearalgebra::BaseVector *f)
 
GraphScatteredVectorcreatePersistentVector ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API GraphScatteredVectorcreatePersistentVector ()
 
linearalgebra::BaseMatrixgetSystemBaseMatrix ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API linearalgebra::BaseMatrixgetSystemBaseMatrix ()
 
linearalgebra::BaseVectorgetSystemRHBaseVector ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API linearalgebra::BaseVectorgetSystemRHBaseVector ()
 
linearalgebra::BaseVectorgetSystemLHBaseVector ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API linearalgebra::BaseVectorgetSystemLHBaseVector ()
 
void checkLinearSystem ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void checkLinearSystem ()
 
bool addJMInvJtLocal (GraphScatteredMatrix *M, MatrixLinearSolver< GraphScatteredMatrix, GraphScatteredVector, NoThreadManager >::ResMatrixType *result, const MatrixLinearSolver< GraphScatteredMatrix, GraphScatteredVector, NoThreadManager >::JMatrixType *J, const SReal fact)
 

Protected Member Functions

 LULinearSolver ()
 
 ~LULinearSolver ()
 

Attribute details

◆ computedMinv

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

◆ f_verbose

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

Dump system state at each iteration.

◆ Minv

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

◆ solver

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

Constructor details

◆ LULinearSolver()

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

◆ ~LULinearSolver()

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

Function details

◆ addJMInvJt() [1/2]

template<class Matrix , class Vector >
bool sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::addJMInvJt ( linearalgebra::BaseMatrix result,
linearalgebra::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

◆ addJMInvJt() [2/2]

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

◆ computeMinv()

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

◆ getMinvElement()

template<class Matrix , class Vector >
double sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::getMinvElement ( int  i,
int  j 
)

◆ invert()

template<class Matrix , class Vector >
void sofa::component::linearsolver::LULinearSolver< Matrix, Vector >::invert ( Matrix &  M)
override

Invert M.

◆ SOFA_CLASS()

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)   
)

◆ solve()

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

Solve Mx=b.