Skip to content

[Simulation] Mapping graph: restrict construction of edges between groups and mappings - #6260

Open
alxbilger wants to merge 1 commit into
sofa-framework:masterfrom
alxbilger:fixmappinggroupedge
Open

[Simulation] Mapping graph: restrict construction of edges between groups and mappings#6260
alxbilger wants to merge 1 commit into
sofa-framework:masterfrom
alxbilger:fixmappinggroupedge

Conversation

@alxbilger

@alxbilger alxbilger commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a crash in examples/Component/LinearSystem/MatrixLinearSystem.scn.

image

This is complex scene showcasing the correct behavior of mappings in the matrix assembly.

This is the path to locate the bug:

  1. The solver crashes because of a bad CSR matrix construction (which leads me to think that we don't have enough tools to analyze those matrices, and that this data structure is still fragile).
    ⬇️
  2. The matrix is not well constructed because of bad matrix projections (MatrixProjectionMethod.inl).
    ⬇️
  3. The matrices are not well projected because mappingGraph.getTopMostMechanicalStates gives wrong inputs. For example, in the scene, it adds an unrelated input to red/FEM/DOFs. The unrelated input still contributes to the matrix, potentially to wrong locations.
    ⬇️
  4. The wrong inputs are due to a wrong construction of the mapping graph. In the following screenshot, we can observe that the RigidMapping is a child of a group node, itself a child of the blue DoFs (which is unrelated to the mapping).
image

The fix:
Mappings must be child of a group only if all the mapping inputs are all equal to the group's states. Previously, only one common state was enough.

After the fix:

image

The rigid mapping is no longer related to the blue DoFs.

This fix replaces #6222 and #6256

[with-all-tests]


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@alxbilger

Copy link
Copy Markdown
Contributor Author

[ci-build][with-all-tests]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant