Skip to content

Conversation

@pbrubeck
Copy link
Contributor

@pbrubeck pbrubeck commented Apr 4, 2025

Description

This PR enables interpolation of a BaseForm onto a sub-Cofunction defined via indexed Arguments.

The indirection is handled symbolically within assemble, so that

assemble(Interpolate(TestFunction(Z)[i], BaseForm), tensor=tensor)

becomes

assemble(Interpolate(TestFunction(Z.sub(i)), BaseForm), tensor=tensor.subfunctions[i])

Depends on FEniCS/ufl#370

@pbrubeck pbrubeck force-pushed the pbrubeck/interpolate-mixed branch from 924c9af to 2e34465 Compare April 4, 2025 11:04
@dham
Copy link
Member

dham commented Apr 4, 2025

I suspect this change has a risk of breaking the adjoint. Can we also please have an adjoint test for this?

@pbrubeck pbrubeck force-pushed the pbrubeck/interpolate-mixed branch from f566861 to 0d5a629 Compare April 5, 2025 20:19
@pbrubeck pbrubeck changed the title Indexed interpolation Dual interpolation from/into MixedFunctionSpace Apr 8, 2025
@pbrubeck pbrubeck force-pushed the pbrubeck/interpolate-mixed branch from bb02501 to a8d23de Compare April 10, 2025 16:09
@pbrubeck pbrubeck requested a review from dham April 17, 2025 08:09
dham
dham previously approved these changes May 7, 2025
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
@dham dham enabled auto-merge (squash) May 7, 2025 16:00
@dham dham merged commit 9b4f147 into master May 8, 2025
7 checks passed
@dham dham deleted the pbrubeck/interpolate-mixed branch May 8, 2025 08:44
indiamai pushed a commit that referenced this pull request May 13, 2025
* Interpolation onto subfunctions

* More generic approach using fieldsplit

* Interpolate: Fix parloop args ordering

* Fix dual

* Interpolate from MixedFunctionSpace

* Test Interpolate from vector/mixed to mixed

* Interpolate from (scalar/mixed) to (scalar/mixed)

Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>

---------

Co-authored-by: David A. Ham <david.ham@imperial.ac.uk>
colinjcotter pushed a commit that referenced this pull request May 14, 2025
* Interpolation onto subfunctions

* More generic approach using fieldsplit

* Interpolate: Fix parloop args ordering

* Fix dual

* Interpolate from MixedFunctionSpace

* Test Interpolate from vector/mixed to mixed

* Interpolate from (scalar/mixed) to (scalar/mixed)

Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>

---------

Co-authored-by: David A. Ham <david.ham@imperial.ac.uk>
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.

3 participants