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

Get basis function as `dolfin.Function`

+1 vote

Manufactoring a solution to my previous question, I want to assemble forms of type

nformi = u.dx(0)*bi*v*dx

where u is a TrialFunction, v is a TestFunction and bi is the $i$-th basis function of a FEM-space.

Question: Is there a direct way to get a handle on bi rather than doing

bi = dolfin.Function(V)
bvec = numpy.zeros((V.dim(), ))
bvec[0] = 1
bi.vector()[:] = bvec
asked Apr 1, 2014 by Jan FEniCS User (8,290 points)
...