Hello everyone, I have learned the code for computing 3D von Mises stress. if I change Identity(3)
to Identity(2)
, it corresponds to a 2D plane stress problem. I would like to know what the code for calculating von Mises stress in a 2D plane strain problem is. Thank you!
s = sigma(uh) - 1. / 3 * ufl.tr(sigma(uh)) * ufl.Identity(3)
von_Mises = ufl.sqrt(3. / 2 * ufl.inner(s, s))
V_von_mises = fem.functionspace(domain, ("DG", 0))
stress_expr = fem.Expression(von_Mises, V_von_mises.element.interpolation_points())
stresses = fem.Function(V_von_mises)
stresses.interpolate(stress_expr)