Skip to content

Conversation

@pbrubeck
Copy link
Contributor

Description

Enables assembly of the interpolation matrix for mixed spaces

assemble(interpolate(TrialFunction(V1*V2), W1*W2))) -> MatNest([[Interp(v1, w1*), 0], [0, Interp(v2, w2*)]])

We also allow the operand to be any expression, resulting in non-zero off diagonal blocks.

This is the last step required to clean up the special cases of an Interpolate in assemble.py.

@pbrubeck pbrubeck force-pushed the pbrubeck/interp-mixed branch from 71f6165 to 6061910 Compare September 28, 2025 16:50
@leo-collins
Copy link
Contributor

How will this extend when #3478 goes in and we can define MixedFunctionSpaces on multiple domains?

@pbrubeck pbrubeck force-pushed the pbrubeck/interp-mixed branch 3 times, most recently from 0f44ddb to f21dad9 Compare September 29, 2025 16:19
@pbrubeck
Copy link
Contributor Author

How will this extend when #3478 goes in and we can define MixedFunctionSpaces on multiple domains?

I believe this approach should give us the matfree adjoint and the forward/adjoint matrices for that case, as long as each MFS component on the source and target are defined on standard, possibly distintict meshes/submeshes.

dham
dham previously approved these changes Sep 30, 2025
@pbrubeck pbrubeck force-pushed the pbrubeck/interp-adjoint-explicit branch 8 times, most recently from 8d631f8 to 3b92d36 Compare September 30, 2025 22:01
Base automatically changed from pbrubeck/interp-adjoint-explicit to main September 30, 2025 23:11
@pbrubeck pbrubeck dismissed dham’s stale review September 30, 2025 23:11

The base branch was changed.

@pbrubeck pbrubeck force-pushed the pbrubeck/interp-mixed branch 4 times, most recently from 6e5b5cb to 2db1ab1 Compare September 30, 2025 23:27
@pbrubeck pbrubeck force-pushed the pbrubeck/interp-mixed branch from 2db1ab1 to 3bd935e Compare September 30, 2025 23:30
@pbrubeck
Copy link
Contributor Author

pbrubeck commented Oct 1, 2025

This needed more work after FEniCS/ufl#422 was merged. We now split the sub interpolators via the same mechanism that handles fieldsplit, so this should be much cleaner.

Copy link
Contributor

@connorjward connorjward 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 I'm mostly happy now. Definitely good to see so much deleted code.

There could definitely be more docstrings and type hints but there are at least some.

connorjward
connorjward previously approved these changes Oct 2, 2025
@pbrubeck pbrubeck merged commit 2ac0c02 into main Oct 3, 2025
7 checks passed
@pbrubeck pbrubeck deleted the pbrubeck/interp-mixed branch October 3, 2025 08:11
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.

5 participants