SOFA API  1df67014
Open source framework for multi-physics simuation
sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager > Class Template Reference

#include <SparseLDLSolverImpl.h>

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

Protected Attributes

Data< boold_precomputeSymbolicDecomposition
 If true the solver will reuse the precomputed symbolic decomposition. Otherwise it will recompute it at each step. More...
 
core::objectmodel::lifecycle::DeprecatedData d_applyPermutation {this, "v24.06", "v24.12", "applyPermutation", "Ordering method is now defined using ordering components"}
 
Data< int > d_L_nnz
 Number of non-zero values in the lower triangular matrix of the factorization. The lower, the faster the system is solved. More...
 
type::vector< RealTmp
 
type::vector< RealY
 
type::vector< int > Lnz
 
type::vector< int > Flag
 
type::vector< int > Pattern
 
type::vector< int > tran_countvec
 

Public Member Functions

 SOFA_CLASS (SOFA_TEMPLATE3(SparseLDLSolverImpl, TMatrix, TVector, TThreadManager),)
 
- Public Member Functions inherited from sofa::component::linearsolver::ordering::OrderingMethodAccessor< sofa::component::linearsolver::MatrixLinearSolver< TMatrix, TVector, TThreadManager > >
 SOFA_CLASS (OrderingMethodAccessor, sofa::component::linearsolver::MatrixLinearSolver< TMatrix, TVector, TThreadManager >)
 
 OrderingMethodAccessor ()
 
 ~OrderingMethodAccessor () override=default
 
void init () override
 
void parse (sofa::core::objectmodel::BaseObjectDescription *arg) override
 
- Public Member Functions inherited from sofa::component::linearsolver::MatrixLinearSolver< Matrix, Vector, ThreadManager >
void resetSystem ()
 
void resizeSystem (Size n)
 
void setSystemMBKMatrix (const core::MechanicalParams *mparams)
 
void rebuildSystem (SReal, SReal)
 
void setSystemLHVector (core::MultiVecDerivId v)
 
void applySystemSolution ()
 
void applyConstraintForce (const sofa::core::ConstraintParams *, sofa::core::MultiVecDerivId, const linearalgebra::BaseVector *)
 
void computeResidual (const core::ExecParams *, linearalgebra::BaseVector *)
 
GraphScatteredVectorcreatePersistentVector ()
 
linearalgebra::BaseMatrixgetSystemBaseMatrix ()
 
linearalgebra::BaseVectorgetSystemRHBaseVector ()
 
linearalgebra::BaseVectorgetSystemLHBaseVector ()
 
void checkLinearSystem ()
 
bool addJMInvJtLocal (GraphScatteredMatrix *M, MatrixLinearSolver< GraphScatteredMatrix, GraphScatteredVector, NoThreadManager >::ResMatrixType *result, const MatrixLinearSolver< GraphScatteredMatrix, GraphScatteredVector, NoThreadManager >::JMatrixType *J, const SReal fact)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void resetSystem ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void resizeSystem (Size)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void setSystemMBKMatrix (const core::MechanicalParams *mparams)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void rebuildSystem (SReal massFactor, SReal forceFactor)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void setSystemLHVector (core::MultiVecDerivId v)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void applySystemSolution ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API GraphScatteredVectorcreatePersistentVector ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API linearalgebra::BaseMatrixgetSystemBaseMatrix ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API linearalgebra::BaseVectorgetSystemRHBaseVector ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API linearalgebra::BaseVectorgetSystemLHBaseVector ()
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void applyConstraintForce (const sofa::core::ConstraintParams *, sofa::core::MultiVecDerivId, const linearalgebra::BaseVector *)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void computeResidual (const core::ExecParams *params, linearalgebra::BaseVector *f)
 
SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void checkLinearSystem ()
 

Protected Member Functions

 SparseLDLSolverImpl ()
 
template<class VecInt , class VecReal >
void solve_cpu (Real *x, const Real *b, SparseLDLImplInvertData< VecInt, VecReal > *data)
 
void LDL_ordering (int n, int nnz, int *M_colptr, int *M_rowind, Real *M_values, 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)
 

Additional Inherited Members

- Public Attributes inherited from sofa::component::linearsolver::ordering::OrderingMethodAccessor< sofa::component::linearsolver::MatrixLinearSolver< TMatrix, TVector, TThreadManager > >
SingleLink< OrderingMethodAccessor, core::behavior::BaseOrderingMethod, BaseLink::FLAG_STRONGLINK > l_orderingMethod
 

Attribute details

◆ d_applyPermutation

template<class TMatrix , class TVector , class TThreadManager >
core::objectmodel::lifecycle::DeprecatedData sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::d_applyPermutation {this, "v24.06", "v24.12", "applyPermutation", "Ordering method is now defined using ordering components"}
protected

◆ d_L_nnz

template<class TMatrix , class TVector , class TThreadManager >
Data<int> sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::d_L_nnz
protected

Number of non-zero values in the lower triangular matrix of the factorization. The lower, the faster the system is solved.

◆ d_precomputeSymbolicDecomposition

template<class TMatrix , class TVector , class TThreadManager >
Data<bool> sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::d_precomputeSymbolicDecomposition
protected

If true the solver will reuse the precomputed symbolic decomposition. Otherwise it will recompute it at each step.

◆ Flag

template<class TMatrix , class TVector , class TThreadManager >
type::vector<int> sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::Flag
protected

◆ Lnz

template<class TMatrix , class TVector , class TThreadManager >
type::vector<int> sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::Lnz
protected

◆ Pattern

template<class TMatrix , class TVector , class TThreadManager >
type::vector<int> sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::Pattern
protected

◆ Tmp

template<class TMatrix , class TVector , class TThreadManager >
type::vector<Real> sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::Tmp
protected

◆ tran_countvec

template<class TMatrix , class TVector , class TThreadManager >
type::vector<int> sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::tran_countvec
protected

◆ Y

template<class TMatrix , class TVector , class TThreadManager >
type::vector<Real> sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::Y
protected

Constructor details

◆ SparseLDLSolverImpl()

template<class TMatrix , class TVector , class TThreadManager >
sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::SparseLDLSolverImpl ( )
inlineprotected

Function details

◆ factorize()

template<class TMatrix , class TVector , class TThreadManager >
template<class VecInt , class VecReal >
void sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::factorize ( int  n,
int *  M_colptr,
int *  M_rowind,
Real M_values,
SparseLDLImplInvertData< VecInt, VecReal > *  data 
)
inlineprotected

◆ LDL_numeric()

template<class TMatrix , class TVector , class TThreadManager >
void sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::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 
)
inlineprotected

◆ LDL_ordering()

template<class TMatrix , class TVector , class TThreadManager >
void sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::LDL_ordering ( int  n,
int  nnz,
int *  M_colptr,
int *  M_rowind,
Real M_values,
int *  perm,
int *  invperm 
)
inlineprotected

◆ LDL_symbolic()

template<class TMatrix , class TVector , class TThreadManager >
void sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::LDL_symbolic ( int  n,
int *  M_colptr,
int *  M_rowind,
int *  colptr,
int *  perm,
int *  invperm,
int *  Parent 
)
inlineprotected

◆ SOFA_CLASS()

template<class TMatrix , class TVector , class TThreadManager >
sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::SOFA_CLASS ( SOFA_TEMPLATE3(SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >, TMatrix, TVector, TThreadManager)  )

◆ solve_cpu()

template<class TMatrix , class TVector , class TThreadManager >
template<class VecInt , class VecReal >
void sofa::component::linearsolver::direct::SparseLDLSolverImpl< TMatrix, TVector, TThreadManager >::solve_cpu ( Real x,
const Real b,
SparseLDLImplInvertData< VecInt, VecReal > *  data 
)
inlineprotected