Hyperelastic 3D¶
Bases: Material
Hyperelastic material in 3D.
This class implements a hyperelastic material model for large deformations
using automatic differentiation. The user provides a strain energy density
function \(\psi(\mathbf{F}, \texttt{params})\) and the model computes
stress and tangent stiffness automatically via torch.func.
Parameters:
-
psi(Callable) –Strain energy density function \(\psi(\mathbf{F}, \texttt{params})\) that takes the deformation gradient and material parameters and returns a scalar energy density.
-
params(list | Tensor) –Material parameters passed to
psi. Shape:(p,)for a scalar or(N, p)for a batch of materials. -
rho(Tensor | float, default:1.0) –Mass density. Default is
1.0.
Notes
- Finite-strain (large deformation) framework.
- No internal state variables (
n_state = 0). - Stress and tangent are computed via automatic differentiation of \(\psi\).
Hyperelastic constitutive law
A hyperelastic material is defined by a strain energy density function
\(\psi(\mathbf{F})\) of the deformation gradient \(\mathbf{F}\). The first
Piola-Kirchhoff stress is obtained as
$$
\mathbf{P} = \frac{\partial \psi}{\partial \mathbf{F}}
$$
and the material tangent as
$$
C_{iJkL}
= \frac{\partial^2 \psi}{\partial F_{iJ} \partial F_{kL}}.
$$
Both derivatives are computed automatically using torch.func.jacrev.
Common choices for \(\psi\) include the Neo-Hookean model $$ \psi(\mathbf{F}) = \frac{\mu}{2} \left( \text{tr}(\mathbb{C}) - 3 \right) - \mu \ln J + \frac{\lambda}{2} (\ln J)^2 $$ with \(\mathbb{C} = \mathbf{F}^\top \mathbf{F}\), \(J = \det(\mathbf{F})\), and Lamé parameters \(\mu, \lambda\), or the Saint Venant-Kirchhoff model $$ \psi(\mathbf{F}) = \frac{\lambda}{2} \left( \text{tr}(\mathbf{E}) \right)^2 + \mu \, \text{tr}(\mathbf{E}^2) $$ with the Green-Lagrange strain \(\mathbf{E} = \frac{1}{2} (\mathbb{C} - \mathbb{I})\).
vectorize(n_elem)
¶
Returns a vectorized copy of the material for n_elem elements.
This function creates a batched version of the material properties. If the
material is already vectorized (self.is_vectorized == True), the function
simply returns self without modification.
Parameters:
-
n_elem(int) –Number of elements to vectorize the material for.
Returns:
-
Hyperelastic3D(Hyperelastic3D) –A new material instance with vectorized properties.
step(H_inc, F, stress, state, de0, cl, iter)
¶
Performs an incremental step for a hyperelastic material.
Parameters:
-
H_inc(Tensor) –Incremental displacement gradient. - Shape:
(..., 3, 3), where...represents batch dimensions. -
F(Tensor) –Current deformation gradient. - Shape:
(..., 3, 3), same asH_inc. -
stress(Tensor) –Current 1st PK stress tensor. - Shape:
(..., 3, 3). -
state(Tensor) –Internal state variables (unused in hyperelasticity). - Shape: Arbitrary, remains unchanged.
-
de0(Tensor) –External deformation gradient increment (e.g., thermal). - Shape:
(..., 3, 3). -
cl(Tensor) –Characteristic lengths. - Shape:
(..., 1). -
iter(int) –Current iteration number.
Returns:
-
tuple(tuple[Tensor, Tensor, Tensor]) –- stress_new (Tensor): Updated (1st PK) stress tensor.
Shape:
(..., 3, 3). - state_new (Tensor): Updated internal state (unchanged).
Shape: same as
state. - ddsdde (Tensor): Algorithmic tangent stiffness tensor.
Shape:
(..., 3, 3, 3, 3).
- stress_new (Tensor): Updated (1st PK) stress tensor.
Shape: