Skip to content

tensor

Tensor2

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

matrix instance-attribute

matrix: MatrixXf = asarray(data, dtype=numpy_float)

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.

__add__

__add__(other: 'Tensor2' | ndarray | float) -> 'Tensor2'

Add a tensor/scalar to the tensor.

__init__

__init__(data: ndarray)

Initialize the tensor.

PARAMETER DESCRIPTION
data

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

TYPE: ndarray

__matmul__

__matmul__(other: 'Tensor2' | ndarray) -> 'Tensor2'

Multiply the tensor by another tensor.

__mul__

__mul__(other: 'Tensor2' | ndarray | float) -> 'Tensor2'

Multiply a tensor/scalar to the tensor.

__neg__

__neg__()

Negate the tensor.

__radd__

__radd__(other: 'Tensor2' | float) -> 'Tensor2'

Add a tensor to the tensor/scalar.

__rmul__

__rmul__(other: 'Tensor2' | float) -> 'Tensor2'

Multiply the tensor by a tensor/scalar.

__rsub__

__rsub__(other: 'Tensor2' | float) -> 'Tensor2'

Subtract the tensor from a tensor/scalar.

__rtruediv__

__rtruediv__(other: float) -> 'Tensor2'

Divide the tensor by a scalar.

__sub__

__sub__(other: 'Tensor2' | ndarray | float) -> 'Tensor2'

Subtract a tensor/scalar from the tensor.

__truediv__

__truediv__(other: float) -> 'Tensor2'

Divide the tensor by a scalar.

cos3theta

cos3theta() -> float

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

deviatoric

deviatoric() -> ndarray

Calculate the deviatoric tensor.

lode

lode() -> float

Calculate the Lode angle 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.

principals

principals() -> ndarray

Calculate the principal values 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