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

Regression for interpolation of a callable on cells subset #2638

Closed
francesco-ballarin opened this issue Apr 25, 2023 · 4 comments · Fixed by #2640
Closed

Regression for interpolation of a callable on cells subset #2638

francesco-ballarin opened this issue Apr 25, 2023 · 4 comments · Fixed by #2640
Labels
bug Something isn't working high-priority

Comments

@francesco-ballarin
Copy link
Member

My RBniCSx CI started failing a couple of days ago, and I tracked down the issue to a regression in the interpolation of a callable on cell subsets.

The culprit can be either #2632, #2634, or #2636. I am leaning towards the first, but I can't really spot what has caused the regression.
I added a couple of failing tests in francesco/interpolation-callable-subset, feel free to use that branch for the fix. In particular:

  • python/test/unit/fem/test_interpolation.py::test_interpolate_subset: the cases with callable_ == True are failing, while callable_ == False (i.e., the former version of the test, where a UFL expression is used rather than a callable) passes
  • python/test/unit/fem/test_interpolation.py::test_interpolate_callable_subset: the case bound == 0.5 fails, while bound == 1.5 (i.e, the cell subset is actually the whole domain) passes

cc @niravshah241 since this regression may affect his work on shape parametrization/mesh motion

@francesco-ballarin francesco-ballarin added the bug Something isn't working label Apr 25, 2023
@jorgensd
Copy link
Sponsor Member

One thing to note in your tests is that you should scatter_forward after calling interpolation on a subset (not that it is the root cause of the error).

@francesco-ballarin
Copy link
Member Author

Thanks @jorgensd . That call is indeed not present at the moment on main, but as you say it is not the root cause of the error, at least in serial.

@jorgensd
Copy link
Sponsor Member

jorgensd commented Apr 25, 2023

Issue is:

    auto x_dofs = x_dofmap.links(cells[c]);
    auto x_dofs = stdex::submdspan(x_dofmap, c, stdex::full_extent);

In flatten dofmap. See https://github.com/FEniCS/dolfinx/blob/main/cpp/dolfinx/fem/interpolate.h#LL79
Fix is using

    auto x_dofs = stdex::submdspan(x_dofmap, c, stdex::full_extent);

not currently at my computer, so cant make a pr

@garth-wells
Copy link
Member

@jorgensd good catch.

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 a pull request may close this issue.

3 participants