Thank you for viewing my question.
I’m trying to extract interpolated values in a surface of 3D mesh to another 2D mesh with same surface area, but I have no idea how to achieve this. Following is a simple example:
from dolfin import *
#define mesh
mesh1=UnitSquareMesh(10,10)
mesh2=UnitCubeMesh(10,10,10)
#define FunctionSpace
V1=FunctionSpace(mesh1,'CG',1)
V2=FunctionSpace(mesh2,'CG',1)
#define u1 and u2
u1=interpolate(Constant(0),V1)
u2_ex=Expression('x[0]+x[1]+x[2]',degree=1)
u2=interpolate(u2_ex,V2)
#define SubDomain
class Surface1(SubDomain):
def inside(self, x, on_boundary):
return x[0]<0.5 and x[1]<0.5
class Surface2(SubDomain):
def inside(self, x, on_boundary):
return x[0]<0.5 and x[1]<0.5 and x[2]>1-DOLFIN_EPS
surface1=Surface1()
surface2=Surface2()
# next to do what to extract u2 values in the SubDomain surface2 of V2 to
# u1 for the SubDomain surface1 of V1?