Second-order tensors#
In this notebook we will illustrate various representations of second-order tensors and conversion between them.
Various representation of second-order tensors are implemented in the tensorconvert.SecondOrderTensor class.
import sympy
from tensorconvert import SecondOrderTensor
sympy.init_printing(use_latex="mathjax")
Representations#
SecondOrderTensor can be initialized with a generic sympy.Matrix using its default constructor.
The spatial dimension is indicated by the dim parameter. By default, we have dim = 3.
Array#
The full array (matrix) representation can be obtained by the as_array method.
SecondOrderTensor().as_array() # by default, the spatial dimension `dim` is 3.
SecondOrderTensor(dim=2).as_array()
Voigt notation for strain-like quantities#
The engineering shear strains \(\gamma_{ij}=2\varepsilon_{ij}\) are used in Voigt notation.
SecondOrderTensor().as_voigt_strain()
The ordering of the shear components can also be specified by the ordering argument. Three choices are possible
By default,
SecondOrderTensor(ordering="121323")gives \((\sigma_{11},\sigma_{22},\sigma_{33},\sigma_{12},\sigma_{13},\sigma_{23})\). This ordering is used in Abaqus/Standard.With
ordering="122313"), we will have \((\sigma_{11},\sigma_{22},\sigma_{33},\sigma_{12},\sigma_{23},\sigma_{13})\).Another possibility is
ordering="231312", which leads to \((\sigma_{11},\sigma_{22},\sigma_{33},\sigma_{23},\sigma_{13},\sigma_{12})\).
SecondOrderTensor(ordering="122313").as_voigt_strain()
SecondOrderTensor(ordering="231312").as_voigt_strain()
Voigt notation for stress-like quantities#
For the stress tensor or other stress-like quantities, the off-diagonal components are written without the additional scaling factor.
SecondOrderTensor().as_voigt_stress()
Mandel notation#
Mandel notation uses a unified orthonormal basis for symmetric second-order tensors. Stresses and strains are no longer distinguished, which simplifies implementation of computational mechanics algorithms.
The additional \(\sqrt{2}\) factor in front of the off-diagonal components ensures the orthonormality of the basis.
SecondOrderTensor().as_mandel()
The rationale of Voigt and Mandel notations is that the double contraction between the stress and strain tensors can be also computed by the inner product between their respective vector representations.
sig = SecondOrderTensor().from_array(sympy.MatrixSymbol("sigma", 3, 3))
eps = SecondOrderTensor().from_array(sympy.MatrixSymbol("varepsilon", 3, 3))
sig.as_voigt_stress().T * eps.as_voigt_strain() == sig.as_mandel().T * eps.as_mandel()
True
Unsymmetric tensors#
For unsymmetric tensors, the following flattened notation can be used.
SecondOrderTensor().as_unsym()
Again, the ordering of the off-diagonal components can be specified through ordering.
SecondOrderTensor(ordering="122313").as_unsym()
Initialization#
Apart from the default constructor, SecondOrderTensor can also be initialized by various representations.
The API is similar to the previous representation methods.
a = SecondOrderTensor().from_array(sympy.randMatrix(3, 3))
a.as_mandel() # note that here the lower-diagonal part will be ignored
a = SecondOrderTensor().from_mandel(a.as_mandel())
a.as_voigt_strain()
a = SecondOrderTensor().from_voigt_strain(a.as_voigt_strain())
a.as_voigt_stress()
a = SecondOrderTensor().from_voigt_stress(a.as_voigt_stress())
a.as_unsym()
Basis vectors#
The basis vectors (or matrices) for each representation can be obtained via the basis_ methods.
SecondOrderTensor().basis_mandel()
SecondOrderTensor().basis_voigt_strain()
SecondOrderTensor().basis_voigt_stress()
SecondOrderTensor().basis_unsym()
SecondOrderTensor(dim=2).basis_mandel()
SecondOrderTensor(dim=2).basis_unsym()