Material#
Material models for finite element simulation
This module implements hyperelastic material models for FEM simulation. The primary model is the Stable Neo-Hookean formulation, which provides numerical stability even under large deformations and element inversion.
The strain energy density is derived from the deformation gradient \(\mathbf{F}\), and forces are computed as the negative gradient of the total elastic energy.
- class diffsim.material.StableNeoHookean(youngs_modulus=1000000.0, poissons_ratio=0.45)[source]#
Bases:
objectStable Neo-Hookean hyperelastic material model
This class implements the stable Neo-Hookean formulation from Smith et al. (2018), “Stable Neo-Hookean Flesh Simulation”. Up to an additive constant, its energy density is:
\[\Psi(\mathbf{F}) = \frac{\bar\mu}{2}\left[(I_C-3)-\log\left(1+\frac{I_C-3}{4}\right)\right] + \frac{\bar\lambda}{2}(J-1)^2 - \frac{3\bar\mu}{4}(J-1)\]where:
\(\mathbf{F}\) is the deformation gradient tensor (3×3)
\(I_C = \text{tr}(\mathbf{F}^T \mathbf{F}) = \|\mathbf{F}\|_F^2\) is the first invariant
\(J = \det(\mathbf{F})\) is the Jacobian determinant (volume ratio)
\(\mu = \frac{E}{2(1+\nu)}\) is the shear modulus
\(\lambda = \frac{E\nu}{(1+\nu)(1-2\nu)}\) is Lamé’s first parameter
Here \(\bar\mu=4\mu/3\) and \(\bar\lambda=\lambda+5\mu/6\). This formulation remains finite for singular and inverted elements; explicit time integration still requires a sufficiently small time step.
- Parameters:
- Reference:
Smith, B., De Goes, F., & Kim, T. (2018). Stable neo-hookean flesh simulation. ACM Transactions on Graphics (TOG), 37(2), 1-15.
- __init__(youngs_modulus=1000000.0, poissons_ratio=0.45)[source]#
Initialize material with elastic constants
- Parameters:
youngs_modulus – Young’s modulus (E)
poissons_ratio – Poisson’s ratio (ν)
- energy_density(F)[source]#
Compute strain energy density for deformation gradient F
- Parameters:
F – \((M, 3, 3)\) deformation gradient tensor
- Returns:
\((M,)\) energy density for each element
- Return type:
psi
- first_piola_kirchhoff_stress(F)[source]#
Compute first Piola-Kirchhoff stress tensor P = ∂Ψ/∂F
- Parameters:
F – \((M, 3, 3)\) deformation gradient tensor
- Returns:
\((M, 3, 3)\) first Piola-Kirchhoff stress tensor
- Return type:
P
- first_piola_kirchhoff_stress_analytic(F)[source]#
Compute the exact first Piola-Kirchhoff stress tensor analytically.
- Parameters:
F – \((M, 3, 3)\) deformation gradient tensor
- Returns:
\((M, 3, 3)\) first Piola-Kirchhoff stress tensor
- Return type:
P
- compute_elastic_forces(F, Dm_inv, volume)[source]#
Compute elastic forces from stress tensor
- Parameters:
F – \((M, 3, 3)\) deformation gradient
Dm_inv – \((M, 3, 3)\) inverse rest shape matrix
volume – \((M,)\) rest volume of each element
- Returns:
\((M, 4, 3)\) forces on vertices of each element
- Return type:
forces