Hello,
Here you can do simply as adding in your varf
+int2d(Th,labreg)(tgv*u*uh)
and a similar term for the rhs, where labreg
is the label of your region.
If you don’t like to define region labels you can do (for the left region x<1)
fespace Vh0(Th,P0);
Vh0 regl;
regl=(x<1. ? 1. : 0.);
and use
+int2d(Th)(tgv*u*uh*regl)
It is not easy to handle what happens close to the interface between the regions, since usually u is in a space imposing continuity.