sofa
sofa copied to clipboard
[HyperElastic] Introduce stable Neo Hookean hyperelastic material
On top of the introduction of the stable Neo Hookean hyperelastic material (from Smith, Breannan, Fernando De Goes, and Theodore Kim. "Stable neo-hookean flesh simulation." ACM Transactions on Graphics (TOG) 37.2 (2018): 1-15.), I rewrote the St Venant-Kirchhoff and Neo Hookean materials to make it clearer to read. I also added unit tests, validating some material constitutive equations.
I added an example having inverted tetrahedra:
Based on https://github.com/sofa-framework/sofa/pull/4600
$$ \alpha = 1 + \frac{\mu}{\lambda + \mu} $$
Strain Energy Density Function
$$ \psi = \frac{1}{2} \left(\mu (I_C - 3) + (\lambda + \mu) (J - \alpha)^2 \right) $$
Second Piola-Kirchoff stress tensor
$$ S = \mu I_3 + \left((\lambda + \mu) J (J - \alpha)\right) C^{-1} $$
Elasticity tensor
$$ \mathbb{C} = (\lambda + \mu) \left(-2 J (J - \alpha) C^{-1} \underline{\overline{\otimes}} C^{-1} + J (2 J-\alpha) C^{-1} \otimes C^{-1} \right) $$
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).
Poke @fjourdes @bakpaul ;)
TODO :
- test with weak (spring) constraint instead of the projective one
- add clamping on eigen values in the Hessian
- investigate the failing tests (to be listed, a priori Ogden Mooney Rivlin for PK2 + Costa for the Hessian-ElasticityTensor)
The simulation diverges at dt=0.00006 (compared to being stable at dt=0.00005), independently on the method used to fix points.
[ci-build][with-all-tests]
@hugtalbot @bakpaul I don't really understand why there is a factor 2 here: https://github.com/sofa-framework/sofa/blob/975b4ab35149b23915490e715da0fb3cdcc3bb92/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/Material_test.cpp#L250
And here:
https://github.com/sofa-framework/sofa/blob/975b4ab35149b23915490e715da0fb3cdcc3bb92/Sofa/Component/SolidMechanics/FEM/HyperElastic/src/sofa/component/solidmechanics/fem/hyperelastic/material/StableNeoHookean.h#L193
I don't understand how C_H_C relates to $C^{-1} \underline{\overline{\otimes}} C^{-1}$ and trC_HC_ relates to $C^{-1} \otimes C^{-1}$
Let me invoke @fjourdes

That looks great ! I did not have the time yet to test. Maybe we could have a look at the following implementation for the test bench ? HOBAK the code repository used by the paper authors Libgl implementation of Stable Neo hookean energy
Hi @fjourdes, thanks for the suggestion. I used HOBAK for the implementation, adapting it to SOFA TetrahedronHyperelasticityFEMForceField. I implemented only the material. Therefore, everything outside of the material, such as matrix clamping, is not yet implemented. Note that HOBAK has also a test suite, with some similarities with mine (test derivative against finite differences). I guess we can check that both test suites match for the same input.