which is exactly the case for my problem. Since I have a long MWE solving a stokes equations with some geometries (which I included in another post and have flagged for deletion), can someone check if I am applying the BC at the subspace properly given how I defined the problem:
P2 = element("Lagrange", msh.basix_cell(), 2, shape=(msh.geometry.dim,))
P1 = element("Lagrange", msh.basix_cell(), 1)
# Create the Taylor-Hood function space
TH = mixed_element([P2, P1])
W = functionspace(msh, TH)
V, _ = W.sub(0).collapse()
# perfect slip bc
slip = Function(V)
dofs_slip = locate_dofs_topological((W.sub(0), V), 1, facet_tag.find(4))
bc_slip = dirichletbc(slip,dofs_slip,W.sub(0).sub(1))
because dirichletbc still seems to be prescribing a noslip condition even if I specified W.sub(0).sub(1) (I want no velocity in y-direction).
If this is the correct way to do it, then I know I must have done something else wrong.