Repository navigation
Conversation
hugtalbot
self-requested a review
October 29, 2026 10:38
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.
The objective is to provide a diffusion feature to be used for any type of element. It made sense to derive the class
FEMForceField. This class is not tight to elasticity. However, it was developed with elasticity in mind and was not adapted to diffusion. For diffusion, we must make the difference between the field to integrate (temperature etc) and the spatial domain. For elasticity both are the same. It is already the case inMeshMatrixMasswhere there are two template parameters. So I used the same strategy: a new template parameter inFEMForceFieldclass (breaking).To use
FEMForceField, I had to add the dependency toSolidMechanics.FEM.ElasticinDiffusion. In the future, we can think about moving the base class, in order to break this dependency.The new diffusion force field gives the same result for the scene
examples/Component/Diffusion/TetrahedronDiffusionFEMForceField.scn. The legacy force field, specialized for tetras is faster as an optimization specific to linear simplicials is used. To stay generic, the optimization cannot be applied in the generic class introduced in this PR.Here are two videos of the introduced example. It shows similar results for both types of elements, hexas and tetras:
sofa_video_r60_0001.mp4
sofa_video_r60_0002.mp4
Questions:
Note:
Although the PR is not based on any other PR, the example requires the following PRs:
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