SOFA API  b3f2f2a4
Open source framework for multi-physics simuation
sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector > Class Template Reference

#include <PrecomputedLinearSolver.h>

Linear system solver based on a precomputed inverse matrix. More...

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

Detailed Description

template<class TMatrix, class TVector>
class sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >

Linear system solver based on a precomputed inverse matrix.

Public Attributes

Data< booljmjt_twostep
 Use two step algorithm to compute JMinvJt. More...
 
Data< booluse_file
 Dump system matrix in a file. More...
 
Data< double > init_Tolerance
 
sofa::core::objectmodel::lifecycle::RemovedData f_verbose {this, "v23.12", "v24.06", "verbose", "This Data is no longer used"}
 

Protected Attributes

PrecomputedLinearSolverInternalData< TMatrix, TVector > internalData
 

Public Member Functions

 SOFA_CLASS (SOFA_TEMPLATE2(PrecomputedLinearSolver, TMatrix, TVector), SOFA_TEMPLATE2(sofa::component::linearsolver::MatrixLinearSolver, TMatrix, TVector))
 
 PrecomputedLinearSolver ()
 
void solve (TMatrix &M, TVector &x, TVector &b) override
 
void invert (TMatrix &M) override
 
void setSystemMBKMatrix (const core::MechanicalParams *mparams) override
 
void loadMatrix (TMatrix &M)
 
void loadMatrixWithCholeskyDecomposition (TMatrix &M)
 
bool addJMInvJt (linearalgebra::BaseMatrix *result, linearalgebra::BaseMatrix *J, SReal fact) override
 
TBaseMatrixgetSystemMatrixInv ()
 
void parse (core::objectmodel::BaseObjectDescription *arg) override
 
- Public Member Functions inherited from sofa::component::linearsolver::MatrixLinearSolver< TMatrix, TVector >
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)
 

Static Public Member Functions

static const std::string GetCustomTemplateName ()
 

Protected Member Functions

template<class JMatrix >
void ComputeResult (linearalgebra::BaseMatrix *result, JMatrix &J, SReal fact)
 
template<class JMatrix >
void computeActiveDofs (JMatrix &J)
 

Attribute details

◆ f_verbose

template<class TMatrix , class TVector >
sofa::core::objectmodel::lifecycle::RemovedData sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::f_verbose {this, "v23.12", "v24.06", "verbose", "This Data is no longer used"}

◆ init_Tolerance

template<class TMatrix , class TVector >
Data<double> sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::init_Tolerance

◆ internalData

template<class TMatrix , class TVector >
PrecomputedLinearSolverInternalData<TMatrix,TVector> sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::internalData
protected

◆ jmjt_twostep

template<class TMatrix , class TVector >
Data<bool> sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::jmjt_twostep

Use two step algorithm to compute JMinvJt.

◆ use_file

template<class TMatrix , class TVector >
Data<bool> sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::use_file

Dump system matrix in a file.

Constructor details

◆ PrecomputedLinearSolver()

template<class TMatrix , class TVector >
sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::PrecomputedLinearSolver

Function details

◆ addJMInvJt()

template<class TMatrix , class TVector >
bool sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::addJMInvJt ( linearalgebra::BaseMatrix result,
linearalgebra::BaseMatrix J,
SReal  fact 
)
override

◆ computeActiveDofs()

template<class TMatrix , class TVector >
template<class JMatrix >
void sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::computeActiveDofs ( JMatrix &  J)
protected

◆ ComputeResult()

template<class TMatrix , class TVector >
template<class JMatrix >
void sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::ComputeResult ( linearalgebra::BaseMatrix result,
JMatrix &  J,
SReal  fact 
)
protected

◆ GetCustomTemplateName()

template<class TMatrix , class TVector >
static const std::string sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::GetCustomTemplateName ( )
inlinestatic

Returns the sofa template name. By default the name of the c++ class signature is exposed... so we need to override that by implementing GetCustomTemplateName() function More details on the name customization infrastructure is in NameDecoder.h

◆ getSystemMatrixInv()

template<class TMatrix , class TVector >
TBaseMatrix* sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::getSystemMatrixInv ( )
inline

◆ invert()

template<class TMatrix , class TVector >
void sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::invert ( TMatrix &  M)
override

◆ loadMatrix()

template<class TMatrix , class TVector >
void sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::loadMatrix ( TMatrix &  M)

◆ loadMatrixWithCholeskyDecomposition()

template<class TMatrix , class TVector >
void sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::loadMatrixWithCholeskyDecomposition ( TMatrix &  M)

◆ parse()

template<class TMatrix , class TVector >
void sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::parse ( core::objectmodel::BaseObjectDescription arg)
override

◆ setSystemMBKMatrix()

template<class TMatrix , class TVector >
void sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::setSystemMBKMatrix ( const core::MechanicalParams mparams)
override

◆ SOFA_CLASS()

template<class TMatrix , class TVector >
sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::SOFA_CLASS ( SOFA_TEMPLATE2(PrecomputedLinearSolver< TMatrix, TVector >, TMatrix, TVector)  ,
SOFA_TEMPLATE2(sofa::component::linearsolver::MatrixLinearSolver, TMatrix, TVector)   
)

◆ solve()

template<class TMatrix , class TVector >
void sofa::component::linearsolver::direct::PrecomputedLinearSolver< TMatrix, TVector >::solve ( TMatrix &  M,
TVector &  x,
TVector &  b 
)
override