Expand description
Tensor algebra operations for continuum mechanics.
Provides second-order tensors (Tensor2), fourth-order tensors (Tensor4),
and a Voigt notation helper for symmetric second-order tensors.
Structs§
- CpDecomposition
- CP (CANDECOMP/PARAFAC) decomposition result.
- Dense
Tensor - A dense tensor of arbitrary rank stored in row-major (C-order) layout.
- Kelvin
Tensor - Kelvin (Mandel) notation utilities for symmetric fourth-order tensors.
- Mandel
Notation - Mandel notation for symmetric second-order tensors.
- Tensor2
- Second-order tensor (3×3 matrix) stored as row-major
[[f64; 3]; 3]. - Tensor3
- Rank-3 tensor with 27 components stored as
data[i][j][k]. - Tensor4
- Fourth-order tensor with 81 components stored as
[i][j][k][l]. - Tensor
Basis - Tensor basis transformation utilities.
- Tensor
Train - A tensor in Tensor Train (TT / MPS) format.
- TtCore
- A single Tensor Train core of shape (r_left, n, r_right).
- Tucker
Decomposition - Tucker decomposition result for a 3-way tensor.
- Voigt
Tensor - Voigt notation utilities for symmetric 3×3 tensors.
Functions§
- bilinear_
form - Compute the bilinear form v^T A w for a Tensor2.
- bulk_
modulus - Compute the bulk modulus K from Lame parameters.
- cauchy_
stress_ linear - Compute Cauchy stress from linear elasticity: sigma = C : epsilon.
- compliance_
from_ stiffness - Compliance tensor from stiffness: S = C^{-1} in Voigt form (6×6 matrix inversion).
- cp_als
- Alternating Least Squares (ALS) for CP decomposition of a 3-way tensor.
- cp_
reconstruct - Reconstruct a DenseTensor from a CP decomposition.
- cp_
relative_ error - Relative reconstruction error: ||T - T_approx||_F / ||T||_F.
- einsum_
2d - Einstein summation helper for common rank-2 tensor operations.
- elasticity_
stress - Compute the double inner product C :: T for a 4th-order elasticity tensor C and a symmetric second-order tensor T. Returns sigma_ij = C_ijkl T_kl.
- eshelby_
sphere - Build the Eshelby inclusion tensor for an isotropic matrix.
- exp_
tensor_ pade - Approximate matrix exponential via Padé (2,2) approximation.
- fourth_
order_ skew_ identity - The 4th-order skew (antisymmetric) identity tensor: I^A_ijkl = (delta_ik delta_jl - delta_il delta_jk)/2.
- fourth_
order_ symmetric_ identity - The 4th-order symmetric identity tensor I^S_ijkl = (delta_ik delta_jl + delta_il delta_jk)/2.
- general_
einsum - Einstein summation over a pair of DenseTensors with explicit free and contracted indices.
- hill_
average - Hill average: arithmetic mean of Voigt and Reuss bounds.
- invert_
6x6 - Invert a 6×6 matrix using Gauss–Jordan elimination.
- is_
symmetric_ modes - Check whether a DenseTensor is symmetric under swap of two given modes.
- lame_
to_ young_ poisson - Compute the engineering Young’s modulus E and Poisson’s ratio nu from Lame parameters.
- log_
tensor_ approx - Approximate matrix logarithm of a tensor close to identity: ln(I + X) ≈ X - X²/2 + X³/3.
- neo_
hookean_ stiffness - Compute the 4th-order stiffness tensor for Neo-Hookean material at deformation F.
- polar_
decompose_ right - Right polar decomposition of a non-singular 3×3 tensor F = R U.
- quadratic_
form - Compute the quadratic form v^T A v for a Tensor2.
- reuss_
average - Harmonic mean of two stiffness tensors (Reuss bound): C_Reuss = (C_a^{-1} + C_b^{-1})^{-1} / 2 (in Voigt/Kelvin form).
- shear_
modulus - Compute the shear modulus (= mu).
- symmetrize_
tensor - Build a fully symmetric DenseTensor by averaging over all permutations of indices (only for rank-2 and rank-3 tensors for now; rank-2 reduces to symmetrising a matrix).
- tensor_
contraction - Tensor contraction: contract modes
mode_aofaandmode_bofbover their shared dimension. - tensor_
outer - Compute the general outer product of two DenseTensors: result has rank = rank(a) + rank(b).
- transversely_
isotropic_ stiffness - Build a transversely isotropic stiffness tensor given five elastic constants.
- tucker_
hosvd - Higher-order SVD (HOSVD) Tucker decomposition of a 3-way tensor.
- tucker_
reconstruct - Reconstruct a 3-way tensor from a Tucker decomposition.
- vec_
outer - Outer product of two 3-vectors: result_ij = a_i b_j (returns Tensor2).
- voigt_
average - Arithmetic mean of two stiffness tensors (Voigt bound): C_Voigt = (C_a + C_b) / 2.
- young_
poisson_ to_ lame - Compute Lame parameters from Young’s modulus E and Poisson’s ratio nu.