# Interpolation between two different meshes

Dear FeniCs community, hope everyone is doing fine.

I have recently solved an electrostatic problem, that can give me the electric field due to a potential change on a mesh, as shown on the upcoming figure.

A minimal reproduction to get to this vector field reads as follows:

``````  from dolfin import *

originx = 0
originy = 0
origin = Point(originx,originy)

bigRectx = 10
bigRecty = 5
bigRect = Point(bigRectx, bigRecty)

rect2_1x = 4
rect2_1y = 2
rect2_1 = Point(rect2_1x,rect2_1y)

rect2_2x = 6
rect2_2y = 5
rect2_2 = Point(rect2_2x,rect2_2y)

rect1 = Rectangle(origin, bigRect)
rect2 = Rectangle(rect2_1, rect2_2)
circle = Circle(Point(5 , 2), 1 )

domain = rect1 - rect2 - circle
mesh = generate_mesh(domain, 100)

V = FunctionSpace(mesh, 'CG', 1)

v_1 = Constant(0)
v_0 = Constant(0)
v_2 = Constant(13500)

def bottom_side(x, on_boundary):
if (near(x[1], 0) )  and on_boundary:
return True

def voltage(x,on_boundary): #Define los lugares en los que hay un voltaje actuando
Bool = False
if on_boundary:
if ((near(x[1],0) or near(x[0],0) or near(x[0],10) or near(x[1],5))):
return Bool
else:
return True

bot_bc = DirichletBC(V, v_0, bottom_side)
drop_bc = DirichletBC(V, v_2, voltage)
bcs = [bot_bc, drop_bc]

u = TrialFunction(V)
v = TestFunction(V)
f = Constant(0)