pysdic.triangle_3_compute_elements_strains#

triangle_3_compute_elements_strains(vertices_coordinates, connectivity, displacements)[source]#

Compute the strain tensor for each triangular element in the mesh given the vertex displacements.

The strain tensor is computed using the linear strain-displacement relationship for triangular elements.

\[\boldsymbol{\varepsilon} = \frac{1}{2} \left( \nabla \mathbf{U} + (\nabla \mathbf{U})^T \right)\]

where \(\mathbf{U}\) is the displacement vector.

Note

The inputs vertices_coordinates and displacements will be converted to numpy.float64 for computation. The input connectivity will be converted to numpy.int64 for computation.

Warning

No tests are performed to check if the inputs array content are consistent (e.g., if the connectivity contains invalid vertex indices, if the displacements are valid, …). Only the shapes and types of the input arrays are validated. The behavior of the function is undefined if the input arrays are not consistent.

Parameters:
  • vertices_coordinates (ArrayLike) – An array of shape \((N_v, E)\) representing the coordinates of the vertices in the embedded space of dimension \(E\).

  • connectivity (ArrayLike) – An array of shape \((N_e, 3)\) representing the connectivity of the triangular elements.

  • displacements (ArrayLike) – An array of shape \((N_v, E)\) representing the displacements of the vertices in the embedded space of dimension \(E\).

Returns:

An array of shape \((N_e, E, E)\) representing the strain tensor for each triangular element along the global coordinates \((x, y, z, ...)\).

Return type:

numpy.ndarray

Raises:
  • TypeError – If the inputs are not numpy arrays.

  • ValueError – If the input arrays do not have the correct shapes.

Notes

The strain tensor is computed as the symmetric part of the displacement gradient tensor.

\[\boldsymbol{\varepsilon} = \frac{1}{2} \left( \nabla \mathbf{U} + (\nabla \mathbf{U})^T \right)\]

The displacement gradient tensor \(\nabla \mathbf{U}\) is obtained by differentiating the displacement field with respect to the global coordinates using the shape function derivatives for triangular elements such as:

\[\nabla_X U(\xi, \eta, \zeta, ...) = J \cdot (J^T J)^{-1} \cdot \sum_{i=1}^{N_{vpe}} \nabla_{\xi} N_i(\xi, \eta, \zeta, ...) U_i\]

where \(J\) is the Jacobian matrix of the transformation from natural coordinates to global coordinates, \(N_i\) are the shape functions, and \(U_i\) are the nodal displacements.

If the embedded space dimension \(E\) is equal to the topological dimension of the element (\(K=2\) for triangular elements), the strain tensor can be directly compute using Jacobian inverse :

\[\nabla_X U(\xi, \eta, \zeta, ...) = J^{-1} \cdot \sum_{i=1}^{N_{vpe}} \nabla_{\xi} N_i(\xi, \eta, \zeta, ...) U_i\]

See also

pysdic.compute_jacobian_matrix

For constructing the Jacobian matrix \(J\) of the transformation from natural coordinates \((\xi, \eta, \zeta, ...)\) to global coordinates \((x, y, z, ...)\).

pysdic.compute_property_derivative

Derivate a property defined at the nodes of a mesh to given integration points within elements with respect to global coordinates \((x,y,z,...)\) using shape function derivatives.

Examples

Computing the strain tensor for triangular elements:

 1import numpy as np
 2from pysdic import triangle_3_compute_elements_strains
 3
 4vertices = np.array([[0, 0, 0],
 5                     [1, 0, 0],
 6                     [0, 1, 0],
 7                     [0, 0, 1]])  # shape (4, 3)
 8
 9connectivity = np.array([[0, 1, 2],
10                         [0, 1, 3],
11                         [0, 2, 3],
12                         [1, 2, 3]])  # shape (4, 3)
13
14displacements = np.array([[0, 0, 0],
15                          [0.1, 0, 0],
16                          [0, 0.1, 0],
17                          [0, 0, 0.1]])  # shape (4, 3)
18
19strains = triangle_3_compute_elements_strains(vertices, connectivity, displacements)
20print(strains)
[[[ 0.1  0.   0. ]
  [ 0.   0.1  0. ]
  [ 0.   0.   0. ]]

 [[ 0.1  0.   0. ]
  [ 0.   0.   0. ]
  [ 0.   0.   0.1]]

 [[ 0.   0.   0. ]
  [ 0.   0.1  0. ]
  [ 0.   0.   0.1]]

 [[ 0.1 -0.1 -0.1]
  [-0.1  0.1 -0.1]
  [-0.1 -0.1  0.1]]]