Use the solution on a surface as BC for another simulation in fenics

Hi averyone,
I have a 3D simulation (SIM1) in a cylinder in which the temperature is solved.
What I need is to extract the temperature profile in the outlet section of the cylinder and use it as a boundary condition at the inlet section in another simulation (SIM2).
Note that:

  • The meshes used in the two simulation are the same and the triangles in the outlet section of SIM1 are aligned with the triangles in the inlet section of SIM2
  • dolfin version is 2019.1.0

thank you

Ok, I need to edit and correct one part of the question.
The question reamins the same but:

  • The meshes are not the same. They share the “shape” but not the size and then the triangles in the inlet section of SIM2 are not aligned with those of SIM1

Dear Matt, if you want to use legacy DOLFIN for this, you would have to use the PETSCDMCollection create_transfer_matrix: Bitbucket

Thank you so much Dokken.
I am not particularly attached to the legacy version of Dolfin.
With dolfinx is easier?

With DOLFINx, you have more flexibility when you create an interpolation operator between the meshes, restricting it to a subset of cells: dolfinx/python/dolfinx/wrappers/fem.cpp at d685d00d682d0f7addb676e35c891e8a05412c7c · FEniCS/dolfinx · GitHub
dolfinx/python/test/unit/fem/test_interpolation.py at d685d00d682d0f7addb676e35c891e8a05412c7c · FEniCS/dolfinx · GitHub
To get the cells relating to the boundary, you can use
dolfinx/python/dolfinx/mesh.py at d685d00d682d0f7addb676e35c891e8a05412c7c · FEniCS/dolfinx · GitHub