homopy.tensor module
Created on Wed Apr 27 21:09:24 2022
@author: nicolas.christ@kit.edu
Tensor class for basic arithmetic operations. More information on tensor representation in Voigt and Mandel notations are given in [Brannon2018].
- class homopy.tensor.Tensor[source]
Bases:
objectTensor class to help with basic arithmetic operations on tensor space.
- Variables:
e1 (ndarray of shape (3,)) – Vector 1 of orthonormalbasis of 1st order tensors.
e2 (ndarray of shape (3,)) – Vector 2 of orthonormalbasis of 1st order tensors.
e3 (ndarray of shape (3,)) – Vector 3 of orthonormalbasis of 1st order tensors.
B (ndarray of shape (3, 3, 6)) – Orthonormalbasis of 4th order tensors in Mandel notation.
B_voigt (ndarray of shape (3, 3, 6)) – Orthogonalbasis of 4th order tensors in Voigt notation.
- _diade(di, dj)[source]
Return diadic product of two directional vectors. This is used to calculate the basis tensors in the Mandel notation.
- Parameters:
di (ndarray of shape (3,)) – Directional vector #1.
dj (ndarray of shape (3,)) – Directional vector #2.
- Returns:
ndarray of shape (3, 3) – Tensor of 2nd order in tensor notation.
- _diade4(bi, bj)[source]
Return diadic product of two tensors. This is used to transfer stiffness tensors from Mandel notation to regular tensor notation.
- Parameters:
bi (ndarray of shape (3, 3)) – Orthonormal basis tensor #1.
bj (ndarray of shape (3, 3)) – Orthonormal basis tensor #2.
- Returns:
ndarray of shape (3, 3, 3, 3) – Tensor of 4th order in tensor notation.
- tensor_product(tensor_a, tensor_b)[source]
Return the mapping of one tensor of 4th order to another in the Mandel notation.
- Parameters:
tensor_a (ndarray of shape (6, 6)) – Tensor #1.
tensor_b (ndarray of shape (6, 6)) – Tensor #2.
- Returns:
ndarray of shape (6, 6) – Resulting mapping.
- matrix2voigt(matrix)[source]
Return the Voigt notation of a tensor of 2nd order calculated from the regular tensor notation.
- Parameters:
matrix (ndarray of shape (3, 3)) – Tensor of 2nd order in regular tensor notation.
- Returns:
ndarray of shape (6,) – Tensor in Voigt notation.
- matrix2mandel(matrix)[source]
Return the Mandel notation of a tensor of 2nd order calculated from the regular tensor notation.
- Parameters:
matrix (ndarray of shape (3, 3)) – Tensor of 2nd order in regular tensor notation.
- Returns:
ndarray of shape (6,) – Tensor in Mandel notation.
- _tensor2matrix(tensor, representation)[source]
Return a matrix representation (either Mandel or Voigt) of a tensor of 4th order calculated from the regular tensor notation.
- Parameters:
tensor (ndarray of shape (3, 3, 3, 3)) – Tensor of 4th order in regular tensor notation.
representation (string) – Reduction type (options: ‘voigt’, ‘mandel’)
- Returns:
ndarray of shape (6, 6) – Tensor in reduced notation.
- tensor2mandel(tensor)[source]
Return the Mandel notation of a tensor of 4th order calculated from the regular tensor notation.
- Parameters:
tensor (ndarray of shape (3, 3, 3, 3)) – Tensor of 4th order in regular tensor notation.
- Returns:
ndarray of shape (6, 6) – Tensor in Mandel notation.
- tensor2voigt(tensor)[source]
Return the Voigt notation of a tensor of 4th order calculated from the regular tensor notation.
- Parameters:
tensor (ndarray of shape (3, 3, 3, 3)) – Tensor of 4th order in regular tensor notation.
- Returns:
ndarray of shape (6, 6) – Tensor in Mandel notation.
- mandel2tensor(mandel)[source]
Return the regular tensor notation of a tensor calculated from the Mandel notation.
- Parameters:
mandel (ndarray of shape (6, 6)) – Tensor of 4th order in Mandel notation.
- Returns:
tensor (ndarray of shape (3, 3, 3, 3)) – Tensor in regular tensor notation.
- voigt2tensor(voigt)[source]
Return the regular tensor notation of a tensor calculated from the Voigt notation.
- Parameters:
voigt (ndarray of shape (6, 6)) – Tensor of 4th order in Voigt notation.
- Returns:
tensor (ndarray of shape (3, 3, 3, 3)) – Tensor in regular tensor notation.