pyxfem.solidmechanics.largestrain module

Continuum Mechanics : Tensor Transformations and Acoustic Analysis Module.

This module provides a suite of functions to perform pull-back and push-forward operations between different stress measures (Cauchy, PK1, PK2) and their associated elasticity tangents. It also includes tools for computing acoustic tensors and wave speeds in finite strain frameworks.

Supported measures:
  • Deformation gradients (F) and Cauchy-Green tensors (C, b).

  • Stress tensors: Cauchy (s), First Piola-Kirchhoff (P), Second Piola-Kirchhoff (S).

  • Elasticity tensors: Material (C), Spatial (c), and Mixed (dPdF).

Compatibility:

All functions (but the acoustic tensors) are vectorized. They support single tensors of shape (dim, dim) or batches of tensors of shape (…, dim, dim) using NumPy broadcasting via the smallsize_tensor backend.

pyxfem.solidmechanics.largestrain.Cauchy_to_PKI(Cauchy, F)[source]

Pull-back Cauchy stress (sigma) to First Piola-Kirchhoff stress (P). Formula: P = J * sigma @ F^-T = sigma @ cofac(F)

Parameters:
  • Cauchy (ndarray) – Cauchy stress tensor(s) of shape (…, dim, dim).

  • F (ndarray) – Deformation gradient tensor(s) of shape (…, dim, dim).

Returns:

First Piola-Kirchhoff stress tensor(s).

Return type:

ndarray

pyxfem.solidmechanics.largestrain.Cauchy_to_PKII(Cauchy, F)[source]

Pull-back Cauchy stress (sigma) to Second Piola-Kirchhoff stress (S). Formula: S = J * F^-1 @ sigma @ F^-T

Parameters:
  • Cauchy (ndarray) – Cauchy stress tensor(s) of shape (…, dim, dim).

  • F (ndarray) – Deformation gradient tensor(s) of shape (…, dim, dim).

Returns:

Second Piola-Kirchhoff stress tensor(s).

Return type:

ndarray

pyxfem.solidmechanics.largestrain.PKII_to_Cauchy(PKII, F)[source]

Push-forward Second Piola-Kirchhoff stress (S) to Cauchy stress (sigma). Formula: sigma = (1/J) * F @ S @ F^T

Parameters:
  • PKII (ndarray) – PK2 stress tensor(s) of shape (…, dim, dim).

  • F (ndarray) – Deformation gradient tensor(s) of shape (…, dim, dim).

Returns:

Cauchy stress tensor(s).

Return type:

ndarray

pyxfem.solidmechanics.largestrain.PKII_to_PKI(PKII, F)[source]

Transform Second Piola-Kirchhoff stress (S) to First Piola-Kirchhoff stress (P). Formula: P = F @ S

Parameters:
  • PKII (ndarray) – PK2 stress tensor(s) of shape (…, dim, dim).

  • F (ndarray) – Deformation gradient tensor(s) of shape (…, dim, dim).

Returns:

First Piola-Kirchhoff stress tensor(s).

Return type:

ndarray

pyxfem.solidmechanics.largestrain.PKI_to_Cauchy(PKI, F)[source]

Push-forward First Piola-Kirchhoff stress (P) to Cauchy stress (sigma). Formula: sigma = (1/J) * P @ F^T

Parameters:
  • PKI (ndarray) – PK1 stress tensor(s) of shape (…, dim, dim).

  • F (ndarray) – Deformation gradient tensor(s) of shape (…, dim, dim).

Returns:

Cauchy stress tensor(s).

Return type:

ndarray

pyxfem.solidmechanics.largestrain.PKI_to_PKII(PKI, F)[source]

Transform First Piola-Kirchhoff stress (P) to Second Piola-Kirchhoff stress (S). Formula: S = inv(F) @ P

Parameters:
  • PKI (ndarray) – PK1 stress tensor(s) of shape (…, dim, dim).

  • F (ndarray) – Deformation gradient tensor(s) of shape (…, dim, dim).

Returns:

Second Piola-Kirchhoff stress tensor(s).

Return type:

ndarray

pyxfem.solidmechanics.largestrain.acoustic_impedance_tensor(rho, c, s, n, outZ=None)[source]

compute the acoustic tensor impedance in direction n c is the 4 order tangent spacial material tensor s is the cauchy stress n is a direction (norm 1 ..) rho is the density return OutZ : acoustic tensor in direction n

pyxfem.solidmechanics.largestrain.acoustic_impedance_tensor_pnjit(rho, c, s, n, out)[source]
pyxfem.solidmechanics.largestrain.acoustic_tensor_2d_kernel_njit(c, s, n, out)[source]
pyxfem.solidmechanics.largestrain.acoustic_tensor_material(C, S, N, F)[source]

Compute the acoustic tensor using material variables (C, S). :param C: Material elasticity tensor(s). :type C: ndarray :param S: PK2 stress tensor(s). :type S: ndarray :param N: normal vector(s) in reference config (…, dim).

N is the piola pull back of a unit normal vector in current configuration N = (1/J) F^T n with |n| = 1

Parameters:

F (ndarray) – Deformation gradient tensor(s).

Returns:

The material acoustic tensor(s).

Return type:

ndarray

pyxfem.solidmechanics.largestrain.acoustic_tensor_mixte(dPdF, N, J)[source]

Compute the acoustic tensor using the mixed tangent dP/dF.

Parameters:
  • dPdF (ndarray) – Mixed elasticity tensor(s).

  • N (ndarray) – normal vector(s) in reference config (…, dim). N is the piola pull back of a unit normal vector in current configuration N = (1/J) F^T n with |n| = 1

  • J (float/ndarray) – Determinant of F.

Returns:

The acoustic tensor(s) of shape (…, dim, dim). Qik = J AiJkL NJ N L

Return type:

ndarray

pyxfem.solidmechanics.largestrain.acoustic_tensor_space(c: ndarray, s: ndarray, n: ndarray, out=None) → ndarray[source]
pyxfem.solidmechanics.largestrain.acoustic_tensor_space_v0(c, s, n)[source]

Compute the acoustic tensor using spatial variables (c, sigma).

Parameters:
  • c (ndarray) – Spatial elasticity tensor(s).

  • s (ndarray) – Cauchy stress tensor(s).

  • n (ndarray) – Direction vector(s) in current config (…, dim).

Returns:

The spatial acoustic tensor(s).

Return type:

ndarray

pyxfem.solidmechanics.largestrain.acoustic_tensor_space_v1(c, s, n, out=None)[source]

Version déroulée spécifiquement pour la 2D

pyxfem.solidmechanics.largestrain.c_dPKIdF(c, s, F)[source]

Convert the spatial elasticity tensor (c) to the mixed tangent (dP/dF).

Parameters:
  • c (ndarray) – Spatial elasticity tensor(s).

  • s (ndarray) – Cauchy stress tensor(s).

  • F (ndarray) – Deformation gradient tensor(s).

Returns:

Mixed elasticity tensor(s) dP/dF.

Return type:

ndarray

pyxfem.solidmechanics.largestrain.c_to_dPKIIdE(c, F)[source]

Pull-back the spatial elasticity tensor (c) to the material tangent (dS/dE).

Parameters:
  • c (ndarray) – Spatial elasticity tensor(s).

  • F (ndarray) – Deformation gradient tensor(s).

Returns:

Material elasticity tensor(s) dS/dE.

Return type:

ndarray

pyxfem.solidmechanics.largestrain.dPKIIdE_to_c(dPKIIdE, F)[source]

Push-forward the material tangent (dS/dE) to the spatial elasticity tensor (c).

Parameters:
  • dPKIIdE (ndarray) – Material elasticity tensor(s) (dPKII/dE).

  • F (ndarray) – Deformation gradient tensor(s).

Returns:

Spatial elasticity tensor(s) c.

Return type:

ndarray

pyxfem.solidmechanics.largestrain.dPKIIdE_to_dPKIdF(dPKIIdE, PKII, F)[source]

Transform the material tangent (dS/dE) to the mixed tangent (dP/dF).

Parameters:
  • dPKIIdE (ndarray) – Fourth-order material elasticity tensor(s).

  • PKII (ndarray) – PK2 stress tensor(s).

  • F (ndarray) – Deformation gradient tensor(s).

Returns:

Mixed elasticity tensor(s) dP/dF.

Return type:

ndarray

pyxfem.solidmechanics.largestrain.dPKIdF_to_c(dPKIdF, PKI, F)[source]

Convert the mixed tangent (dP/dF) to the spatial elasticity tensor (c).

Parameters:
  • dPKIdF (ndarray) – Mixed elasticity tensor(s).

  • PKI (ndarray) – PK1 stress tensor(s).

  • F (ndarray) – Deformation gradient tensor(s).

Returns:

Spatial elasticity tensor(s) c.

Return type:

ndarray

pyxfem.solidmechanics.largestrain.dPKIdF_to_dPKIIdE(dPKIdF, PKI, F)[source]

Transform the mixed tangent (dP/dF) to the material tangent (dS/dE).

Parameters:
  • dPKIdF (ndarray) – Mixed elasticity tensor(s) dP/dF.

  • PKI (ndarray) – PK1 stress tensor(s).

  • F (ndarray) – Deformation gradient tensor(s).

Returns:

Material elasticity tensor(s) dS/dE.

Return type:

ndarray

pyxfem.solidmechanics.largestrain.leftCauchyGreen(F: NDArray[float64], out: NDArray[float64] | None = None) → NDArray[float64][source]

Compute the Left Cauchy-Green deformation tensor b = F @ F^T.

Parameters:

F (ndarray) – Deformation gradient tensor(s) of shape (…, dim, dim).

Returns:

The spatial deformation tensor(s) b.

Return type:

ndarray

pyxfem.solidmechanics.largestrain.rightCauchyGreen(F)[source]

Compute the Right Cauchy-Green deformation tensor C = F^T @ F.

Parameters:

F (ndarray) – Deformation gradient tensor(s) of shape (…, dim, dim).

Returns:

The material deformation tensor(s) C.

Return type:

ndarray

pyxfem.solidmechanics.largestrain.test_acoustic_tensor()[source]

Testing Acoustic tensor and wave seed computation

pyxfem.solidmechanics.largestrain.test_transport_formula()[source]

checking the transformation formulas

pyxfem.solidmechanics.largestrain.wavespeed(A, rho)[source]

Calculate wave speeds from the acoustic tensor and density. For now only work for 2x2 acoustic tensor …. :param A: Acoustic tensor(s). :type A: ndarray :param rho: Material density. :type rho: float/ndarray

Returns:

Wave speeds (sqrt of eigenvalues of A/rho).

Return type:

ndarray