Mechanics Tools

mechanics_tool.stress(u, lame_mu, lame_lambda, dim)[source]

Calculus of the stress tensor, for elasticity law as

\[\sigma(u) = \lambda \nabla\cdot u * \text{Id} + 2\mu * \varepsilon(u)\]

with \(\varepsilon(u)\) computed with the function mecanics_tool.strain().

Parameters:
  • v (fem.Function) – The displacement field function.

  • lame_mu (float) – the \(\mu\) Lame coefficient.

  • lame_lambda (float) – the \(\lambda\) Lame coefficient.

  • dim (int) – the dimension of the displacement field.

Returns:

Expression of the stress tensor.

Return type:

fem.Expression

mechanics_tool.strain(v)[source]

Calculus of the strain tensor, for elasticity law as:

\[\varepsilon(u) = \frac{1}{2}(\nabla\cdot u + \nabla^{T} \cdot u).\]
Parameters:

v (fem.Function) – The displacement field function.

Returns:

Expression of the strain tensor.

Return type:

fem.Expression

mechanics_tool.lame_compute(E, v)[source]

Calculus of the lame coefficient with Young modulus and Poisson coefficient as :

\[\begin{split}\begin{align} \mu &= \frac{E}{2(1+\nu)} \\ \lambda &= \frac{E\nu}{(1+\nu)(1-2\nu)} \end{align}\end{split}\]

with \(\sigma(u)\) computed with the function mecanics_tool.stress().

Parameters:
  • E (float) – The Young modulus.

  • v (float) – The Poisson coefficient.

Returns:

Lame \(\mu\) and Lame \(\lambda\) coefficients.

Return type:

float, float

mechanics_tool.von_mises(u, lame_mu, lame_lambda, dim)[source]

Calculus of the Von Mises stress value:

\[\sigma_{VM} = \sigma(u) - \frac{1}{3}\text{Tr}(\sigma(u))\text{Id}\]

with \(\sigma(u)\) compute with the function mecanics_tool.stress().

Parameters:
  • u (fem.Function) – The displacement field function.

  • lame_mu (float) – The Lame \(\mu\) coefficient.

  • lame_lambda (float) – The lame \(\lambda\) coefficient.

  • dim (float) – The dimension of the displacement field.

Returns:

The value of the Von Mises stress constraint.

Return type:

fem.Function