Skip to main content

Module tensor

Module tensor 

Source
Expand description

Full (non-symmetric) 3×3 tensor (Tensor). Full (non-symmetric) 3×3 tensor (Tensor) and its OpenFOAM-style operators, invariants, and decompositions.

Components are dimensionless f64 stored row-major (xx, xy, xz, yx, yy, yz, zx, zy, zz). Operator names follow OpenFOAM: mat_mul/mat_vec are the single inner product (&), double_inner the double contraction (&&), and the dyadic/outer product is Mul (*) of two vectors.

Structs§

Tensor
Full (non-symmetric) 3×3 tensor stored row-major. Component order: xx, xy, xz, yx, yy, yz, zx, zy, zz. Maps to Foam::tensor (Foam::Tensor<scalar>).

Functions§

det
Determinant det(T).
dev
Deviatoric part T - (tr/3)*I.
dev2
Two-thirds deviatoric T - (2*tr/3)*I.
dev_symm
Deviatoric of the symmetric part symm(T) - (tr/3)*I.
dev_two_symm
Deviatoric of twice the symmetric part twoSymm(T) - (2*tr/3)*I.
hodge_dual_of_vec
Hodge dual of a Vector as a skew-symmetric Tensor. C++ operator*(Vector).
inv
Inverse T⁻¹ (panics in debug builds if singular).
lerp
Linear interpolation (1-t)*a + t*b between two tensors.
outer
Outer product v ⊗ w. Same as v * w but as a named function.
skew
Skew-symmetric part 0.5*(T - Tᵀ).
symm
Symmetric part 0.5*(T + Tᵀ).
tr
Trace tr(T) = xx + yy + zz.
two_symm
Twice the symmetric part T + Tᵀ.