Math#

Functions#

Functions#

This module provides utility functions for computing the Macaulay brackets, which are commonly used in various mathematical and engineering applications. The Macaulay bracket is a piecewise function that extracts the positive or negative part of a real number. These functions are useful for handling operations that involve conditional expressions in a continuous and differentiable manner.

phasefieldx.Math.functions.macaulay_bracket_negative(x)[source]#

Compute the Macaulay bracket (negative part) of a real number x.

Parameters:
xfloat or numpy.ndarray

Real number or array of real numbers.

Returns:
float or numpy.ndarray

Macaulay bracket of x, which is defined as 0.5 * (x - abs(x)).

phasefieldx.Math.functions.macaulay_bracket_positive(x)[source]#

Compute the Macaulay bracket (positive part) of a real number x.

Parameters:
xfloat or numpy.ndarray

Real number or array of real numbers.

Returns:
float or numpy.ndarray

Macaulay bracket of x, which is defined as 0.5 * (x + abs(x)).

Tensor decomposition#

Tensor Decomposition#

This module provides functions for decomposing tensors into their deviatoric, volumetric, positive spectral, and negative spectral parts. These decompositions are fundamental in continuum mechanics and material science for understanding the behavior of materials under various stress and strain conditions.

phasefieldx.Math.tensor_decomposition.deviatoric_part(T)[source]#

Computes the deviatoric part of a given tensor.

Parameters:
T: Tensor

The input tensor for which the deviatoric part needs to be computed.

Returns:
Tensor

The deviatoric part of the input tensor, computed as the tensor minus one-third of its trace times the identity tensor.

Notes

The deviatoric part of a tensor is defined as the part of the tensor that remains after subtracting the isotropic part. In 3D, for a second-order tensor T, the deviatoric part D is given by \(D = T - (1/3) tr(T) I\), where tr(T) is the trace of T and I is the identity tensor.

phasefieldx.Math.tensor_decomposition.spectral_negative_part(T)[source]#

Computes the spectral negative part of a given tensor.

Parameters:
T: Tensor

The input tensor for which the spectral negative part needs to be computed.

Returns:
Tensor

The spectral negative part of the input tensor.

Notes

The tensor is split into its positive and negative parts through spectral decomposition, \(\boldsymbol \epsilon=\sum_{i=1}^{\alpha} \epsilon^i \boldsymbol n^i \otimes \boldsymbol n^i\) where \(\epsilon^i\) are the principal strains, and \(\boldsymbol n^i\) are the principal strains directions. The positive and negative parts of the tensor \(\boldsymbol \epsilon = \boldsymbol \epsilon^+ + \boldsymbol \epsilon^-\), are defined as:

  • \(\boldsymbol \epsilon^+: = \sum_{i=1}^{\alpha} \langle \epsilon^i \rangle^+ \boldsymbol n^i \otimes \boldsymbol n^i\),

  • \(\boldsymbol \epsilon^-: = \sum_{i=1}^{\alpha} \langle \epsilon^i \rangle^- \boldsymbol n^i \otimes \boldsymbol n^i\).

In which \(\langle\rangle^{\pm}\) are the bracket operators. \(\langle x \rangle^+:=\frac{x+|x|}{2}\) and $\langle x \rangle^-:=\frac{x-|x|}{2}$.

phasefieldx.Math.tensor_decomposition.spectral_positive_part(T)[source]#

Computes the spectral possitive part of a given tensor.

Parameters:
T: Tensor

The input tensor for which the spectral possitive part needs to be computed.

Returns:
Tensor

The spectral possitive part of the input tensor.

Notes

The tensor is split into its positive and negative parts through spectral decomposition, \(\boldsymbol \epsilon=\sum_{i=1}^{\alpha} \epsilon^i \boldsymbol n^i \otimes \boldsymbol n^i\) where \(\epsilon^i\) are the principal strains, and \(\boldsymbol n^i\) are the principal strains directions. The positive and negative parts of the tensor \(\boldsymbol \epsilon = \boldsymbol \epsilon^+ + \boldsymbol \epsilon^-\), are defined as:

  • \(\boldsymbol \epsilon^+: = \sum_{i=1}^{\alpha} \langle \epsilon^i \rangle^+ \boldsymbol n^i \otimes \boldsymbol n^i\),

  • \(\boldsymbol \epsilon^-: = \sum_{i=1}^{\alpha} \langle \epsilon^i \rangle^- \boldsymbol n^i \otimes \boldsymbol n^i\).

In which \(\langle\rangle^{\pm}\) are the bracket operators. \(\langle x \rangle^+:=\frac{x+|x|}{2}\), and $\langle x \rangle^-:=\frac{x-|x|}{2}$.

phasefieldx.Math.tensor_decomposition.volumetric_part(T)[source]#

Computes the volumetric part of a given tensor.

Parameters:
T: Tensor

The input tensor for which the volumetric part needs to be computed.

Returns:
Tensor

The volumetric part of the input tensor, computed as the tensor minus its deviatoric part.

Notes

The volumetric part of a tensor is defined as the isotropic part of the tensor, i.e., the part that is invariant under rotations. In 3D, for a second-order tensor T, the volumetric part V is given by \(V = T - dev(T)\) where dev(T) is the deviatoric part of T.