Skip to content

Fix logic and uses ranges in interpolate - #4049

Merged
garth-wells merged 59 commits into
mainfrom
garth/interpolate-ranges-2
Jan 26, 2026
Merged

Fix logic and uses ranges in interpolate#4049
garth-wells merged 59 commits into
mainfrom
garth/interpolate-ranges-2

Conversation

@garth-wells

@garth-wells garth-wells commented Jan 24, 2026

Copy link
Copy Markdown
Member

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.

Comment thread cpp/dolfinx/fem/interpolate.h
garth-wells and others added 7 commits January 25, 2026 20:30
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>
Comment thread cpp/dolfinx/io/HDF5Interface.h Outdated
@garth-wells
garth-wells added this pull request to the merge queue Jan 26, 2026
Merged via the queue into main with commit 338f32f Jan 26, 2026
19 checks passed
@garth-wells
garth-wells deleted the garth/interpolate-ranges-2 branch January 26, 2026 14:08
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
"Collapse sub-function view")
.def(
"interpolate",
"interpolate_f",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why was this renamed?

}
},
nb::arg("f"), nb::arg("cells"), "Interpolate an expression function")
nb::arg("f"), nb::arg("cells").none(), "Interpolate an expression.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This docstring is wrong, no? It should be "Interpolate an array of data (a function evaluated at interpolation points) into a function."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants