Skip to content

SparseLDLSolver

This component belongs to the category of LinearSolver. The role of the SparseLDLSolver is to solve the linear system assuming that the matrix is symmetric and sparse.

To do so, the SparseLDLSolver relies on the method of LDL decomposition. The system matrix will be decomposed , where is a lower triangular matrix and is a diagonal matrix. This decomposition is an extension of the Cholesky decomposition which reduces its numerical inaccuracy.

As a direct solver, the SparseLDLSolver computes at each simulation time step an exact solution as follows:

Using a block forward substitution, we successively solve two triangular systems. Between those two resolutions, we need to inverse , which is trivial as it is a diagonal matrix that has no null value on its diagonal.

It is important to note that this decomposition considers that the system matrix is symmetric. Sequence diagram ---------------- Data ---- There are two boolean Data to change the behavior of this solver: - **useSymbolicDecomposition**: by default useSymbolicDecomposition is set to true. The solver will use a symbolic decomposition, meaning that it will store the shape of on the first step, or when its shape changes, and then it will only update its coefficients. When the shape of the matrix changes, a new factorization is computed. By setting this data to false, the solver will compute the entire decomposition at each step. - **applyPermutation**: by default it is set to true. It will apply fill reducing permutation on the rows and the columns of in order to minimize the number of non null values in . Instead of solving , we will solve . Moreover, is symmetric, so we will use the same permutation on the rows and on the columns with . We will factorize and then we will solve
As the impact of the use of fill reducing permutations on the performances is highly influenced by the repartition of the nodes used to model an object, we advise the users to test which type of permutation is the best suited for their simulations. Usage ----- The SparseLDLSolver **requires** the use (above in the scene graph) of an integration scheme, and (below in the scene graph) of a MechanicalObject storing the state information that the SparseLDLSolver will access. As a direct solver, the SparseLDLSolver might be extremely time consuming for large system. However, it will always give you an exact solution, **making the assumption that the system matrix is symmetric**. Example ------- This component is used as follows in XML format:
<SparseLDLSolver  />
or using SofaPython3:
node.addObject('SparseLDLSolver')
An example scene involving a SparseLDLSolver is available in [*examples/Component/LinearSolver/Direct/FEMBAR_SparseLDLSolver.scn*](https://github.com/sofa-framework/sofa/blob/master/examples/Component/LinearSolver/Direct/FEMBAR_SparseLDLSolver.scn) __Target__: `Sofa.Component.LinearSolver.Direct` __namespace__: `#!c++ sofa::component::linearsolver::direct` __parents__: - `#!c++ SparseLDLSolverImpl` Data:
Name Description Default value
name object name unnamed
printLog if true, emits extra messages at runtime. 0
tags list of the subsets the objet belongs to
bbox this object bounding box
componentState The state of the component among (Dirty, Valid, Undefined, Loading, Invalid). Undefined
listening if true, handle the events, otherwise ignore the events 0
parallelInverseProduct Parallelize the computation of the product J*M^{-1}*J^T where M is the matrix of the linear system and J is any matrix with compatible dimensions 0
precomputeSymbolicDecomposition If true the solver will reuse the precomputed symbolic decomposition. Otherwise it will recompute it at each step. 1
L_nnz Number of non-zero values in the lower triangular matrix of the factorization. The lower, the faster the system is solved. 0
Links: | Name | Description | | ---- | ----------- | |context|Graph Node containing this object (or BaseContext::getDefault() if no graph is used)| |slaves|Sub-objects used internally by this object| |master|nullptr for regular objects, or master object for which this object is one sub-objects| |linearSystem|The linear system to solve| |orderingMethod|Ordering method used by this component|