Elasticipy.FourthOrderTensor module

class Elasticipy.FourthOrderTensor.ComplianceTensor(C, **kwargs)[source]

Bases: StiffnessTensor

Class for manipulating compliance tensors

C11_C12_factor = 2.0
Hill_average()[source]

Compute the (Voigt-Reuss-)Hill average ofthe stiffness tensor. If the tensor contains no orientation, we assume isotropic behaviour. Otherwise, the mean is computed over all orientations.

Parameters:

orientations (np.ndarray or None) – Set of m orientation matrices, defined as a [m, 3, 3] array. If None, uniform distribution is assumed, resulting in isotropic tensor

Returns:

Voigt-Reuss-Hill average of tensor

Return type:

StiffnessTensor

See also

Voigt_average

compute the Voigt average

Reuss_average

compute the Reuss average

Reuss_average()[source]

Compute the Reuss average of the stiffness tensor. If the tensor contains no orientation, we assume isotropic behaviour. Otherwise, the mean is computed over all orientations.

Returns:

Reuss average of stiffness tensor

Return type:

StiffnessTensor

See also

Voigt_average

compute the Voigt average

Hill_average

compute the Voigt-Reuss-Hill average

Voigt_average()[source]

Compute the Voigt average of the stiffness tensor. If the tensor contains no orientation, we assume isotropic behaviour. Otherwise, the mean is computed over all orientations.

Returns:

Voigt average of stiffness tensor

Return type:

StiffnessTensor

See also

Reuss_average

compute the Reuss average

Hill_average

compute the Voigt-Reuss-Hill average

component_prefix = 'S'
inv()[source]

Compute the reciprocal stiffness tensor

Returns:

Reciprocal tensor

Return type:

StiffnessTensor

classmethod isotropic(**kwargs)[source]

Create an isotropic compliance tensor for either E, nu, lame1 or lame2. Exactly two of these parameters must be provided.

Parameters:

kwargs (keyword arguments) – E, nu, lame1 or lame2, passed to the StiffnessTensor.isotropic constructor

See also

fromCrystalSymmetry

Define a stiffness tensor, taking advantage of crystal symmetry

tensor_name = 'Compliance'
voigt_map = array([[1., 1., 1., 2., 2., 2.],        [1., 1., 1., 2., 2., 2.],        [1., 1., 1., 2., 2., 2.],        [2., 2., 2., 4., 4., 4.],        [2., 2., 2., 4., 4., 4.],        [2., 2., 2., 4., 4., 4.]])
class Elasticipy.FourthOrderTensor.StiffnessTensor(S, **kwargs)[source]

Bases: SymmetricTensor

Class for manipulating fourth-order stiffness tensors.

C11_C12_factor = 0.5
Christoffel_tensor(u)[source]

Create the Christoffel tensor along a given direction, or set or directions.

Parameters:

u (list or np.ndarray) – 3D direction(s) to compute the Christoffel tensor along with

Returns:

Gamma – Array of Christoffel tensor(s). if u is a list of directions, Gamma[i] is the Christoffel tensor for direction u[i].

Return type:

np.ndarray

See also

wave_velocity

computes the p- and s-wave velocities.

Notes

For a given stiffness tensor C and a given unit vector u, the Christoffel tensor is defined as [2] :

\[M_{ij} = C_{iklj}.u_k.u_l\]
Hill_average()[source]

Compute the (Voigt-Reuss-)Hill average ofthe stiffness tensor. If the tensor contains no orientation, we assume isotropic behaviour. Otherwise, the mean is computed over all orientations.

Parameters:

orientations (np.ndarray or None) – Set of m orientation matrices, defined as a [m, 3, 3] array. If None, uniform distribution is assumed, resulting in isotropic tensor

Returns:

Voigt-Reuss-Hill average of tensor

Return type:

StiffnessTensor

See also

Voigt_average

compute the Voigt average

Reuss_average

compute the Reuss average

property Poisson_ratio

Directional Poisson’s ratio

Returns:

Poisson’s ratio

Return type:

HyperSphericalFunction

Reuss_average()[source]

Compute the Reuss average of the stiffness tensor. If the tensor contains no orientation, we assume isotropic behaviour. Otherwise, the mean is computed over all orientations.

Returns:

Reuss average of stiffness tensor

Return type:

StiffnessTensor

See also

Voigt_average

compute the Voigt average

Hill_average

compute the Voigt-Reuss-Hill average

Voigt_average()[source]

Compute the Voigt average of the stiffness tensor. If the tensor contains no orientation, we assume isotropic behaviour. Otherwise, the mean is computed over all orientations.

Returns:

Voigt average of stiffness tensor

Return type:

StiffnessTensor

See also

Reuss_average

compute the Reuss average

Hill_average

compute the Voigt-Reuss-Hill average

property Young_modulus

Directional Young’s modulus

Returns:

Young’s modulus

Return type:

SphericalFunction

inv()[source]

Compute the reciprocal compliance tensor

Returns:

Reciprocal tensor

Return type:

ComplianceTensor

classmethod isotropic(E=None, nu=None, lame1=None, lame2=None, phase_name=None)[source]

Create an isotropic stiffness tensor from two elasticity coefficients, namely: E, nu, lame1, or lame2. Exactly two of these coefficients must be provided.

Parameters:
  • E (float, None) – Young modulus

  • nu (float, None) – Poisson ratio

  • lame1 (float, None) – First Lamé coefficient

  • lame2 (float, None) – Second Lamé coefficient

  • phase_name (str, None) – Name to print

Return type:

Corresponding isotropic stiffness tensor

Examples

On can check that the shear modulus for steel is around 82 GPa:

>>> from Elasticipy.FourthOrderTensor import StiffnessTensor
>>> C=StiffnessTensor.isotropic(E=210e3, nu=0.28)
>>> C.shear_modulus
Hyperspherical function
Min=82031.24999999991, Max=82031.24999999997
property shear_modulus

Directional shear modulus

Returns:

Shear modulus

Return type:

HyperSphericalFunction

tensor_name = 'Stiffness'
wave_velocity(rho)[source]

Compute the wave velocities, given the mass density.

Parameters:

rho (float) – mass density. Its unit must be consistent with that of the stiffness tensor. See notes for hints.

See also

ChristoffelTensor

Computes the Christoffel tensor along a given direction

Returns:

  • c_p (SphericalFunction) – Velocity of the primary (compressive) wave

  • c_s1 (SphericalFunction) – Velocity of the fast secondary (shear) wave

  • c_s2 (SphericalFunction) – Velocity of the slow secondary (shear) wave

Notes

The estimation of the wave velocities is made by finding the eigenvalues of the Christoffel tensor [2].

One should double-check the units. The table below provides hints about the unit you get, depending on the units you use for stiffness and the mass density:

Stiffness

Mass density

Velocities

Notes

Pa (N/m²)

kg/m³

m/s

SI units

GPa (10⁹ Pa)

kg/dm³

km/s

Conversion factor

GPa (10³ N/mm²)

kg/mm³

m/s

Consistent units

MPa (10⁶ Pa)

kg/m³

km/s

Conversion factor

MPa (10³ N/mm²)

g/mm³

m/s

Consistent units

References

class Elasticipy.FourthOrderTensor.SymmetricTensor(M, phase_name='', symmetry='Triclinic', orientations=None)[source]

Bases: object

Template class for manipulating symmetric fourth-order tensors.

matrix

(6,6) matrix gathering all the components of the tensor, using the Voigt notation.

Type:

np.ndarray

symmetry

Symmetry of the tensor

Type:

str

C11_C12_factor = 0.5
component_prefix = 'C'
classmethod fromCrystalSymmetry(symmetry='Triclinic', point_group=None, diad='x', phase_name=None, **kwargs)[source]

Create a fourth-order tensor from limited number of components, taking advantage of crystallographic symmetries

Parameters:
  • symmetry (str, default Triclinic) – Name of the crystallographic symmetry

  • point_group (str) – Point group of the considered crystal. Only used (and mandatory) for tetragonal and trigonal symmetries.

  • diad (str {'x', 'y'}, default 'x') – Alignment convention. Sets whether x||a or y||b. Only used for monoclinic symmetry.

  • phase_name (str, default None) – Name to use when printing the tensor

  • kwargs – Keywords describing all the necessary components, depending on the crystal’s symmetry and the type of tensor. For Stiffness, they should be named as ‘Cij’ (e.g. C11=…, C12=…). For Comliance, they should be named as ‘Sij’ (e.g. S11=…, S12=…). See examples below.

Return type:

FourthOrderTensor

See also

StiffnessTensor.isotropic

creates an isotropic stiffness tensor from two paremeters (e.g. E and v).

Notes

The relationships between the tensor’s components depend on the crystallogrpahic symmetry [1].

References

Examples

>>> from Elasticipy.FourthOrderTensor import StiffnessTensor
>>> StiffnessTensor.fromCrystalSymmetry(symmetry='monoclinic', diad='y', phase_name='TiNi',
...                                     C11=231, C12=127, C13=104,
...                                     C22=240, C23=131, C33=175,
...                                     C44=81, C55=11, C66=85,
...                                     C15=-18, C25=1, C35=-3, C46=3)
Stiffness tensor (in Voigt notation) for TiNi:
[[231. 127. 104.   0. -18.   0.]
 [127. 240. 131.   0.   1.   0.]
 [104. 131. 175.   0.  -3.   0.]
 [  0.   0.   0.  81.   0.   3.]
 [-18.   1.  -3.   0.  11.   0.]
 [  0.   0.   0.   3.   0.  85.]]
Symmetry: monoclinic
>>> from Elasticipy.FourthOrderTensor import ComplianceTensor
>>> ComplianceTensor.fromCrystalSymmetry(symmetry='monoclinic', diad='y', phase_name='TiNi',
...                                      S11=8, S12=-3, S13=-2,
...                                      S22=8, S23=-5, S33=10,
...                                      S44=12, S55=116, S66=12,
...                                      S15=14, S25=-8, S35=0, S46=0)
Compliance tensor (in Voigt notation) for TiNi:
[[  8.  -3.  -2.   0.  14.   0.]
 [ -3.   8.  -5.   0.  -8.   0.]
 [ -2.  -5.  10.   0.   0.   0.]
 [  0.   0.   0.  12.   0.   0.]
 [ 14.  -8.   0.   0. 116.   0.]
 [  0.   0.   0.   0.   0.  12.]]
Symmetry: monoclinic
full_tensor()[source]

Returns the full (unvoigted) tensor, as a [3, 3, 3, 3] array

Returns:

Full tensor (4-index notation)

Return type:

np.ndarray

rotate(rotation)[source]

Apply a single rotation to a tensor, and return its component into the rotated frame.

Parameters:

rotation (Rotation) – Rotation to apply

Returns:

Rotated tensor

Return type:

SymmetricTensor

tensor_name = 'Symmetric'
voigt_map = array([[1., 1., 1., 1., 1., 1.],        [1., 1., 1., 1., 1., 1.],        [1., 1., 1., 1., 1., 1.],        [1., 1., 1., 1., 1., 1.],        [1., 1., 1., 1., 1., 1.],        [1., 1., 1., 1., 1., 1.]])
Elasticipy.FourthOrderTensor.unvoigt_index(i)[source]

Translate the one-index notation to two-index notation

Parameters:

i (int or np.ndarray) – Index to translate

Elasticipy.FourthOrderTensor.voigt_indices(i, j)[source]

Translate the two-index notation to one-index notation

Parameters:
  • i (int or np.ndarray) – First index

  • j (int or np.ndarray) – Second index

Return type:

Index in the vector of length 6