class matlantis_features.features.elasticity.tensors.StressTensor(stress: ndarray)#

Bases: _TensorVoigt

Stress tensor object.

Methods

__init__(stress)

Initialize an instance.

get_by_voigt(vix)

Get tensor element by voigt index.

set_by_voigt(vix, value)

Set tensor element by voigt index.

to_3x3_ndarray()

Get 3×3 matrix representation of this tensor.

to_voigt_ndarray()

Get 6×1 Voigt representation of this tensor.

__init__(stress: ndarray) None#

Initialize an instance.

Parameters

stress (np.ndarray) – Stress tensor value in Voigt’s notation.

get_by_voigt(vix: int) float#

Get tensor element by voigt index.

Parameters

vix (int) – Voigt index (0-5).

Returns

Value of the tensor of the specified index.

Return type

float

set_by_voigt(vix: int, value: float) None#

Set tensor element by voigt index.

Parameters
  • vix (int) – Voigt index (0-5).

  • value (float) – Value to be stored in the tensor.

to_3x3_ndarray() ndarray#

Get 3×3 matrix representation of this tensor.

Returns

numpy array of (3,3) shape.

Return type

np.ndarray

to_voigt_ndarray() ndarray#

Get 6×1 Voigt representation of this tensor.

Returns

numpy array of (6,1) shape.

Return type

np.ndarray