ogstools.variables.tensor_math module#
Common tensor transformation operations.
They can be used as they are, but are also part of
ogstools.variables.matrix.Matrix
variables.
All input arrays are expected to be in vector notation of symmetric tensors in
the form of:
[xx, yy, zz, xy] for 2D and
[xx, yy, zz, xy, yz, xz] for 3D.
This notation style is the default output of OGS:
A better overview for the theoretical background of the equations can be found here, for example:
<https://en.wikipedia.org/wiki/Cauchy_stress_tensor#Cauchy’s_stress_theorem%E2%80%94stress_tensor>
- ogstools.variables.tensor_math.sym_tensor_to_mat(values)[source]#
Convert an symmetric tensor to a 3x3 matrix.
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.trace(values)[source]#
Return the trace of the given symmetric tensor.
\(tr(\mathbf{\sigma}) = \sum\limits_{i=1}^3 \sigma_{ii}\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.matrix_trace(values)[source]#
Return the trace of the given matrix.
\(tr(\mathbf{\sigma}) = \sum\limits_{i=1}^3 \sigma_{ii}\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.eigenvalues(values)[source]#
Return the eigenvalues.
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.eigenvectors(values)[source]#
Return the eigenvectors.
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.det(values)[source]#
Return the determinants.
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.frobenius_norm(values)[source]#
Return the Frobenius norm.
\(||\mathbf{\sigma}||_F = \sqrt{ \sum\limits_{i=1}^m \sum\limits_{j=1}^n |\sigma_{ij}|^2 }\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.invariant_1(values)[source]#
Return the first invariant.
\(I1 = tr(\mathbf{\sigma})\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.invariant_2(values)[source]#
Return the second invariant.
\(I2 = \frac{1}{2} \left[(tr(\mathbf{\sigma}))^2 - tr(\mathbf{\sigma}^2) \right]\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.invariant_3(values)[source]#
Return the third invariant.
\(I3 = det(\mathbf{\sigma})\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.mean(values)[source]#
Return the mean value. Also called hydrostatic component or octahedral normal component.
\(\pi = \frac{1}{3} I1\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.effective_pressure(values)[source]#
Return the effective pressure.
\(\pi = -\frac{1}{3} I1\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.hydrostatic_component(values)[source]#
Return the hydrostatic component.
\(p_{ij} = \pi \delta_{ij}\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.deviator(values)[source]#
Return the deviator.
\(s_{ij} = \sigma_{ij} - \pi \delta_{ij}\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.deviator_invariant_1(values)[source]#
Return the first invariant of the deviator.
\(J1 = 0\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.deviator_invariant_2(values)[source]#
Return the second invariant of the deviator.
\(J2 = \frac{1}{2} tr(\mathbf{s}^2)\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.deviator_invariant_3(values)[source]#
Return the third invariant of the deviator.
\(J3 = \frac{1}{3} tr(\mathbf{s}^3)\)
- Return type:
PlainQuantity | ndarray
- ogstools.variables.tensor_math.octahedral_shear(values)[source]#
Return the octahedral shear value.
\(\tau_{oct} = \sqrt{\frac{2}{3} J2}\)
- Return type:
PlainQuantity | ndarray