I have a square [0,1] x [0,1] (name: “region”) which is divided into two rectangles (“region1” and “region2”). The interface is y=0.75. I have already defined a mesh of both rectangles that coincides with the interface.

fes1 = H1(mesh, definedon=“region1”, order=order)

fes2 = H1(mesh, definedon=“region2”, order=order)

fes = H1(mesh, definedon=“region”, order=order)

now I have two functions f1 in fes1 and f2 in fes2. Moreover, f1=f2 on interface

is there any approach to construct a new function f in fes such that f = f1 in region1 and f = f2 in region2.

I have thought about the extension method, but I think it will change the value of another region since the interface value may not always be zero. Thanks a lot.