From 23f2139b9a4ff5e3a417a5bf0f9df6e5a9cf5309 Mon Sep 17 00:00:00 2001 From: Leo Collins Date: Mon, 2 Feb 2026 11:30:12 +0000 Subject: [PATCH 1/9] automate add column --- docs/source/element_list.py | 47 ++++++++++++++++++++-------- docs/source/variational-problems.rst | 7 +++-- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/docs/source/element_list.py b/docs/source/element_list.py index 4671bfcf1b..b55094be16 100644 --- a/docs/source/element_list.py +++ b/docs/source/element_list.py @@ -1,5 +1,8 @@ from finat.ufl.elementlist import ufl_elements -from finat.element_factory import supported_elements +from finat.element_factory import supported_elements, create_element +from finat.ufl import FiniteElement +from ufl.cell import TensorProductCell +from ufl import interval, quadrilateral import csv shape_names = { @@ -8,17 +11,15 @@ 2: 'tensor' } -def cells(cellnames): +firedrake_cells = ("interval", + "triangle", + "tetrahedron", + "quadrilateral", + "hexahedron") - firedrake_cells = ("interval", - "triangle", - "tetrahedron", - "quadrilateral", - "hexahedron") - cells = [c for c in cellnames if c in firedrake_cells] - - return(", ".join(cells)) +def cells(cell_list): + return(", ".join(cell_list)) with open("element_list.csv", 'w', newline='') as csvfile: @@ -26,10 +27,30 @@ def cells(cellnames): for element in supported_elements: family, short_name, value_rank, sobolev_space, \ - mapping, degree_range, cellnames = ufl_elements[element] + mapping, degree_range, cell_list = ufl_elements[element] + cell_list = [c for c in cell_list if c in firedrake_cells] short_name = short_name if short_name != family else "" - cellnames = cells(cellnames) + cellnames = cells(cell_list) shape = shape_names[value_rank] - csvwriter.writerow((family, short_name, shape, cellnames)) + if family in {"Q", "DQ", "DQ L2"}: + cell = cell_list[-1] + elif family in {"NCE", "NCF"}: + cell = TensorProductCell(quadrilateral, interval) + else: + cell = cell_list[0] + + ufl_elem = FiniteElement(family, cell=cell, degree=degree_range[0]) + finat_element = create_element(ufl_elem) + + if short_name in {"BDMCF", "BDMCE"}: + interpolatable = "No" + else: + try: + finat_element.dual_basis + interpolatable = "Yes" + except NotImplementedError: + interpolatable = "No" + + csvwriter.writerow((family, short_name, shape, cellnames, interpolatable)) diff --git a/docs/source/variational-problems.rst b/docs/source/variational-problems.rst index e164f6c620..3d02a51441 100644 --- a/docs/source/variational-problems.rst +++ b/docs/source/variational-problems.rst @@ -267,11 +267,12 @@ extrusion ` for details. Supported finite elements ------------------------- -Firedrake supports the use of the following finite elements. +Firedrake supports the use of the following finite elements. The last column +specifies if we support interpolation **into** a function space built from the element. .. csv-table:: - :header: "Name", "Short name", "Value shape", "Valid cells" - :widths: 20, 10, 10, 40 + :header: "Name", "Short name", "Value shape", "Valid cells", "Supports interpolation?" + :widths: 20, 10, 10, 40, 10 :file: element_list.csv In addition, the From d32b8e0fece021f28a5f3cbadaed06c07d58d55f Mon Sep 17 00:00:00 2001 From: Leo Collins Date: Mon, 2 Feb 2026 11:47:09 +0000 Subject: [PATCH 2/9] drop before merge --- pyproject.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c153ecfb06..e7d6eac30f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,8 +18,10 @@ dependencies = [ "decorator<=4.4.2", "mpi4py>3; python_version >= '3.13'", "mpi4py; python_version < '3.13'", - "fenics-ufl>=2025.3", - "firedrake-fiat>=2026.4", + # TODO RELEASE + "fenics-ufl @ git+https://github.com/FEniCS/ufl.git@main", + # TODO RELEASE + "firedrake-fiat @ git+https://github.com/firedrakeproject/fiat.git@leo/misc-fixes", "h5py>3.12.1", "immutabledict", "libsupermesh", From 9e5be96f4095468b5005c533020f7a755d6032d3 Mon Sep 17 00:00:00 2001 From: Leo Collins Date: Tue, 21 Apr 2026 11:27:33 +0100 Subject: [PATCH 3/9] fixes --- docs/source/element_list.py | 11 ++++------- docs/source/variational-problems.rst | 3 ++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/source/element_list.py b/docs/source/element_list.py index b55094be16..2bf003f0aa 100644 --- a/docs/source/element_list.py +++ b/docs/source/element_list.py @@ -44,13 +44,10 @@ def cells(cell_list): ufl_elem = FiniteElement(family, cell=cell, degree=degree_range[0]) finat_element = create_element(ufl_elem) - if short_name in {"BDMCF", "BDMCE"}: + try: + finat_element.dual_basis + interpolatable = "Yes" + except NotImplementedError: interpolatable = "No" - else: - try: - finat_element.dual_basis - interpolatable = "Yes" - except NotImplementedError: - interpolatable = "No" csvwriter.writerow((family, short_name, shape, cellnames, interpolatable)) diff --git a/docs/source/variational-problems.rst b/docs/source/variational-problems.rst index 3d02a51441..b04f13cdc0 100644 --- a/docs/source/variational-problems.rst +++ b/docs/source/variational-problems.rst @@ -269,9 +269,10 @@ Supported finite elements Firedrake supports the use of the following finite elements. The last column specifies if we support interpolation **into** a function space built from the element. +Interpolation **from** a function space is universally supported. .. csv-table:: - :header: "Name", "Short name", "Value shape", "Valid cells", "Supports interpolation?" + :header: "Name", "Short name", "Value shape", "Valid cells", "Valid interpolation target?" :widths: 20, 10, 10, 40, 10 :file: element_list.csv From caef71d70862c407c689dfe37fa7ed1eb9a18777 Mon Sep 17 00:00:00 2001 From: Leo Collins Date: Tue, 21 Apr 2026 11:30:46 +0100 Subject: [PATCH 4/9] drop before merge --- pyproject.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e7d6eac30f..49858978f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,9 +18,7 @@ dependencies = [ "decorator<=4.4.2", "mpi4py>3; python_version >= '3.13'", "mpi4py; python_version < '3.13'", - # TODO RELEASE - "fenics-ufl @ git+https://github.com/FEniCS/ufl.git@main", - # TODO RELEASE + "fenics-ufl>=2025.3", "firedrake-fiat @ git+https://github.com/firedrakeproject/fiat.git@leo/misc-fixes", "h5py>3.12.1", "immutabledict", From 583ba0518124ac4702afcf790607beca57f7d740 Mon Sep 17 00:00:00 2001 From: Leo Collins Date: Tue, 21 Apr 2026 12:19:53 +0100 Subject: [PATCH 5/9] Update docs/source/element_list.py Co-authored-by: Connor Ward --- docs/source/element_list.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/element_list.py b/docs/source/element_list.py index 2bf003f0aa..30721ad6cd 100644 --- a/docs/source/element_list.py +++ b/docs/source/element_list.py @@ -46,8 +46,9 @@ def cells(cell_list): try: finat_element.dual_basis - interpolatable = "Yes" except NotImplementedError: interpolatable = "No" + else: + interpolatable = "Yes" csvwriter.writerow((family, short_name, shape, cellnames, interpolatable)) From 3886c7b3cd9160f9581d4861e8973fd4a1e3428e Mon Sep 17 00:00:00 2001 From: Leo Collins Date: Tue, 21 Apr 2026 12:35:45 +0100 Subject: [PATCH 6/9] fix --- docs/source/element_list.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/source/element_list.py b/docs/source/element_list.py index 30721ad6cd..437c0acf93 100644 --- a/docs/source/element_list.py +++ b/docs/source/element_list.py @@ -34,9 +34,7 @@ def cells(cell_list): cellnames = cells(cell_list) shape = shape_names[value_rank] - if family in {"Q", "DQ", "DQ L2"}: - cell = cell_list[-1] - elif family in {"NCE", "NCF"}: + if family in {"NCE", "NCF"}: cell = TensorProductCell(quadrilateral, interval) else: cell = cell_list[0] From c8ffef212778d5d161e29aefd434494a47760524 Mon Sep 17 00:00:00 2001 From: "David A. Ham" Date: Tue, 21 Apr 2026 16:57:29 +0100 Subject: [PATCH 7/9] Update pyproject.toml --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 49858978f7..8679259328 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,8 @@ dependencies = [ "mpi4py>3; python_version >= '3.13'", "mpi4py; python_version < '3.13'", "fenics-ufl>=2025.3", - "firedrake-fiat @ git+https://github.com/firedrakeproject/fiat.git@leo/misc-fixes", + # TODO RELEASE + "firedrake-fiat @ git+https://github.com/firedrakeproject/fiat.git@release", "h5py>3.12.1", "immutabledict", "libsupermesh", From 521e3fb243b8b68b2d7789616310189f966cb857 Mon Sep 17 00:00:00 2001 From: Leo Collins Date: Tue, 21 Apr 2026 16:59:58 +0100 Subject: [PATCH 8/9] Update docs/source/element_list.py Co-authored-by: Pablo Brubeck --- docs/source/element_list.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/element_list.py b/docs/source/element_list.py index 437c0acf93..12ec19e37d 100644 --- a/docs/source/element_list.py +++ b/docs/source/element_list.py @@ -12,10 +12,10 @@ } firedrake_cells = ("interval", - "triangle", - "tetrahedron", - "quadrilateral", - "hexahedron") + "triangle", + "tetrahedron", + "quadrilateral", + "hexahedron") def cells(cell_list): From 6649f2ccb41bacc66f1a3bfd2959c932ce0f819f Mon Sep 17 00:00:00 2001 From: Leo Collins Date: Sun, 26 Apr 2026 11:48:18 +0100 Subject: [PATCH 9/9] update --- docs/source/interpolation.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/source/interpolation.rst b/docs/source/interpolation.rst index 50441902ff..27a740fd4d 100644 --- a/docs/source/interpolation.rst +++ b/docs/source/interpolation.rst @@ -267,12 +267,6 @@ function space has any finite element which supports interpolation, as specified spaces can also be interpolated into from other meshes as long as they are constructed from these spaces. -.. note:: - - The list of supported elements above is only for *target* function spaces. - Function spaces on the *source* mesh can be built from most of the supported - elements. - There are few constraints on the meshes involved: the target mesh can have a different cell shape, topological dimension, or resolution to the source mesh. There are many use cases for this: For example, two solutions to the same