This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Error calculating eigenvalue in ufl

0 votes

Hello,
I want to calculate the principal stretch values of the green-lagrange strain tensor C in ufl but i keep getting error:

File "/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py", line
216, in _assertFinite
if not (isfinite(a).all()): TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely
coerced to any supported types according to the casting rule ''safe''

What I try so far is:

...
C = F.T*F
from numpy import linalg as LA
import numpy as np
CC = np.array( [ [C[0,0], C[0,1], C[0,2] ],  [C[1,0], C[1,1], C[1,2]], [C[2,0], C[2,1], C[2,2]] ] )
lmbda, wv = LA.eig( CC  )
asked Sep 27, 2014 by gennadiy FEniCS Novice (590 points)

1 Answer

0 votes

You cannot compute numerical eigenvalues with numpy from symbolic UFL expressions. There's no support for eigenvalues in UFL/FFC either.

answered Oct 23, 2014 by martinal FEniCS User (2,800 points)
...