elaston.green module

class elaston.green.Anisotropic(elastic_tensor: array, n_mesh: int = 100, optimize: bool = True)[source]

Bases: Green

Green’s function according to the linear elasticity theory. According to the equilibrium condition, we have:

\[\frac{\partial \sigma_{ij}}{\partial r_j} + f_i = 0\]

where \(\sigma_{ij}\) is stress tensor and \(f_i\) is force. From this, we obtain the differential equations:

\[C_{ijkl}\frac{\partial^2 u_k}{\partial r_j\partial r_l} + f_i = 0\]

with the elastic tensor \(C_{ijkl}\) and the displacement field \(u_k\). This defines the Green’s function:

\[C_{ijkl}\frac{\partial^2 G_{km}}{\partial r_j\partial r_l} + \delta_{im}\delta(\vec r) = 0\]

The Fourier transform of this equation can be analytically solved for the isotropic elasticity theory. For the anisotropic case, the integration along the azimuthal angle is required.

This class calculates the Green’s functions (and their derivatives) for the anisotropic elasticity theory based on Barnett’s approach. All notations follow Barnett’s paper.

[Link](https://doi.org/10.1002/pssb.2220490238)

Notes:

  • In some cases this class can become extremely RAM-intensive. If possible do not keep the results in a variable.

  • If the medium is isotropic, use Isotropic instead, which has analytical solutions and is therefore much faster.

property Air: ndarray
property F: ndarray
property MF: ndarray
property Ms: ndarray

Inverse of the matrix Ms.

property T: ndarray

Normalized r.

property z: ndarray

Unit vector in the direction of the azimuthal angle.

property zT: ndarray
class elaston.green.Green[source]

Bases: ABC

Green’s function according to the linear elasticity theory. According to the equilibrium condition, we have:

\[\frac{\partial \sigma_{ij}}{\partial r_j} + f_i = 0\]

where \(\sigma_{ij}\) is stress tensor and \(f_i\) is force. From this, we obtain the differential equations:

\[C_{ijkl}\frac{\partial^2 u_k}{\partial r_j\partial r_l} + f_i = 0\]

with the elastic tensor \(C_{ijkl}\) and the displacement field \(u_k\). This defines the Green’s function:

\[C_{ijkl}\frac{\partial^2 G_{km}}{\partial r_j\partial r_l} + \delta_{im}\delta(\vec r) = 0\]

The Fourier transform of this equation can be analytically solved for the isotropic elasticity theory. For the anisotropic case, the integration along the azimuthal angle is required.

get_greens_function(r: ndarray, derivative: int = 0, fourier: bool = False, check_unique: bool = False) ndarray[source]
Parameters:
  • r ((n,3)-array) – Positions for which to calculate the Green’s function

  • derivative (int) – The order of the derivative. Ignored if fourier=True

  • fourier (bool) – If True, the Green’s function of the reciprocal space is returned.

  • check_unique (bool) – If True, elaston checks whether there are duplicate values and avoids calculating the Green’s function multiple times for the same values

Returns:

Green’s function values. If derivative=0 or

fourier=True, (n, 3)-array is returned. For each derivative increment, a 3d-axis is added.

Return type:

(numpy.array)

class elaston.green.Isotropic(poissons_ratio: float, shear_modulus: float, min_distance: float = 0, optimize: bool = True)[source]

Bases: Green

Green’s function according to the linear elasticity theory. According to the equilibrium condition, we have:

\[\frac{\partial \sigma_{ij}}{\partial r_j} + f_i = 0\]

where \(\sigma_{ij}\) is stress tensor and \(f_i\) is force. From this, we obtain the differential equations:

\[C_{ijkl}\frac{\partial^2 u_k}{\partial r_j\partial r_l} + f_i = 0\]

with the elastic tensor \(C_{ijkl}\) and the displacement field \(u_k\). This defines the Green’s function:

\[C_{ijkl}\frac{\partial^2 G_{km}}{\partial r_j\partial r_l} + \delta_{im}\delta(\vec r) = 0\]

The Fourier transform of this equation can be analytically solved for the isotropic elasticity theory. For the anisotropic case, the integration along the azimuthal angle is required.

This class calculates the Green’s function according to the isotropic elasticity theory. For anisotropic calculations, cf. Anisotropic.

Green’s function G is given by:

property A: float[source]

First coefficient of the Green’s function. For more, cf. DocString in the class level.

property B: float[source]

Second coefficient of the Green’s function. For more, cf. DocString in the class level.

G(r: ndarray) ndarray[source]

Green’s function.

G_fourier(k: ndarray) ndarray[source]

Fourier transform of the Green’s function

dG(r: ndarray) ndarray[source]

First derivative of the Green’s function.

ddG(r: ndarray) ndarray[source]

Second derivative of the Green’s function.

elaston.green.get_greens_function(C: ndarray, x: ndarray, derivative: int = 0, fourier: bool = False, n_mesh: int = 100, optimize: bool = True, check_unique: bool = False) ndarray[source]

Green’s function of the equilibrium condition:

C_ijkl d^2u_k/dx_jdx_l = 0

Parameters:
  • C ((3, 3, 3, 3)-array) – Elastic tensor

  • x ((n, 3)-array) – Positions in real space or reciprocal space (if fourier=True).

  • derivative (int) – 0th, 1st or 2nd derivative of the Green’s function. Ignored if fourier=True.

  • fourier (bool) – If True, the Green’s function of the reciprocal space is returned.

  • n_mesh (int) – Number of mesh points in the radial integration in case if anisotropic Green’s function (ignored if isotropic=True or fourier=True)

  • optimize (bool) – cf. optimize in numpy.einsum

  • check_unique (bool) – Whether to check the unique positions

Returns:

Green’s function values for the given positions

Return type:

((n, 3, 3)-array)

Green’s function according to the linear elasticity theory. According to the equilibrium condition, we have:

\[\frac{\partial \sigma_{ij}}{\partial r_j} + f_i = 0\]

where \(\sigma_{ij}\) is stress tensor and \(f_i\) is force. From this, we obtain the differential equations:

\[C_{ijkl}\frac{\partial^2 u_k}{\partial r_j\partial r_l} + f_i = 0\]

with the elastic tensor \(C_{ijkl}\) and the displacement field \(u_k\). This defines the Green’s function:

\[C_{ijkl}\frac{\partial^2 G_{km}}{\partial r_j\partial r_l} + \delta_{im}\delta(\vec r) = 0\]

The Fourier transform of this equation can be analytically solved for the isotropic elasticity theory. For the anisotropic case, the integration along the azimuthal angle is required.