dolfinx
dolfinx copied to clipboard
Interpolation between different meshes
This pull request supersedes #1598 . This pull request implements the same algorithm using the MPI Neighbourhood communication paradigm instead of the MPI One-sided communication one. The paradigm switch is joint work with @IgorBaratta .

And here's a cool picture, as requested by @IgorBaratta :D
We've also added a few improvements in different bits of the code, for instance collision detection and tabulation, to make interpolation faster.
This functionality is useful and very welcome. I think a more granular design would further improve the implementation. I suggest breaking it into distinct steps:
- Code to find points on other ranks, i.e. a function that takes a list of points and returns the index of rank (indices of ranks) where the point can be found. Discussion points would include how to handle points on the boundary between partitions.
- Pull back of points to the reference cell
- Evaluating expression at points and sending back data to perform the interpolation
Breaking up the steps will support more efficient implementations (a common use case would be interpolating multiple times and a redesign would make this much more efficient) and make it easier to discuss specific design choices. A PR for each step would be helpful.
Something to also bear in mind is that we're working to minimise the use of
xtensor, so avoid introducing it where possible.
Ive suggested a breakdown into 5 steps in: https://github.com/massimiliano-leoni/dolfinx/pull/1. Could you have a look and see what you think?
@garth-wells @chrisrichardson The interpolation has now been broken into five steps
- Compute local interpolation points
- Determine owning process of local interpolation points (also distributes these points to the processes in question).
- Evaluate functions at points owned by the current process
- Send function values back to process originally having the interpolation points (but the other mesh does not contain it).
- Call local interpolation operator.
@garth-wells I updated with main and I applied all but two edits [I'm not sure what to do in those cases].
I'd be keen for this to get merged, as there is some functionality in here that is needed for evaluating point sources, which is something I want to be able to use.