pub struct Tensor4 {
pub data: [[[[f64; 3]; 3]; 3]; 3],
}Expand description
Fourth-order tensor with 81 components stored as [i][j][k][l].
Fields§
§data: [[[[f64; 3]; 3]; 3]; 3]Component array indexed as data[i][j][k][l].
Implementations§
Source§impl Tensor4
impl Tensor4
Sourcepub fn identity_sym() -> Self
pub fn identity_sym() -> Self
Symmetric fourth-order identity: I_sym_ijkl = 0.5 * (δ_ik δ_jl + δ_il δ_jk).
Sourcepub fn isotropic(lambda: f64, mu: f64) -> Self
pub fn isotropic(lambda: f64, mu: f64) -> Self
Isotropic linear elasticity tensor: C_ijkl = λ δ_ij δ_kl + μ (δ_ik δ_jl + δ_il δ_jk).
Sourcepub fn double_contract_2(&self, t: &Tensor2) -> Tensor2
pub fn double_contract_2(&self, t: &Tensor2) -> Tensor2
Double contraction with a second-order tensor: result_ij = Σ_kl C_ijkl A_kl.
Source§impl Tensor4
impl Tensor4
Sourcepub fn deviatoric_projector() -> Self
pub fn deviatoric_projector() -> Self
Deviatoric projector: P_dev_ijkl = I_sym_ijkl - (1/3) delta_ij delta_kl.
Sourcepub fn to_voigt_matrix(&self) -> [[f64; 6]; 6]
pub fn to_voigt_matrix(&self) -> [[f64; 6]; 6]
Convert isotropic elasticity tensor to Voigt matrix (6x6).
Returns [6][6] matrix.
Source§impl Tensor4
impl Tensor4
Sourcepub fn double_contract_4(&self, other: &Tensor4) -> Tensor4
pub fn double_contract_4(&self, other: &Tensor4) -> Tensor4
Double contraction of two fourth-order tensors: (C::D)_ijmn = Σ_kl C_ijkl D_klmn.
Sourcepub fn single_contract_right(&self, a: &Tensor2) -> Tensor4
pub fn single_contract_right(&self, a: &Tensor2) -> Tensor4
Single contraction of C with a second-order tensor on the last two indices: (C · A)_ijkl = Σ_m C_ijkm A_ml.
Result is a fourth-order tensor.
Sourcepub fn has_minor_symmetry(&self, tol: f64) -> bool
pub fn has_minor_symmetry(&self, tol: f64) -> bool
Check minor symmetry: C_ijkl = C_jikl = C_ijlk.
Returns true if both left-minor and right-minor symmetries hold within tol.
Sourcepub fn has_major_symmetry(&self, tol: f64) -> bool
pub fn has_major_symmetry(&self, tol: f64) -> bool
Check major symmetry: C_ijkl = C_klij.
Returns true if major symmetry holds within tol.
Sourcepub fn symmetrize_minor(&self) -> Tensor4
pub fn symmetrize_minor(&self) -> Tensor4
Enforce minor symmetry by symmetrizing: C_sym_ijkl = 0.25 * (C_ijkl + C_jikl + C_ijlk + C_jilk).
Sourcepub fn symmetrize_major(&self) -> Tensor4
pub fn symmetrize_major(&self) -> Tensor4
Enforce major symmetry by averaging: C_sym_ijkl = 0.5*(C_ijkl + C_klij).
Sourcepub fn rotate(&self, r: &Tensor2) -> Tensor4
pub fn rotate(&self, r: &Tensor2) -> Tensor4
Rotate a fourth-order tensor: C’_ijkl = R_ia R_jb R_kc R_ld C_abcd.
Sourcepub fn volumetric_projector() -> Self
pub fn volumetric_projector() -> Self
Build the isotropic volumetric projector: P_vol_ijkl = (1/3) * delta_ij * delta_kl.
Auto Trait Implementations§
impl Freeze for Tensor4
impl RefUnwindSafe for Tensor4
impl Send for Tensor4
impl Sync for Tensor4
impl Unpin for Tensor4
impl UnsafeUnpin for Tensor4
impl UnwindSafe for Tensor4
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.