I'm trying to integrate a vector function:
V = VectorFunctionSpace(mesh, 'Lagrange', 1)
f = Function(V)
# do stuff that defines f
result = assemble(f * dx)
I would have hoped that this would give me a three element result
vector. Instead, it gives me an error:
UFLException: Trying to integrate expression of rank 1 with free indices ().
Evaluating the components one-by-one works fine:
result = [ assemble(f[0] * dx), assemble(f[1] * dx), assemble(f[2]* dx) ]
Is there a way to avoid the repeated calls to assemble
?