hyperelastic.models.invariants package#
Module contents#
- class hyperelastic.models.invariants.ThirdOrderDeformation(C10=0, C01=0, C11=0, C20=0, C30=0, strain=False)[source]#
Bases:
objectThird Order Deformation isotropic hyperelastic material formulation based on the first and second invariant of the right Cauchy-Green deformation tensor. The strain energy density per unit undeformed volume is given as a sum of multivariate polynomials.
(1)#\[\psi(I_1, I_2) = \sum_{(i+j) \ge 1}^{(i+2j) \le 3} C_{ij}~(I_1 - 3)^i (I_2 - 3)^j\]The first partial derivatives of the strain energy density w.r.t. the invariants are given below.
(2)#\[ \begin{align}\begin{aligned}\frac{\partial \psi}{\partial I_1} &= \sum_{i \ge 1} C_{ij}~i~(I_1 - 3)^{i-1} (I_2 - 3)^j\\\frac{\partial \psi}{\partial I_2} &= \sum_{j \ge 1} C_{ij}~(I_1 - 3)^i~j~(I_2 - 3)^{j-1}\end{aligned}\end{align} \]Furthermore, the second partial derivatives of the strain energy density w.r.t. the invariants are carried out.
(3)#\[ \begin{align}\begin{aligned}\frac{\partial^2 \psi}{\partial I_1~\partial I_1} &= \sum_{i \ge 2} C_{ij}~i~(i-1)~(I_1 - 3)^{i-2} (I_2 - 3)^j\\\frac{\partial^2 \psi}{\partial I_2~\partial I_2} &= \sum_{j \ge 2} C_{ij}~(I_1 - 3)^i~j~(j-1)~(I_2 - 3)^{j-2}\\\frac{\partial^2 \psi}{\partial I_1~\partial I_2} &= \sum_{i \ge 1, j \ge 1} C_{ij}~i~(I_1 - 3)^{i-1}~j~(I_2 - 3)^{j-1}\end{aligned}\end{align} \]
- class hyperelastic.models.invariants.TorchModel(fun, **kwargs)[source]#
Bases:
objectIsotropic hyperelastic material formulation based on a given strain energy density function
fun(I1, I2, I3, **kwargs)per unit undeformed volume. The gradients are carried out by automatic differentiation using PyTorch.(4)#\[\psi = \psi(I_1, I_2, I_3)\]Note
PyTorch uses single-precision by default. This must be considered in numeric simulations, i.e. the error tolerance should not exceed
np.sqrt(torch.finfo(torch.float).eps)(approx.tol=5e-4). For double- precision, enabletorch.float64as default.import torch torch.set_default_dtype(torch.float64)
Examples
>>> import hyperelastic
>>> def yeoh(I1, I2, I3, C10, C20, C30): >>> "Yeoh isotropic hyperelastic material formulation." >>> return C10 * (I1 - 3) + C20 * (I1 - 3) ** 2 + C30 * (I1 - 3) ** 3
>>> model = hyperelastic.models.invariants.TorchModel( >>> yeoh, C10=0.5, C20=-0.05, C30=0.02 >>> ) >>> framework = hyperelastic.InvariantsFramework(model) >>> umat = hyperelastic.DistortionalSpace(framework)