From e9ad9b2041d66165ac5c4f19b09a896960deec23 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Thu, 7 May 2026 12:47:20 +0200 Subject: [PATCH 1/2] [Mass] Support prisms in mass --- Sofa/Component/Mass/src/sofa/component/mass/ElementFEMMass.cpp | 3 +++ Sofa/Component/Mass/src/sofa/component/mass/ElementFEMMass.h | 1 + 2 files changed, 4 insertions(+) diff --git a/Sofa/Component/Mass/src/sofa/component/mass/ElementFEMMass.cpp b/Sofa/Component/Mass/src/sofa/component/mass/ElementFEMMass.cpp index 7f4a5825806..e2c0f520e30 100644 --- a/Sofa/Component/Mass/src/sofa/component/mass/ElementFEMMass.cpp +++ b/Sofa/Component/Mass/src/sofa/component/mass/ElementFEMMass.cpp @@ -37,6 +37,7 @@ template class SOFA_COMPONENT_MASS_API ElementFEMMass; template class SOFA_COMPONENT_MASS_API ElementFEMMass; template class SOFA_COMPONENT_MASS_API ElementFEMMass; +template class SOFA_COMPONENT_MASS_API ElementFEMMass; void registerFEMMass(sofa::core::ObjectFactory* factory) { @@ -59,6 +60,8 @@ void registerFEMMass(sofa::core::ObjectFactory* factory) factory->registerObjects(sofa::core::ObjectRegistrationData("Finite-element mass (inertia and body force) defined on hexahedra") .add< ElementFEMMass >(true)); + factory->registerObjects(sofa::core::ObjectRegistrationData("Finite-element mass (inertia and body force) defined on prisms") + .add< ElementFEMMass >(true)); } } diff --git a/Sofa/Component/Mass/src/sofa/component/mass/ElementFEMMass.h b/Sofa/Component/Mass/src/sofa/component/mass/ElementFEMMass.h index 61c1f9d820b..f390189c375 100644 --- a/Sofa/Component/Mass/src/sofa/component/mass/ElementFEMMass.h +++ b/Sofa/Component/Mass/src/sofa/component/mass/ElementFEMMass.h @@ -277,6 +277,7 @@ template class SOFA_COMPONENT_MASS_API ElementFEMMass; template class SOFA_COMPONENT_MASS_API ElementFEMMass; template class SOFA_COMPONENT_MASS_API ElementFEMMass; +template class SOFA_COMPONENT_MASS_API ElementFEMMass; #endif } // namespace sofa::component::mass From 9d9c1adc0acd69879b79bd5c88e14519a19261ac Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Thu, 7 May 2026 12:47:40 +0200 Subject: [PATCH 2/2] Adapt example to use mass with prisms --- .../Mapping/Hexa2PrismTopologicalMapping.scn | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/Component/Topology/Mapping/Hexa2PrismTopologicalMapping.scn b/examples/Component/Topology/Mapping/Hexa2PrismTopologicalMapping.scn index e3c505eb7b6..c2867de54c2 100644 --- a/examples/Component/Topology/Mapping/Hexa2PrismTopologicalMapping.scn +++ b/examples/Component/Topology/Mapping/Hexa2PrismTopologicalMapping.scn @@ -5,13 +5,15 @@ - - + + + + @@ -21,14 +23,12 @@ - - + + - - @@ -36,6 +36,9 @@ + + +