Skip to content

Support ufl.interpolate#829

Draft
jorgensd wants to merge 29 commits intomainfrom
dokken/proxy-coefficients
Draft

Support ufl.interpolate#829
jorgensd wants to merge 29 commits intomainfrom
dokken/proxy-coefficients

Conversation

@jorgensd
Copy link
Copy Markdown
Member

@jorgensd jorgensd commented Apr 5, 2026

Resolve #827

@michalhabera
Copy link
Copy Markdown
Contributor

This looks very useful. Can you maybe provide a summary of how this is implemented and limitations in the overview, once ready?

@jorgensd
Copy link
Copy Markdown
Member Author

jorgensd commented Apr 6, 2026

This looks very useful. Can you maybe provide a summary of how this is implemented and limitations in the overview, once ready?

Of course. I’m not quite happy with the naming etc yet, so I’ll let it simmer for a few days.

I would also like to embed this with re-exposing cell and facet averages, which I started prior to this in: https://github.com/FEniCS/ffcx/tree/dokken/cell_avg_v2

Short story for now is:

  1. we traverse the form for all interpolate operations.
  2. For each interpolate, replace it with an overloaded ufl coefficient (proxycoefficient, should maybe be called intermediate coefficient?). This new coefficient stores a reference to should be interpolated into it.
  3. Add an expression evaluating at interpolation points to the ufl objects from the analysis.
  4. Standard dag traversal of new form.
  5. We split now between coefficients from input form and those internal ones (they will be ordered at the end of reduced_coefficients due to their count being higher).
  6. Generate expression evaluating at interpolation points
  7. Within code generation extract standard coefficient data required by the new coefficients. Call expression tabulate.
  8. if interpolation is not identity apply interpolation matrix multiplication, else copy into coefficient array used by the tabulator.
  9. assemble tensor with coeffs and proxy coeffs.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 85.226% (+0.6%) from 84.674% — dokken/proxy-coefficients into main

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.

Interpolation expression support

3 participants