[FEM.HyperElastic] Integration of hyperelasticity from Elasticity plugin to SOFA - #6206
[FEM.HyperElastic] Integration of hyperelasticity from Elasticity plugin to SOFA#6206alxbilger wants to merge 12 commits into
Conversation
th-skam
left a comment
There was a problem hiding this comment.
Few comments and porting corrections from SOFA's Ogden.h here.
Co-authored-by: Themis Skamagkis <70031729+th-skam@users.noreply.github.com>
| registerNeoHookeanMaterial(factory); | ||
| registerOgdenMaterial(factory); | ||
| registerPlasticMaterial(factory); | ||
| registerStVenantKirchhoffMaterial(factory); |
There was a problem hiding this comment.
| registerStVenantKirchhoffMaterial(factory); | |
| registerStVenantKirchhoffMaterial(factory); | |
| registerIncompressibleMooneyRivlinMaterial(factory); |
missing registration
| ) | ||
|
|
||
| sofa_find_package(Sofa.Simulation.Core REQUIRED) | ||
| sofa_find_package(Sofa.Simulation.Core Sofa.Component.SolidMechanics.FEM.Elastic REQUIRED) |
There was a problem hiding this comment.
I did not know it was possible to put 2 packages in sofa_find_package 👀
(normal find_package() is supposed to only accept one)
It seems to pass on the CI but maybe there are some unattended consequences ?
| sofa_find_package(Sofa.Simulation.Core Sofa.Component.SolidMechanics.FEM.Elastic REQUIRED) | |
| sofa_find_package(Sofa.Simulation.Core Sofa.Component.SolidMechanics.FEM.Elastic REQUIRED) | |
| sofa_find_package(Sofa.Component.SolidMechanics.FEM.Elastic REQUIRED) |
|
|
||
| void validateMaterial(); | ||
|
|
||
| bool m_isHessianValid; |
There was a problem hiding this comment.
| bool m_isHessianValid; | |
| bool m_isHessianValid {false}; |
or true, maybe... 🫢
| const Real mu = m_mu.getValue(); | ||
| const Real alpha = m_alpha.getValue(); | ||
|
|
||
| const Real FJ = pow(J, -alpha / static_cast<Real>(3)); |
There was a problem hiding this comment.
| const Real FJ = pow(J, -alpha / static_cast<Real>(3)); | |
| const Real FJ = pow(J, -alpha / static_cast<Real>(spatial_dimensions)); |
| const sofa::type::Mat<spatial_dimensions, TopologicalDimension, Real>& J_q, | ||
| const sofa::type::Mat<TopologicalDimension, spatial_dimensions, Real>& J_Q_inv) -> DeformationGradient | ||
| { | ||
| return J_q * J_Q_inv; |
There was a problem hiding this comment.
Claudy tells me that for Triangle (TopologicalDimension =2) in 3D (spatial_dimensions=3), this will leads to det(F)=0 (ranks of J_q * J_Q_inv <= 2) in Strain.h and therefore Nan/inf because it is used with log(J) in materials... so UB/invalid results and then chocapic afterwards
| const auto mu10 = m_mu10.getValue(); | ||
| const auto mu01 = m_mu01.getValue(); | ||
|
|
||
| return static_cast<Real>(2) * mu10 * I + static_cast<Real>(2) * mu01 * (invariant1 * I - C); |
There was a problem hiding this comment.
Claudy tell me that this computes "a purely deviatoric stress with no volumetric/bulk/pressure term at all, unlike the plain (compressible) MooneyRivlinMaterial" and "Elements .... have zero volumetric stiffness and can freely change volume under load — the opposite of what 'incompressible' implies. "
Introduction of hyperelasticity with a few materials, and validation scenes
[with-all-tests]
Note that Ogen was added in alxbilger/Elasticity#6 by @th-skam
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