A function mapping between the different function spaces/meshes

Hi all,

I have questions about a functionality to map the solution/function from one mesh to another mesh.
Here, the one mesh could be coarser or finer than another one (i.e., the number of mesh size is different each other).

For this purpose, I think in the FEniCS (not the FEniCSx), a couple of ways could be considered, but not sure; via “interpolate()”, via “project()”, via “PETScDMCollection()”.

My question is that,

  1. What are the main difference between those three functionalities? and also, what are the pros and cons of those?
  2. Can the “project()” be used for mapping the solutions/functions for the different sizes of meshes? Like, from the 40 x 40 elements to the 20 x 20 elements and vice versa (here, the sizes of actual geometries are the same).

If you guys can give your insights on this, it would be really appreciated!!