Skip to content

Allow expressions with submeshes#4140

Merged
jorgensd merged 52 commits into
mainfrom
dokken/submesh-expression
Jun 1, 2026
Merged

Allow expressions with submeshes#4140
jorgensd merged 52 commits into
mainfrom
dokken/submesh-expression

Conversation

@jorgensd

@jorgensd jorgensd commented Apr 1, 2026

Copy link
Copy Markdown
Member

With submesh support, it is quite common that one want to evaluate an expression that uses quantities from both the parent and submesh.

This PR extends expression to be able to support:

  • Submesh of codim 0
  • Submesh of codim 1 (one sided facet expressions)

Other structural changes

  • Refactors the pack_coefficients for dolfinx::fem::Expression into a multi-step approach:
    1. Before packing for a coefficient transform the integration entities input into a list of cells for the given coefficient.
    2. Pack entities for given coefficient.

Other relevant changes

A fix to the DOLFINx Expression on facet code to ensure that it is evaluated based on the global facet orientation. (FEniCS/ffcx#836)

Requires: FEniCS/ffcx#828
Resolves: #3207

@jorgensd jorgensd marked this pull request as ready for review April 1, 2026 11:44
@jorgensd jorgensd added the enhancement New feature or request label Apr 1, 2026
@jorgensd jorgensd requested a review from jpdean April 1, 2026 12:37
Comment thread .github/workflows/fenicsx-refs.env Outdated
Co-authored-by: Jørgen Schartum Dokken <dokken92@gmail.com>
Comment thread cpp/dolfinx/fem/assembler.h
@jorgensd

Copy link
Copy Markdown
Member Author

@schnellerhase and I got further. Now we are missing a permutation to compare the output of the two approaches, as they produce the same output, but in a permuted order..

Comment thread python/test/unit/fem/test_expression.py Fixed
@jorgensd

jorgensd commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

Related issue: FEniCS/ffcx#836

Comment thread .github/workflows/fenicsx-refs.env Outdated
Co-authored-by: Jørgen Schartum Dokken <dokken92@gmail.com>
@jorgensd jorgensd enabled auto-merge June 1, 2026 11:24
@jorgensd jorgensd disabled auto-merge June 1, 2026 11:49
@jorgensd jorgensd enabled auto-merge June 1, 2026 11:58
@jorgensd jorgensd dismissed garth-wells’s stale review June 1, 2026 13:21

Comments have been addressed

@jorgensd jorgensd added this pull request to the merge queue Jun 1, 2026
Merged via the queue into main with commit 7367d65 Jun 1, 2026
20 checks passed
@jorgensd jorgensd deleted the dokken/submesh-expression branch June 1, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support dolfinx::fem::Expression with co-dim 0 submeshes

4 participants