Hello, everyone.
I am using fenics 2019.1 to solve a coupling problem, and i have some questions as follows:
I have two mesh named mesh01 and mesh02 ,there is a public interface Gamma(marked 999) between the two mesh. I have solved a pde on the mesh01 and got the solution u1. But I need calculate the integral of u1 on the interface when i solve anthor pde on the mesh02. I wonder if the following approach is correct
u1.set_allow_extrapolation(True)
# function defined on mesh02
u_1_to_2 = Function(V02)
u_1_to_2.interpolate(u_1)
or
u_1_to_2 = project(u_1, V02)
# 999 : the public interface
# phi2 : testfunction on FunctionSpace V02 defined mesh02
rhs = u_1_to_2*phi2*ds(999)
In addition , is rhere any difference between project and interpolate in above code
In the example, we get function u01 by interpolating Constant(1.0). In my work, we get function u01 from a pde system defined mesh01.
I have the same question :how to transfer data between the two mesh.
That is already explained in the referenced post, as you just have to extract the data from the first mesh (and associated coordinates), and use the method described in that points. This can easily be done with dolfin.Function.vectot().get_local() and dolfin.FunctionSpace.tabulate_dof_coordinates()