pub struct Tensor3 {
pub data: [[[f64; 3]; 3]; 3],
}Expand description
Rank-3 tensor with 27 components stored as data[i][j][k].
Used in continuum mechanics for third-order coupling tensors and the Levi-Civita permutation symbol.
Fields§
§data: [[[f64; 3]; 3]; 3]Component array indexed as data[i][j][k].
Implementations§
Source§impl Tensor3
impl Tensor3
Sourcepub fn levi_civita() -> Self
pub fn levi_civita() -> Self
Levi-Civita (alternating) tensor ε_ijk.
ε_ijk = +1 for even permutations of (0,1,2), -1 for odd permutations, 0 if any index is repeated.
Sourcepub fn contract_last(&self, v: &[f64; 3]) -> Tensor2
pub fn contract_last(&self, v: &[f64; 3]) -> Tensor2
Contract the last index with a vector: result[i][j] = T_ijk * v_k.
Sourcepub fn contract_first(&self, v: &[f64; 3]) -> Tensor2
pub fn contract_first(&self, v: &[f64; 3]) -> Tensor2
Contract the first index with a vector: result[j][k] = v_i * T_ijk.
Sourcepub fn contract_two(&self, a: &[f64; 3], b: &[f64; 3]) -> [f64; 3]
pub fn contract_two(&self, a: &[f64; 3], b: &[f64; 3]) -> [f64; 3]
Full contraction with two vectors: result_i = T_ijk * a_j * b_k.
Auto Trait Implementations§
impl Freeze for Tensor3
impl RefUnwindSafe for Tensor3
impl Send for Tensor3
impl Sync for Tensor3
impl Unpin for Tensor3
impl UnsafeUnpin for Tensor3
impl UnwindSafe for Tensor3
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
Mutably borrows from an owned value. Read more
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.