In Fenics, the usual way to write the Dirichlet boundary condition $u = u_0$ and $v = v_0$ on the $boundary parts$ (u, v are unknown) is:
V1 = FunctionSpace(mesh, 'CG', 2)
V2 = FunctionSpace(mesh, 'CG', 2)
V = MixedFunctionSpace([V1, V2])
bc1 = DirichletBC(V.sub(0), u0, boundary_parts)
bc2 = DirichletBC(V.sub(1), v0, boundary_parts)
What if I want to write down something like this: $u + 2v = 1$ on the boundary?
Thanks.