How to calculate eigen value of stress tensor
I have stress tensor sigma_w after solving the problem. How to caluclate eigen value of the stress tensor and sort it according to the need (decending order).
Thanks for the help and time.
from dolfin import * import mshr # generate mesh domain = mshr.Rectangle(Point(0,0), Point(1,1))-mshr.Circle(Point(0.0,0.0), 0.1) mesh = mshr.generate_mesh(domain, 40) plot(mesh, interactive=True) lmbda=121.15E3 mu=80.77E3 V = VectorFunctionSpace(mesh, 'CG',1) u = TrialFunction(V) v = TestFunction(V) def epsilon(u): return 0.5*(grad(u) + grad(u).T) def sigma(u): return 2.0*mu*epsilon(u) + lmbda*tr(epsilon(u))*Identity(2) class left(SubDomain): def inside(self,x,on_boundary): tol = 1e-5 return abs(x-0.0) < tol and on_boundary class right(SubDomain): def inside(self,x,on_boundary): tol = 1e-5 return abs(x-1.0) < tol and on_boundary class bottom(SubDomain): def inside(self,x,on_boundary): tol = 1e-5 return abs(x) < tol and on_boundary Bottom = bottom() Left = left() Right = right() # apply BC bc1=DirichletBC(V.sub(1),Constant(0.0),Bottom) bc2 = DirichletBC(V.sub(0),Constant(0.0),Left) bc = [bc1, bc2] load = 1.0 g = Constant ((load,0.0 )) domainBoundaries = FacetFunction("size_t", mesh) domainBoundaries.set_all(0) Left.mark(domainBoundaries,1) Bottom.mark(domainBoundaries,2) Right.mark(domainBoundaries,3) ds = Measure("ds")(subdomain_data=domainBoundaries) Eu = inner(nabla_grad(v), sigma(u))*dx - inner(g,v)*ds(3) u = Function(V) solve(lhs(Eu) == rhs(Eu), u, bc) W = TensorFunctionSpace(mesh, "Lagrange", 2) sigma_w = project(2*mu*sym(grad(u)) + lmbda*tr(grad(u))*Identity(2), W) # How to calculate eigen value of stress tensor sigma_w
Check out this thread in the old Q&A forums:
Seems straightforward in my opinion.
Also allow me a comment on your choice of function space:
If your displacement is piecewise linear then your strain is in a discontinuous piecewise constant space since it is a derivative of the displacement. The stress is linear in strains and thus also discontinuous piecewise constant. Projecting onto a quadratic continuous space is not the best idea here.