Repository navigation
Conversation
Contributor
|
I don't understand how the coupling terms were perceived by Claude in this PR. They are still missing with this PR right? |
The non-lumped mass matrix only stores vertex and edge masses. On hexahedra it
used rho*V * (1/20 per vertex, 1/40 per edge), whose element eigenvalues are
rho*V/40 * {5, 3, 1, -1}: the checkerboard mode has negative mass, so any
hexahedral MeshMatrixMass was indefinite (e.g. 42 negative eigenvalues out of
576 in TetrahedronHyperelasticityFEMForceField_invertedTets.scn). On quads,
rho*A * (1/8, 1/16) was singular (eigenvalues rho*A/16 * {4, 2, 2, 0}).
Start from the consistent mass matrices (trilinear hexa: rho*V/216 * (8, 4, 2, 1),
bilinear quad: rho*A/36 * (4, 2, 1)) and add the couplings that cannot be stored
(face and body diagonals, quad diagonals) to the vertex mass:
- hexa: rho*V/216 * (15 vertex, 4 edge), eigenvalues rho*V/216 * {27, 19, 11, 3}
- quad: rho*A/36 * (5 vertex, 2 edge), eigenvalues rho*A/36 * {9, 5, 5, 1}
Total mass and row sums (the lumped masses, also used for the weight) are
unchanged; the lumping coefficients are updated accordingly (27/15 and 9/5).
Re-enable MeshMatrixMass_test.cpp, which was dropped from the CMake list in
sums to totalMass and has the lumped masses as row sums, including after
topological changes.
fredroy
force-pushed
the
meshmatrixmass-hexa-quad-pd
branch
from
October 28, 2026 02:10
a135fa9 to
93aea83
Compare
Contributor
|
For the records, this PR fixes diffusion on hexas in #6431. Without it, it explodes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was 99.99% AI generated 🥴 as I am not really an expert on mass.
But I felt that it was quite serious to make the AI do it 🤖
But is will a good starting point for those who know
and I am a bit amazed that the references itselves stored a blow-up 🙃
The non-lumped mass matrix only stores vertex and edge masses. On hexahedra it used rhoV * (1/20 per vertex, 1/40 per edge), whose element eigenvalues are rhoV/40 * {5, 3, 1, -1}: the checkerboard mode has negative mass, so any hexahedral MeshMatrixMass was indefinite (e.g. 42 negative eigenvalues out of 576 in TetrahedronHyperelasticityFEMForceField_invertedTets.scn). On quads, rhoA * (1/8, 1/16) was singular (eigenvalues rhoA/16 * {4, 2, 2, 0}).
Start from the consistent mass matrices (trilinear hexa: rhoV/216 * (8, 4, 2, 1), bilinear quad: rhoA/36 * (4, 2, 1)) and add the couplings that cannot be stored (face and body diagonals, quad diagonals) to the vertex mass:
Re-enable MeshMatrixMass_test.cpp, which was dropped from the CMake list in #5920, and add tests checking that the assembled matrix is positive definite, sums to totalMass and has the lumped masses as row sums, including after topological changes.
Example scenes:
Mass spectrum:
Inverted-tets scene: it had 42 negative eigenvalues out of 576 (smallest −4.2e-4); it now has none (smallest +1.2e-4).Other hexahedral scenes: the remaining non-lumped ones were also indefinite on master and are now positive definite:TetrahedronHyperelasticityFEMForceField.scn,EulerExplicitIntegrationScheme.scn,MatrixLinearSystem.scnandrigidifiedSectionsInBeam.scn.Quad scene:
VisualMesh.scnwas singular and is now positive definite.Tetra and triangle scenes: unchanged.
Explicit scene:
EulerExplicitIntegrationScheme.scnblew up on master (displacement 524 at t=0.03 s). With the fix it falls freely as expected (0.0045, about ½gt²).Implicit scenes: trajectories change by less than 0.1%.
Regression references:
EulerExplicitIntegrationScheme.scn (3000 steps), whose stored reference is the blow-up.
[with-all-tests]
[NOPE-depends-on https://github.com/https://github.com/sofa-framework/Regression/pull/145]
(to fix when the new regression system is merged)
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