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”. The energy density function is:
\[\Psi(\mathbf{F}) = \frac{\mu}{2}(I_C - 3) - \mu \log J + \frac{\lambda}{2}(J-1)^2\]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 first Lamé parameter (shear modulus)
\(\lambda = \frac{E\nu}{(1+\nu)(1-2\nu)}\) is the second Lamé parameter
The formulation ensures numerical stability even under large deformations and near-inversion by using logarithmic terms instead of polynomial terms for the volumetric component.
- 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 first Piola-Kirchhoff stress tensor analytically with stability
P = ∂Ψ/∂F = μ*F - μ*F^{-T} + λ*(J-1)*J*F^{-T}
- 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