SOFA API  73d8bb95
Open source framework for multi-physics simuation
sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager > Class Template Reference

#include <SparseLDLSolver.h>

Direct linear solver based on Sparse LDL^T factorization, implemented with the CSPARSE library. More...

Inheritance diagram for sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >:

Detailed Description

template<class TMatrix, class TVector, class TThreadManager = NoThreadManager>
class sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >

Direct linear solver based on Sparse LDL^T factorization, implemented with the CSPARSE library.

Public Attributes

int numStep
 
Data< boolf_saveMatrixToFile
 save matrix to a text file (can be very slow, as full matrix is stored) More...
 
sofa::core::objectmodel::DataFileName d_filename
 file where this matrix will be saved More...
 
Data< intd_precision
 number of digits used to save system's matrix, default is 6 More...
 

Protected Attributes

FullMatrix< RealJminv
 
FullMatrix< RealJdense
 
sofa::component::linearsolver::CompressedRowSparseMatrix< RealMfiltered
 
- Protected Attributes inherited from sofa::component::linearsolver::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >
helper::vector< RealTmp
 
helper::vector< intxadj
 
helper::vector< intadj
 
helper::vector< intt_xadj
 
helper::vector< intt_adj
 
helper::vector< RealY
 
helper::vector< intLnz
 
helper::vector< intFlag
 
helper::vector< intPattern
 
helper::vector< inttran_countvec
 

Public Member Functions

 SOFA_CLASS (SOFA_TEMPLATE3(SparseLDLSolver, TMatrix, TVector, TThreadManager), SOFA_TEMPLATE3(sofa::component::linearsolver::SparseLDLSolverImpl, TMatrix, TVector, TThreadManager))
 
void solve (Matrix &M, Vector &x, Vector &b) override
 
void invert (Matrix &M) override
 
bool addJMInvJtLocal (TMatrix *M, ResMatrixType *result, const JMatrixType *J, double fact) override
 Default implementation of Multiply the inverse of the system matrix by the transpose of the given matrix, and multiply the result with the given matrix J. More...
 
MatrixInvertDatacreateInvertData () override
 
- Public Member Functions inherited from sofa::component::linearsolver::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >
 SOFA_CLASS (SOFA_TEMPLATE3(SparseLDLSolverImpl, TMatrix, TVector, TThreadManager), SOFA_TEMPLATE3(sofa::component::linearsolver::MatrixLinearSolver, TMatrix, TVector, TThreadManager))
 

Protected Member Functions

 SparseLDLSolver ()
 
- Protected Member Functions inherited from sofa::component::linearsolver::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >
 SparseLDLSolverImpl ()
 
template<class VecInt , class VecReal >
void solve_cpu (Real *x, const Real *b, SparseLDLImplInvertData< VecInt, VecReal > *data)
 
void LDL_ordering (int n, int *M_colptr, int *M_rowind, int *perm, int *invperm)
 
void LDL_symbolic (int n, int *M_colptr, int *M_rowind, int *colptr, int *perm, int *invperm, int *Parent)
 
void LDL_numeric (int n, int *M_colptr, int *M_rowind, Real *M_values, int *colptr, int *rowind, Real *values, Real *D, int *perm, int *invperm, int *Parent)
 
template<class VecInt , class VecReal >
void factorize (int n, int *M_colptr, int *M_rowind, Real *M_values, SparseLDLImplInvertData< VecInt, VecReal > *data)
 

Attribute details

template<class TMatrix , class TVector , class TThreadManager = NoThreadManager>
sofa::core::objectmodel::DataFileName sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::d_filename

file where this matrix will be saved

template<class TMatrix , class TVector , class TThreadManager = NoThreadManager>
Data<int> sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::d_precision

number of digits used to save system's matrix, default is 6

template<class TMatrix , class TVector , class TThreadManager = NoThreadManager>
Data<bool> sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::f_saveMatrixToFile

save matrix to a text file (can be very slow, as full matrix is stored)

template<class TMatrix , class TVector , class TThreadManager = NoThreadManager>
FullMatrix<Real> sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::Jdense
protected
template<class TMatrix , class TVector , class TThreadManager = NoThreadManager>
FullMatrix<Real> sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::Jminv
protected
template<class TMatrix , class TVector , class TThreadManager = NoThreadManager>
sofa::component::linearsolver::CompressedRowSparseMatrix<Real> sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::Mfiltered
protected
template<class TMatrix , class TVector , class TThreadManager = NoThreadManager>
int sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::numStep

Constructor details

template<class TMatrix , class TVector , class TThreadManager >
sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::SparseLDLSolver ( )
protected

Function details

template<class TMatrix , class TVector , class TThreadManager >
bool sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::addJMInvJtLocal ( TMatrix *  M,
ResMatrixType result,
const JMatrixType J,
double  fact 
)
override

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

template<class TMatrix , class TVector , class TThreadManager = NoThreadManager>
MatrixInvertData* sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::createInvertData ( )
inlineoverride
template<class TMatrix , class TVector , class TThreadManager >
void sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::invert ( Matrix M)
override
template<class TMatrix , class TVector , class TThreadManager = NoThreadManager>
sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::SOFA_CLASS ( SOFA_TEMPLATE3(SparseLDLSolver< TMatrix, TVector, TThreadManager >, TMatrix, TVector, TThreadManager)  ,
SOFA_TEMPLATE3(sofa::component::linearsolver::SparseLDLSolverImpl, TMatrix, TVector, TThreadManager)   
)
template<class TMatrix , class TVector , class TThreadManager >
void sofa::component::linearsolver::SparseLDLSolver< TMatrix, TVector, TThreadManager >::solve ( Matrix M,
Vector x,
Vector b 
)
override