class matlantis_features.features.elasticity.tensors.DeformTensor(strain_matrix: StrainTensor)#

Bases: _Tensor3x3

Deformation tensor object.

Methods

__init__(strain_matrix)

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__(strain_matrix: StrainTensor) None#

Initialize an instance.

Parameters

strain_matrix (StrainTensor) – Strain tensor object converted to the deformation tensor.

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