Skip to content

[FEM] Refactor templates in latest FEM classes#6124

Open
alxbilger wants to merge 15 commits into
sofa-framework:masterfrom
alxbilger:refactoringtemplatefem
Open

[FEM] Refactor templates in latest FEM classes#6124
alxbilger wants to merge 15 commits into
sofa-framework:masterfrom
alxbilger:refactoringtemplatefem

Conversation

@alxbilger

@alxbilger alxbilger commented May 23, 2026

Copy link
Copy Markdown
Contributor

The latest FEM classes defined custom names and custom template names so that the class is registered in the factory with this custom name. However, this is not a good practice. This PR restores the regular pattern where the class is registered using its own class. Because of this, I could also remove the Element prefix on all the FEM classes.

Before:

<PrismFEMMass/>

After:

<FEMMass template="Vec3,Prism"/>

[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 alxbilger added pr: status to review To notify reviewers to review this pull-request pr: clean Cleaning the code labels May 23, 2026
@alxbilger alxbilger force-pushed the refactoringtemplatefem branch from 83f01b3 to b5016d0 Compare May 28, 2026 07:16
@hugtalbot

Copy link
Copy Markdown
Contributor

Conflicts to be solved @alxbilger
Could you also add a short description please?

@alxbilger alxbilger force-pushed the refactoringtemplatefem branch from c6dd38d to 92e3339 Compare June 11, 2026 09:26
@hugtalbot hugtalbot added this to the v26.06 milestone Jun 12, 2026
@alxbilger alxbilger force-pushed the refactoringtemplatefem branch from 92e3339 to 2926653 Compare June 16, 2026 07:40
@fredroy fredroy force-pushed the refactoringtemplatefem branch from 2926653 to de39a66 Compare June 18, 2026 08:34
@fredroy fredroy added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Jun 18, 2026
@fredroy

fredroy commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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

@fredroy fredroy force-pushed the refactoringtemplatefem branch from de39a66 to c4e557f Compare June 18, 2026 09:46
leobois67 and others added 10 commits June 18, 2026 20:04
* clean dirtiness of data that are input of callback

Co-authored-by: Paul Baksic <30337881+bakpaul@users.noreply.github.com>

* Fix: remove the std::cout

---------

Co-authored-by: Paul Baksic <30337881+bakpaul@users.noreply.github.com>
…ramework#6157)

* [Mesh] Remove symbol export on template class BlenderExporter

* same for TopologyBoundingTrasher
@alxbilger

Copy link
Copy Markdown
Contributor Author

The CUDA force fields are not a template specialization. They are new classes deriving from the CPU class. Therefore, the component name takes the class name. That is why there is a Cuda prefix.

@fredroy

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

Labels

pr: clean Cleaning the code pr: status ready Approved a pull-request, ready to be squashed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants