get_strain

torch_sim.elastic.get_strain(deformed_state, reference_state=None)[source]

Calculate strain tensor in Voigt notation.

Computes the strain tensor as a 6-component vector following Voigt notation. The calculation is performed relative to a reference (undeformed) state.

Parameters:
  • deformed_state (SimState) – SimState containing the deformed configuration

  • reference_state (SimState | None) – Optional reference (undeformed) state. If None, uses deformed_state as reference.

Returns:

6-component strain vector [εxx, εyy, εzz, εyz, εxz, εxy]

following Voigt notation

Return type:

Tensor

Notes

The strain is computed as ε = (u + u^T)/2 where u = M^(-1)ΔM, with M being the cell matrix and ΔM the cell difference.

Voigt notation mapping: - ε[0] = εxx = u[0,0] - ε[1] = εyy = u[1,1] - ε[2] = εzz = u[2,2] - ε[3] = εyz = u[2,1] - ε[4] = εxz = u[2,0] - ε[5] = εxy = u[1,0]