SOFA API  014b24ea
Open source framework for multi-physics simuation
sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes > Class Template Reference

#include <PrecomputedWarpPreconditioner.h>

Linear system solver based on a precomputed inverse matrix, wrapped by a per-node rotation matrix. More...

Inheritance diagram for sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >:

Detailed Description

template<class TDataTypes>
class sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >

Linear system solver based on a precomputed inverse matrix, wrapped by a per-node rotation matrix.

Public Attributes

Data< booljmjt_twostep
 Use two step algorithm to compute JMinvJt. More...
 
Data< boolf_verbose
 Dump system state at each iteration. More...
 
Data< booluse_file
 Dump system matrix in a file. More...
 
Data< boolshare_matrix
 Share the compliance matrix in memory if they are related to the same file (WARNING: might require to reload Sofa when opening a new scene...) More...
 
Data< std::string > solverName
 Name of the solver to use to precompute the first matrix. More...
 
Data< booluse_rotations
 Use Rotations around the preconditioner. More...
 
Data< doubledraw_rotations_scale
 Scale rotations in draw function. More...
 
MStatemstate
 

Protected Attributes

TVector R
 
TVector T
 
std::vector< boolisActiveDofs
 
PrecomputedWarpPreconditionerInternalData< TDataTypes > internalData
 
bool first
 
bool _rotate
 
bool usePrecond
 
double init_mFact
 
double init_bFact
 
double init_kFact
 
double dt
 
double factInt
 
unsigned systemSize
 
unsigned dof_on_node
 
unsigned nb_dofs
 
unsigned matrixSize
 

Public Member Functions

 SOFA_CLASS (SOFA_TEMPLATE(PrecomputedWarpPreconditioner, TDataTypes), SOFA_TEMPLATE2(sofa::component::linearsolver::MatrixLinearSolver, TMatrix, TVector))
 
void solve (TMatrix &M, TVector &x, TVector &b) override
 
void invert (TMatrix &M) override
 
void setSystemMBKMatrix (const core::MechanicalParams *mparams) override
 
bool addJMInvJt (defaulttype::BaseMatrix *result, defaulttype::BaseMatrix *J, double fact) override
 
void draw (const core::visual::VisualParams *vparams) override
 
void init () override
 
void loadMatrix (TMatrix &M)
 
bool hasUpdatedMatrix () override
 
TBaseMatrixgetSystemMatrixInv ()
 

Static Public Member Functions

template<class T >
static bool canCreate (T *&obj, core::objectmodel::BaseContext *context, core::objectmodel::BaseObjectDescription *arg)
 

Protected Member Functions

 PrecomputedWarpPreconditioner ()
 
void rotateConstraints ()
 
void loadMatrixWithCSparse (TMatrix &M)
 
void loadMatrixWithSolver ()
 
template<class JMatrix >
void ComputeResult (defaulttype::BaseMatrix *result, JMatrix &J, float fact)
 
template<class JMatrix >
void computeActiveDofs (JMatrix &J)
 

Attribute details

template<class TDataTypes >
bool sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::_rotate
protected
template<class TDataTypes >
unsigned sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::dof_on_node
protected
template<class TDataTypes >
Data<double> sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::draw_rotations_scale

Scale rotations in draw function.

template<class TDataTypes >
double sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::dt
protected
template<class TDataTypes >
Data<bool> sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::f_verbose

Dump system state at each iteration.

template<class TDataTypes >
double sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::factInt
protected
template<class TDataTypes >
bool sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::first
protected
template<class TDataTypes >
double sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::init_bFact
protected
template<class TDataTypes >
double sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::init_kFact
protected
template<class TDataTypes >
double sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::init_mFact
protected
template<class TDataTypes >
PrecomputedWarpPreconditionerInternalData<TDataTypes> sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::internalData
protected
template<class TDataTypes >
std::vector<bool> sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::isActiveDofs
protected
template<class TDataTypes >
Data<bool> sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::jmjt_twostep

Use two step algorithm to compute JMinvJt.

template<class TDataTypes >
unsigned sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::matrixSize
protected
template<class TDataTypes >
MState* sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::mstate
template<class TDataTypes >
unsigned sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::nb_dofs
protected
template<class TDataTypes >
TVector sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::R
protected
template<class TDataTypes >
Data<bool> sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::share_matrix

Share the compliance matrix in memory if they are related to the same file (WARNING: might require to reload Sofa when opening a new scene...)

template<class TDataTypes >
Data<std::string> sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::solverName

Name of the solver to use to precompute the first matrix.

template<class TDataTypes >
unsigned sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::systemSize
protected
template<class TDataTypes >
TVector sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::T
protected
template<class TDataTypes >
Data<bool> sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::use_file

Dump system matrix in a file.

template<class TDataTypes >
Data<bool> sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::use_rotations

Use Rotations around the preconditioner.

template<class TDataTypes >
bool sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::usePrecond
protected

Constructor details

template<class TDataTypes >
sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::PrecomputedWarpPreconditioner ( )
protected

Function details

template<class TDataTypes >
bool sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::addJMInvJt ( defaulttype::BaseMatrix result,
defaulttype::BaseMatrix J,
double  fact 
)
override
template<class TDataTypes >
template<class T >
static bool sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::canCreate ( T *&  obj,
core::objectmodel::BaseContext context,
core::objectmodel::BaseObjectDescription arg 
)
inlinestatic

Pre-construction check method called by ObjectFactory. Check that DataTypes matches the MechanicalState.

template<class TDataTypes >
template<class JMatrix >
void sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::computeActiveDofs ( JMatrix &  J)
protected
template<class TDataTypes >
template<class JMatrix >
void sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::ComputeResult ( defaulttype::BaseMatrix result,
JMatrix &  J,
float  fact 
)
protected
template<class TDataTypes >
void sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::draw ( const core::visual::VisualParams vparams)
override
template<class TDataTypes >
TBaseMatrix* sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::getSystemMatrixInv ( )
inline
template<class TDataTypes >
bool sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::hasUpdatedMatrix ( )
inlineoverride
template<class TDataTypes >
void sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::init ( )
override
template<class TDataTypes >
void sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::invert ( TMatrix M)
override
template<class TDataTypes >
void sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::loadMatrix ( TMatrix M)
template<class TDataTypes >
void sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::loadMatrixWithCSparse ( TMatrix M)
protected
template<class TDataTypes >
void sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::loadMatrixWithSolver ( )
protected
template<class TDataTypes >
void sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::rotateConstraints ( )
protected
template<class TDataTypes >
void sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::setSystemMBKMatrix ( const core::MechanicalParams mparams)
override
template<class TDataTypes >
sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::SOFA_CLASS ( SOFA_TEMPLATE(PrecomputedWarpPreconditioner< TDataTypes >, TDataTypes)  ,
SOFA_TEMPLATE2(sofa::component::linearsolver::MatrixLinearSolver, TMatrix, TVector  
)
template<class TDataTypes >
void sofa::component::linearsolver::PrecomputedWarpPreconditioner< TDataTypes >::solve ( TMatrix M,
TVector x,
TVector b 
)
override