Hello
I compute eigenvectors using scipy which return a numpy array. I try to copy this to a function as below
vals, vecs = la.eigs(A, k=5, M=M, sigma=sigma, which='LM', ncv=50, tol=1.0e-6)
up = Function(X)
up.vector()[freeinds] = np.real(vecs[:,0])
freeinds is a numpy array of indices for free dofs. Linear algebra backend is ublas and I am running latest mac binary.
This gives following error
Traceback (most recent call last): File "eig_scipy.py", line 131, in
up.vector()[freeinds] = np.real(vecs[:,0]) File "/Applications/FEniCS.app/Contents/Resources/lib/python2.7/site-packages/dolfin/cpp/la.py",
line 1255, in setitem
_set_vector_items_array_of_float(self, indices, values) RuntimeError: expected a contiguous 1D numpy array of numbers
I have checked that arrays are of correct dimension. I cannot figure out what could be the problem.