Fix logic and uses ranges in interpolate - #4049
Merged
Merged
Conversation
…of transformation
…range(num_cells_local+num_ghosts)
Co-authored-by: Paul T. Kühner <56360279+schnellerhase@users.noreply.github.com>
Co-authored-by: Paul T. Kühner <56360279+schnellerhase@users.noreply.github.com>
…x into garth/interpolate-ranges-2
schnellerhase
approved these changes
Jan 26, 2026
jorgensd
added a commit
to jorgensd/dolfinx_mpc
that referenced
this pull request
Jan 27, 2026
jorgensd
added a commit
to jorgensd/dolfinx_mpc
that referenced
this pull request
Jan 29, 2026
jorgensd
reviewed
Feb 17, 2026
| "Collapse sub-function view") | ||
| .def( | ||
| "interpolate", | ||
| "interpolate_f", |
jorgensd
reviewed
Feb 17, 2026
| } | ||
| }, | ||
| nb::arg("f"), nb::arg("cells"), "Interpolate an expression function") | ||
| nb::arg("f"), nb::arg("cells").none(), "Interpolate an expression.") |
Member
There was a problem hiding this comment.
This docstring is wrong, no? It should be "Interpolate an array of data (a function evaluated at interpolation points) into a function."
jorgensd
added a commit
to scientificcomputing/scifem
that referenced
this pull request
Feb 17, 2026
This was referenced Aug 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The logic in interpolate functions was in a bit of a mess after the addition of interpolation on submeshes. This PR fixes the logic, preserving correctness and performance.
It also reduces the need to create 'iota' vectors for interpolation by using C++ ranges.