Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect solver detection in HexahedronCompositeFEMMapping #5151

Open
ScheiklP opened this issue Dec 6, 2024 · 2 comments
Open

Incorrect solver detection in HexahedronCompositeFEMMapping #5151

ScheiklP opened this issue Dec 6, 2024 · 2 comments
Labels
issue: bug (minor) Bug affecting only some users or with no major impact on the framework

Comments

@ScheiklP
Copy link
Contributor

ScheiklP commented Dec 6, 2024

Hi all,
HexahedronCompositeFEMMapping prints a warning, that the node is using an incorrect solver, even with a direct solver.

[WARNING] [HexahedronCompositeFEMMapping(HexahedronCompositeFEMMapping1)] This object only support Direct Solving but an Indirect Solver in the scene is c
 not implemented. This will produce un-expected behavior.

In the component example, no matter if you use the direct or indirect solver, the same warning is printed.

https://github.com/sofa-framework/sofa/blob/master/examples/Component/SolidMechanics/FEM/HexahedronCompositeFEMForceFieldAndMass.scn#L38

The warning comes from here, but I do not know enough about the solvers to understand the two variants of applyJT.

https://github.com/sofa-framework/sofa/blob/master/Sofa/Component/SolidMechanics/FEM/NonUniform/src/sofa/component/solidmechanics/fem/nonuniform/HexahedronCompositeFEMMapping.h#L103-L106

   void applyJT( const sofa::core::ConstraintParams* /*cparams*/, InDataMatrixDeriv& /*out*/, const OutDataMatrixDeriv& /*in*/) override
   {
       msg_warning() << "This object only support Direct Solving but an Indirect Solver in the scene is calling method applyJT(constraint) which is not implemented. This will produce un-expected behavior.";
   }

Best,
Paul

@ScheiklP ScheiklP added the issue: bug (minor) Bug affecting only some users or with no major impact on the framework label Dec 6, 2024
@alxbilger
Copy link
Contributor

I am not sure the message is appropriate. I agree with you that it is not related to the solver. This method is used to project the constraint matrix from a subNode to its parent. If you have constraints in a subNode, it won't work.

The code of this mapping has poor quality. I refresh would be beneficial. But I don't know what it does...

@bakpaul
Copy link
Contributor

bakpaul commented Dec 9, 2024

Given the author of the component I would guess that it works... This line has certainly be added through a big refactoring, it is indeed misleading.

From what I understood the mapping is kind of the equivalent to a barycentric mapping but for Hexahedron. I know that it is more difficult to compute them because it is an under constrained problem, there exists an infinit number of way to express a coordinate in term of the 8 points... This does it properly.

Anyway it is quite old, and has a lot of commented code, so while I believe the guy who wrote it knew what he was doing, I cannot say the same about all the cleaning/refactoring done throughout the 16 year after that... To be used with caution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug (minor) Bug affecting only some users or with no major impact on the framework
Projects
None yet
Development

No branches or pull requests

3 participants