Skip to content

[FEM] Add component for source term integration based on new FEM framework - constant source terms - #6196

Open
th-skam wants to merge 37 commits into
sofa-framework:masterfrom
th-skam:sourceTerm
Open

th-skam wants to merge 37 commits into
sofa-framework:masterfrom
th-skam:sourceTerm

Conversation

@th-skam

@th-skam th-skam commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

PR Based on #6225

The PR adds component with which to integrate source terms using the FEM framework ported from Elasticity.

There is a central FEMSourceTermIntegrator component placed in the scene responsible for gathering all source terms present, and integrating them into loads. Added examples demonstrate this.

I added 3 distinct classes that can implement the following loads:

The type of the term Formula User input
Pressure $L_p = \int_{S} \vec{v} \cdot (-p \vec{n}) dS$ The pressure $p$ on the boundary
Stress $L_{\sigma} = \int_{S} \vec{v} \cdot (\sigma \vec{n}) dS$ The stress tensor $\sigma$
Force $L_{t} = \int_{S} \vec{v} \cdot \vec{t} dS$ The force density $t$ directly

The last object can also mimic body forces (gravity etc).

Currently in SOFA, these loads were spread out among various components, such as SurfacePressureForceField, QuadPressureForceField, EdgePressureForceField, TrianglePressureForceField among others. Each component implements their own integration loop and uses geometric data (such as normals) directly from its linked topology.
The loop is unified in the FEMSourceTermIntegrator and data such as normals are computed from the mapping jacobian of the reference domain. Extending them to quadratic elements is straightforward by using a quadratic topology in the scene; no more code extensions.

The scenes that have been added demonstrate how the new source term classes can duplicate the existing functionality.
In this PR, the loads are applied on the reference geometry. That's to simply introduce them and I'll add the ability to follow the geometry in subsequent PR.

Fixes #6166

[force-full-build]
[with-all-tests]

@th-skam th-skam added pr: status to review To notify reviewers to review this pull-request pr: enhancement About a possible enhancement pr: AI-aided Label notifying the reviewers that part or all of the PR has been generated with the help of an AI labels Jul 21, 2026
@bakpaul

bakpaul commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

I am not a FEM expert so I don't feel confident to review this PR. Nevertheless I checked to make sure this is compatible with higher order element and it seems ton be the case. So it is fine by me given that @alxbilger and/or @hugtalbot review it.

Could you add an example ?

@th-skam th-skam added pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Aug 31, 2026
@th-skam th-skam changed the title [SolidMechanics] Add component for source term integration based on new FEM framework [FEM] Add component for source term integration based on new FEM framework - constant source terms Sep 1, 2026
@th-skam th-skam added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Sep 2, 2026
@fredroy
fredroy force-pushed the sourceTerm branch 2 times, most recently from 6864a20 to 2bea0cb Compare September 6, 2026 22:58
@fredroy fredroy added the pr: based on previous PR PR based on a previous PR, therefore to be merged ONLY subsequently label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: AI-aided Label notifying the reviewers that part or all of the PR has been generated with the help of an AI pr: based on previous PR PR based on a previous PR, therefore to be merged ONLY subsequently pr: enhancement About a possible enhancement 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.

Add new SourceTermFEMForceField

3 participants