How do I get the polar decomposition of a field?
3 months ago by
File "/usr/lib/python3/dist-packages/scipy/linalg/_decomp_polar.py", line 102, in polar
raise ValueError("`a` must be a 2-D array.")
My MWE that reproduces this error is as follows:
from fenics import * from scipy.linalg import * mesh = RectangleMesh(Point(-1,-1),Point(1,1), 4, 4) V = VectorFunctionSpace(mesh, "Lagrange", 1) def W1(y): F = grad(y) R,U=polar(F) return tr(U*U) # test strain energy density y = Function(V) Pi=W1(y)*dx
I think I see the problem -- that $F$ is a tensor field and not a tensor? -- but I don't know how to fix that.
Community: FEniCS Project
3 months ago by
NameError: global name 'polar' is not defined
Where are you getting that function? You might try to decompose it using other means, using
R = F.T*F
but I'm not sure if UFL has a Hermitian sqrt function either...
Incidentally, the MR strain energy density doesn't require you to do this. You can easily find the rotation-independent tensors (Green or Lagrangian) which are related to F.T * F (and don't require the square root or the rotation matrix explicitly). The det(F) is then related to det(C) or det(E) trivially.
from fenics import * mesh = RectangleMesh(Point(-1,-1),Point(1,1), 4, 4) V = VectorFunctionSpace(mesh, "Lagrange", 1) def W1(y): F = grad(y) #R,U=polar(F) C = F.T*F detF = sqrt(det(C)) return tr(C) - ln(detF) + (detF-1)**2 # strain energy density (compressible Mooney-Rivlin) y = Function(V) Pi = W1(y)*dx
Please login to add an answer/comment or follow this question.