On a 2D domain, I've got a variable with three components (representing a velocity $u$). I'd like to solve a PDE for $u$ and to this end would like to make sure that the first and the third component of $u$ are 0 at the boundary. The .sub()
notation seems to be somewhat buggy here: W.sub(0)
doesn't seem to return a one-dimensional subspace at all, W.sub(2)
doesn't seem to exist.
The following code highlights what I'm talking about:
from dolfin import *
mesh = UnitSquareMesh(20, 20)
V = FunctionSpace(mesh, 'CG', 1)
W = V*V*V
bcs = DirichletBC(W.sub(0), 0.0, 'on_boundary')
bcs = DirichletBC(W.sub(1), 0.0, 'on_boundary')
bcs = DirichletBC(W.sub(2), 0.0, 'on_boundary')