src/features/sym3.c file

Functions

auto vm_sym3_from_mat3(const matrix3* m) -> vm_sym3
Pack a symmetric matrix3 into Voigt-6.
auto vm_sym3_to_mat3(const vm_sym3* s) -> matrix3
Unpack Voigt-6 into a symmetric matrix3.
auto vm_sym3_add(const vm_sym3* a, const vm_sym3* b) -> vm_sym3
Component-wise sum.
auto vm_sym3_scale(const vm_sym3* a, const vm_float_t s) -> vm_sym3
Component-wise scale.
auto vm_sym3_trace(const vm_sym3* a) -> vm_float_t
Trace: xx + yy + zz.
auto vm_sym3_hydrostatic(const vm_sym3* a) -> vm_float_t
Hydrostatic (mean) scalar: tr(σ) / 3.
auto vm_sym3_deviator(const vm_sym3* a) -> vm_sym3
Deviatoric part: s = σ − (tr σ / 3) I.
auto vm_sym3_ddot(const vm_sym3* a, const vm_sym3* b) -> vm_float_t
Double contraction A : B.
void vm_sym3_invariants(const vm_sym3* a, vm_float_t* I1, vm_float_t* J2, vm_float_t* J3)
Principal invariants of the stress (or strain) tensor.
auto vm_sym3_push_forward(const matrix3* F, const vm_sym3* sigma) -> vm_sym3
Push-forward σ' = F σ Fᵀ, result in Voigt.
void vm_sym3_dw_split(const matrix3* L, vm_sym3* D, matrix3* W)
Symmetric / skew split of a velocity gradient.

Function documentation

vm_sym3 vm_sym3_from_mat3(const matrix3* m)

Pack a symmetric matrix3 into Voigt-6.

Parameters
m Input matrix3.
Returns Voigt representation.

Off-diagonal tensor components are taken from the upper triangle (m12, m23, m31). Non-symmetric input is accepted; only the upper triangle is used for shears.

matrix3 vm_sym3_to_mat3(const vm_sym3* s)

Unpack Voigt-6 into a symmetric matrix3.

Parameters
s Input Voigt tensor.
Returns Symmetric matrix3.

vm_float_t vm_sym3_ddot(const vm_sym3* a, const vm_sym3* b)

Double contraction A : B.

Returns A : B.

Equals the Frobenius inner product of the corresponding matrices. For tensor-shear Voigt storage this is xx_a*xx_b + yy_a*yy_b + zz_a*zz_b + 2*(xy_a*xy_b + yz_a*yz_b + zx_a*zx_b).

void vm_sym3_invariants(const vm_sym3* a, vm_float_t* I1, vm_float_t* J2, vm_float_t* J3)

Principal invariants of the stress (or strain) tensor.

Parameters
a Input tensor.
I1 Optional first invariant.
J2 Optional second deviatoric invariant.
J3 Optional third deviatoric invariant.

I1 = tr(σ). J2 = (1/2) s : s where s is the deviator (von Mises related). J3 = det(s). Any of the output pointers may be NULL.

vm_sym3 vm_sym3_push_forward(const matrix3* F, const vm_sym3* sigma)

Push-forward σ' = F σ Fᵀ, result in Voigt.

Parameters
F Deformation gradient (or any matrix3).
sigma Input Cauchy (or other) stress in Voigt.
Returns Pushed-forward tensor in Voigt.

void vm_sym3_dw_split(const matrix3* L, vm_sym3* D, matrix3* W)

Symmetric / skew split of a velocity gradient.

Parameters
L Velocity gradient (matrix3).
D Optional symmetric rate-of-deformation (Voigt).
W Optional skew spin tensor (matrix3).

D = (L + Lᵀ)/2 packed as Voigt; W = (L − Lᵀ)/2 as matrix3. Either output pointer may be NULL.