If you want to have the same constant for both parts, just use
u_n.vector()[:] = c
before you use “split” in your last example.
For different values have a look here: Interpolation of Indexed Functions of Mixed Elements
If you want to have the same constant for both parts, just use
u_n.vector()[:] = c
before you use “split” in your last example.
For different values have a look here: Interpolation of Indexed Functions of Mixed Elements