Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make standalone function for interpolation over non-matching meshes #3177

Merged
merged 74 commits into from
May 14, 2024

Conversation

jorgensd
Copy link
Sponsor Member

@jorgensd jorgensd commented Apr 26, 2024

Resolves #3173.
Simplifies logic of interpolate.
API Change
Non-matching meshes interpolation now has its own interface: interpolate_nonmatching_meshes in both C++ and Python.
It also clarifies that interpolation of dolfinx::fem::Expression is not supported on non-matching meshes.

…t we can distinguish between a submesh with 0 cells and a nonmatching mesh with 0 cells on a process
@jorgensd jorgensd added bug Something isn't working high-priority backport? Suggest PR for backporting labels Apr 26, 2024
@garth-wells
Copy link
Member

The logic behind interpolation looks too complicated and the code is hard to follow. I don't see why different cases, e.g. matching and non-matching meshes, are forced through the same interface.

@jorgensd
Copy link
Sponsor Member Author

The logic behind interpolation looks too complicated and the code is hard to follow. I don't see why different cases, e.g. matching and non-matching meshes, are forced through the same interface.

I've now split the interpolation of nonmatching meshes into a separate function.

@jorgensd jorgensd changed the title Fix submesh interpolation when a process owns zero cells Make standalone function for interpolation over non-matching meshes Apr 29, 2024
Copy link
Member

@garth-wells garth-wells left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is more that can be done to simplify and improve the logic.

  • In C++ the number of functions can probably be reduced.
  • The non-matching interpolation data structure should be a struct.
  • The Python interface still has a function that tries to do too much. Interpolation for non-matching meshes is advanced functionality so it it ok for the user to be responsible for some of the steps, i.e. let the user create the required data structure.

cpp/dolfinx/fem/Function.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/Function.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/Function.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/Function.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/Function.h Outdated Show resolved Hide resolved
cpp/dolfinx/fem/interpolate.h Outdated Show resolved Hide resolved
python/dolfinx/fem/function.py Outdated Show resolved Hide resolved
python/dolfinx/fem/function.py Outdated Show resolved Hide resolved
python/dolfinx/fem/function.py Outdated Show resolved Hide resolved
python/dolfinx/fem/function.py Outdated Show resolved Hide resolved
cpp/dolfinx/fem/Function.h Outdated Show resolved Hide resolved
@garth-wells garth-wells added this pull request to the merge queue May 14, 2024
Merged via the queue into main with commit ab79530 May 14, 2024
28 checks passed
@garth-wells garth-wells deleted the dokken/nonmatching-interpolation-flag branch May 14, 2024 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high-priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interpolation to/from sub-meshes causes parallel deadlock
2 participants