I am novice working with FEniCS and FEM method. Can you guide me how to compute element wise strain energy density knowing strain \epsilon = 1/2 (F^T + F) - I, where F= grad(u), Strain energy density U is given as U = \lambda/2 (tr(\epsilon))^2 + mu tr(\epsilon^2) (Saint Venant–Kirchhoff model)
Project your expression for the strain energy density onto a piecewise constant basis:
DG = FunctionSpace(mesh, "DG", 0) elementwise_density = project(<your expression>, DG)