Another question on Dirichlet BCs for VectorH1 space

Hello,

I would like to define a VectorH1 space with different Dirichlet BC conditions for different components, currently, I am only doing the following, and then I have to define grad/div manually, which is cumbersome…

V1 = H1(mesh, dirichlet="top") V2 = H1(mesh, dirichelt="bottom") V = FESpace([V1, V2])
Is there a way to use VectorH1 to define the above space?

Best,
Guosheng

Here we had an example on how to set dirichlet dofs for the subspace manually. Is this what you looked for?

Best
Christopher

I will try it out. Thanks.