pyxfem.solidmechanics.hyperelasticity module
This module is dedicated to hyperelasticity Created on Thu April 2024 14:09:29 2024 @author: nchevaug
- class pyxfem.solidmechanics.hyperelasticity.CompressibleNeoHookeen(*, E: float | None = None, nu: float | None = None, lamb: float | None = None, mu: float | None = None, rho0: float | None = None, hyp: MaterialHypothesis = MaterialHypothesis.DIM3)[source]
Bases:
HyperElasticMaterialImplementation of the NeoHookeen Hyperelastic material
- C33_planestress(II_C2D: float64 | NDArray[float64]) float64 | NDArray[float64][source]
Return the square of the thichkess dilatation in plane stress Case, knowing the secons invariant of the planar componant of C mu(C33 -1) + kappa ln(J) = sig33
- Cauchy(b: NDArray[float64], out_sigma: NDArray[float64] | None = None) NDArray[float64][source]
Compute Cauchy Stress tensor as a function of b = FF^T
- PKI(F: NDArray[float64]) NDArray[float64][source]
Compute Piola Kirchhoff I Stress tensor as a function of F
- PKII(C: NDArray[float64]) NDArray[float64][source]
Return second Piola Kirchoff Stres as a function of C
- dC33dII_planestress(II_C2D: float64 | NDArray[float64], C33: float64 | NDArray[float64] | None = None) float64 | NDArray[float64][source]
Return the square of the thichkess dilatation in plane stress Case, knowing the secons invariant of the planar componant of C
- dPKIIdC(C: NDArray[float64]) NDArray[float64][source]
Compute the deriviatives of the Piola Kirchhoff II Stress tensor with regard to C
- dPKIdF(F: NDArray[float64]) NDArray[float64][source]
Compute the deriviatives of the Piola Kirchhoff I Stress tensor with regard to F at
- l3_planestress(J2d: float64 | NDArray[float64]) float64 | NDArray[float64][source]
return the principal elongation lambda_3 in the direction orthogonal to the plane
- potentialC(C: NDArray[float64]) NDArray[float64][source]
Compute The elastic potential as a function of C
- potentialF(F: NDArray[float64]) float64 | NDArray[float64][source]
return the Hyperelastic potential as a function of F
- static sigma_c_kernel(F, props, out_sigma, out_c)[source]
Calcule la contrainte de Cauchy et le tenseur d’élasticité spatial 2D. Zéro allocation, remplissage en place.
- spacial_elasticty_tensor(b: NDArray[float64], out_c: NDArray[float64] | None = None) NDArray[float64][source]
Compute the spatial (Eulerian) elasticity tensor for a Compressible Neo-Hookean material.
This tensor (c) relates the Lie derivative of the Kirchhoff stress to the rate of deformation tensor. It is derived from the push-forward of the material elasticity tensor to the current configuration.
- The formula used is:
c = (lamb / J) * (I ⊗ I) + 2 * (mu - lamb * ln(J)) / J * Is
where J = det(F) = sqrt(det(b)), I ⊗ I is the identity for the volumetric part, and Is is the symmetric fourth-order identity tensor.
- Parameters:
b (ndarray) – Left Cauchy-Green deformation tensor (Finger tensor). Shape: (dim, dim) or (batch_dims, dim, dim). Supported dims: 3D or 2D (under Plane Strain hypothesis).
- Returns:
- Fourth-order spatial elasticity tensor.
Shape: (dim, dim, dim, dim) or (batch_dims, dim, dim, dim, dim).
- Return type:
ndarray
- Raises:
NotImplementedError – If the dimensions are not (3,3) or if (2,2) is provided without Plane Strain hypothesis.
- class pyxfem.solidmechanics.hyperelasticity.HyperElasticMaterial(hyp: MaterialHypothesis = MaterialHypothesis.DIM3, rho0=1.0)[source]
Bases:
objectVirtual base class for HyperElastic material
- Cauchy(b: NDArray[float64]) NDArray[float64][source]
Compute Cauchy Stress tensor as a function of b = FF^T
- PKI(F: NDArray[float64]) NDArray[float64][source]
Compute Piola Kirchhoff I Stress tensor as a function of F
- PKII(C: NDArray[float64]) NDArray[float64][source]
Compute Piola Kirchhoff I Stress tensor as a function of C = F^TF
- dPKIIdC(C: NDArray[float64]) NDArray[float64][source]
Compute the deriviatives of the Piola Kirchhoff II Stress tensor with regard to C
- dPKIIdE(C: NDArray[float64]) NDArray[float64][source]
Compute the deriviatives of the Piola Kirchhoff II Stress tensor with regard to C
- dPKIdF(F: NDArray[float64]) NDArray[float64][source]
Compute the deriviatives of the Piola Kirchhoff I Stress tensor with regard to F
- potentialC(C: NDArray[float64]) float64 | NDArray[float64][source]
Compute the Elastic Potential as a Function of C
- pyxfem.solidmechanics.hyperelasticity.benchmark(law: HyperElasticMaterial, n: int, mem=False, prof=True)[source]
benchmark : compute and profile law.PKI and law.dPKIDF
- pyxfem.solidmechanics.hyperelasticity.check_material_law_C(law: HyperElasticMaterial, C: NDArray[float64], verb=True) Tuple[bool, bool][source]
check PKII(C) and dPKIIdC(C) return PKII_ok and dPKIIDC_ok PKII_ok and dPKIIdC_ok, respectively True if PKII (dPKIIdC) is close to the finite difference approximation, False otherwise.
- pyxfem.solidmechanics.hyperelasticity.check_material_law_F(law: HyperElasticMaterial, F: NDArray[float64], verb=True) Tuple[bool, bool][source]
check PKI(F) and dPKIdF(F) return PKI_ok and dPKIDF_ok PKI_ok and dPKIdF_ok, respectively True if PKI (dPKIdF) is close to the finite difference approximation, False otherwise.
- pyxfem.solidmechanics.hyperelasticity.fill_nh_c_2d(J, mu, lamb, out_c)[source]
Remplit le tenseur d’élasticité spatial 2x2x2x2 en place
- pyxfem.solidmechanics.hyperelasticity.fill_nh_sigma_2d(J, b00, b11, b01, mu, lamb, out_sigma)[source]
Remplit la contrainte de Cauchy 2D en place
- pyxfem.solidmechanics.hyperelasticity.lambertw(z)
Computes the principal branch of the Lambert W function for real, positive z using vectorized Halley’s method.
- pyxfem.solidmechanics.hyperelasticity.neo_hookean_law_local(F, props, out_sigma, out_c)[source]
Calcule la contrainte de Cauchy et le tenseur d’élasticité spatial 2D. Zéro allocation, remplissage en place.
- pyxfem.solidmechanics.hyperelasticity.real_lambertw(z)[source]
Computes the principal branch of the Lambert W function for real, positive z using vectorized Halley’s method.
- pyxfem.solidmechanics.hyperelasticity.vecroots(f: Callable, fprime: Callable, x0: float64 | NDArray[float64], atol: float = 1e-20, rtol=1e-12, maxiter: int = 100, verbose=False) float64 | NDArray[float64][source]
compute roots of an array of independant equations using newton’s method with line search so that all x stay > 0