MixedFunctionSpace (Taylor-Hood) Translation

Hello! I am trying to make a mixed function space of the following …

V = VectorFunctionSpace(mesh, "Lagrange", 2)
P = FunctionSpace(mesh, "Lagrange", 1)

The old FEniCS supported

W = MixedFunctionSpace([V, P]),

but this format no longer works. Does anybody know how this would be translated into the current edition?

For example, I think you can do

V = VectorElement("CG", mesh.ufl_cell(), 1)
Q = FiniteElement("CG", mesh.ufl_cell(), 1)
TH = V * Q
W = FunctionSpace(mesh, TH)
2 Likes