Skip to content

tensor

Tensor2

Class for the 2nd-order tensor (3, 3) representation.

matrix instance-attribute

matrix: MatrixXf = data

I1

I1() -> float

Calculate the first invariant of the tensor.

I2

I2() -> float

Calculate the second invariant of the tensor.

I3

I3() -> float

Calculate the third invariant of the tensor.

J2

J2() -> float

Calculate the second deviatoric invariant of the tensor.

J3

J3() -> float

Calculate the third deviatoric invariant of the tensor.

R

R() -> float

Calculate the R-value of the tensor.

__add__

__add__(other: Union['Tensor2', ndarray, float]) -> 'Tensor2'

Add a tensor/scalar to the tensor.

__init__

__init__(data: ndarray)

Initialize the tensor.

Warnings
  • Please ensure that the input matrix is symmetric, as the tensor is expected to be symmetric.
PARAMETER DESCRIPTION
data

The data of the tensor. A 2D array with shape (3, 3).

TYPE: ndarray

__matmul__

__matmul__(other: Union['Tensor2', ndarray]) -> 'Tensor2'

Multiply the tensor by another tensor.

__mul__

__mul__(other: Union['Tensor2', ndarray, float]) -> 'Tensor2'

Multiply a tensor/scalar to the tensor.

__neg__

__neg__()

Negate the tensor.

__radd__

__radd__(other: Union['Tensor2', float]) -> 'Tensor2'

Add a tensor to the tensor/scalar.

__rmul__

__rmul__(other: Union['Tensor2', float]) -> 'Tensor2'

Multiply the tensor by a tensor/scalar.

__rsub__

__rsub__(other: Union['Tensor2', float]) -> 'Tensor2'

Subtract the tensor from a tensor/scalar.

__rtruediv__

__rtruediv__(other: float) -> 'Tensor2'

Divide the tensor by a scalar.

__sub__

__sub__(other: Union['Tensor2', ndarray, float]) -> 'Tensor2'

Subtract a tensor/scalar from the tensor.

__truediv__

__truediv__(other: float) -> 'Tensor2'

Divide the tensor by a scalar.

b

b() -> float

Calculate the b-value of the tensor.

cos3theta

cos3theta() -> float

Calculate the cosine of 3 times of the Lode angle of the tensor.

deviatoric

deviatoric() -> ndarray

Calculate the deviatoric tensor.

eta

eta() -> float

Calculate the eta value of the tensor.

lode

lode() -> float

Calculate the Lode angle (-pi/6, pi/6) of the tensor.

mean

mean() -> ndarray

Calculate the mean tensor.

norm

norm() -> float

Calculate the norm of the tensor.

normalized

normalized() -> 'np.ndarray'

Calculate the normalized tensor.

p

p() -> float

Calculate the mean value of the tensor.

p1

p1() -> float

Calculate the maximum principal value of the tensor.

p2

p2() -> float

Calculate the median principal value of the tensor.

p3

p3() -> float

Calculate the minimum principal value of the tensor.

principals

principals() -> ndarray

Calculate the principal values of the tensor.

q

q() -> float

Calculate the deviatoric value of the tensor.

theta

theta() -> float

Calculate the Lode angle (0, pi/3) of the tensor.

toVector

toVector() -> ndarray

Convert the tensor to a vector.

tensorFromVector

tensorFromVector(vec: ndarray) -> Tensor2

Create a tensor from a vector.

PARAMETER DESCRIPTION
vec

The data of the tensor in a vector. A 1D array with shape (6,).

TYPE: ndarray