Hi, I want to view my stress tensor and I used the following. However, it keeps giving me a runtime error.
E = 200*(10**9)
nu = 0.24
mu, lmbda = E/(2.0*(1.0 + nu)), E*nu/((1.0 + nu)*(1.0 - 2.0*nu))
# Stress
sigma = 2*mu*sym(grad(u)) + lmbda*tr(grad(u))*Identity(mesh.geometry().dim())
T = TensorFunctionSpace(mesh, 'CG', 1)
stress = project(sigma(u),T)
File("stress.pvd") << stress
M = stress.vector().array()
print M
Should I use 'Discontinuous Lagrange'? Your help is highly appreciated. Thanks.
I checked this link too, but couldn't figure it out.
http://fenicsproject.org/qa/4051/how-to-get-numpy-array-of-a-tensor
http://fenicsproject.org/qa/5569/evaluating-a-tensor-valued-function-at-a-point?show=5569#q5569