SofaDefrost / SofaGym

Machine Learning framework for Sofa
69 stars 10 forks source link

Error on linearSolver #10

Closed hunoutl closed 1 year ago

hunoutl commented 1 year ago

With Sofa v22.12, I got on almost all envs an error : [ERROR] [LinearSolverConstraintCorrection(GCS)] Can not use the solver linearSolver because it is templated on GraphScatteredType

Some idea ?

I got some warnings too :

[WARNING]` [ShewchukPCGLinearSolver(linearSolver)] String data "preconditioners" is now replaced by explicit data link: "preconditioner" (PR #3155)
[SUGGESTION] [SparseLDLSolver(precond)] Template is empty
By default SparseLDLSolver uses blocks with a single scalar (to handle all cases of simulations).
If you are using only 3D DOFs, you may consider using blocks of Matrix3 to speedup the calculations.
If it is the case, add template="CompressedRowSparseMatrixMat3x3d" to this object in your scene
Otherwise, if you want to disable this message, add template="CompressedRowSparseMatrixd" .
[WARNING] [LinearSolverConstraintCorrection(GCS)] String data "solverName" is now replaced by explicit data link: "linearSolver" (PR #3152)
[WARNING] [ShewchukPCGLinearSolver(linearSolver)] String data "preconditioners" is now replaced by explicit data link: "preconditioner" (PR #3155)
[SUGGESTION] [SparseLDLSolver(precond)] Template is empty
By default SparseLDLSolver uses blocks with a single scalar (to handle all cases of simulations).
If you are using only 3D DOFs, you may consider using blocks of Matrix3 to speedup the calculations.
If it is the case, add template="CompressedRowSparseMatrixMat3x3d" to this object in your scene
Otherwise, if you want to disable this message, add template="CompressedRowSparseMatrixd" .
[WARNING] [LinearSolverConstraintCorrection(GCS)] String data "solverName" is now replaced by explicit data link: "linearSolver" (PR #3152)
[SUGGESTION] [SparseLDLSolver(solver)] Template is empty
By default SparseLDLSolver uses blocks with a single scalar (to handle all cases of simulations).
If you are using only 3D DOFs, you may consider using blocks of Matrix3 to speedup the calculations.
If it is the case, add template="CompressedRowSparseMatrixMat3x3d" to this object in your scene
Otherwise, if you want to disable this message, add template="CompressedRowSparseMatrixd" .
[WARNING] [GenericConstraintCorrection(unnamed)] String data "solverName" is now replaced by explicit data link: "linearSolver" (PR #3152)

For the rest there does not seem to be any others breaks.

alxbilger commented 1 year ago

Error

The error was introduced in https://github.com/sofa-framework/sofa/pull/3055 It forbids the use of an iterative non-assembled linear solver in a constraint solver. It requires that you change the linear solver, e.g. from ShewchukPCGLinearSolver to EigenSimplicialLDLT (in that case the second solver SparseLDLSolver (precond) is no longer required). Maybe @EtienneMenager or @p-shg can tell why they chose a non-assembled linear solver ?

Warnings

[WARNING]` [ShewchukPCGLinearSolver(linearSolver)] String data "preconditioners" is now replaced by explicit data link: "preconditioner" (PR #3155)

You should replace preconditioner="solverName", by preconditioner="@solverName"

[SUGGESTION] [SparseLDLSolver(precond)] Template is empty By default SparseLDLSolver uses blocks with a single scalar (to handle all cases of simulations). If you are using only 3D DOFs, you may consider using blocks of Matrix3 to speedup the calculations. If it is the case, add template="CompressedRowSparseMatrixMat3x3d" to this object in your scene Otherwise, if you want to disable this message, add template="CompressedRowSparseMatrixd" .

It forces you to chose the type of matrix you will manipulate in the linear solver. You have to choose between CompressedRowSparseMatrixd and CompressedRowSparseMatrixMat3x3d. CompressedRowSparseMatrixMat3x3d is when you have only 3D DoFs in the scene. If you have rigids, you need to select CompressedRowSparseMatrixd

[WARNING] [LinearSolverConstraintCorrection(GCS)] String data "solverName" is now replaced by explicit data link: "linearSolver" (PR #3152)

You should replace solverName="solverName", by solverName="@solverName"

EtienneMenager commented 1 year ago

Hi,

No special reason. I think we took a scene that worked and duplicated it to create the other scenes. There is no problem about changing the solver!

hunoutl commented 1 year ago

Thank you for your answers, it is probably the right way, I have no more errors on the test I did. I'm going to do a first pass on the envs to get them to work. I will try to choose the right solvers for each scene.

alxbilger commented 1 year ago

Can this issue be closed?