Hello
I have been successful at creating a linear elasticity solver in FEniCS. I compute the displacement field in a Function
object u_sol
.
I am now interested in calculating volume averaged stress and strain over the domain. In essence I need to calculate (typed in Latex notation) $\langle \sigma \rangle = \frac{1}{\Omega} \int_{\Omega}{\sigma d \Omega}$.
I have the stress defined as a form as follows:
def sigma(u):
eps = epsilon(u)
stress = 2.0*Mu*eps + Lambda*tr(eps)*Identity(u.geometric_dimension())
return stress
def epsilon(u):
strain = 0.5*(nabla_grad(u) + nabla_grad(u).T)
return strain
Is it okay for me to write avgStress_11 = assemble(sigma(u_sol)[0,0]*dx)
to compute the average stress (component by component)? I tried this, but the results I obtain are numerically wrong even though the displacement field seems to be okay.
I can provide more details of the code as, and if, required.
Any help will be much appreciated.
Thanks