Let's suppose I have a MixedFunctionSpace W consisting of two subspaces V. How can I construct a function in W from two functions in V, i.e.
#!/usr/bin/env python
from dolfin import *
mesh = IntervalMesh(100, 0.0, 1.0)
V = FunctionSpace(mesh, "CG", 1)
W = V * V
f1 = interpolate(Expression("sin(x[0])"), V)
f2 = interpolate(Expression("cos(x[0])"), V)
u = Function(W, (f1,f2)) # does not work
I know that in this particular case simply interpolating Expression(("sin(x[0])", "cos(x[0])"), W) would work, but my question is how I can do this with two general functions f1,f2. This is just the simplest example I came up with.