Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions docs/source/element_list.py
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -8,28 +11,42 @@
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:
csvwriter = csv.writer(csvfile)

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 {"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)

try:
finat_element.dual_basis
except NotImplementedError:
interpolatable = "No"
else:
interpolatable = "Yes"

csvwriter.writerow((family, short_name, shape, cellnames, interpolatable))
6 changes: 0 additions & 6 deletions docs/source/interpolation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions docs/source/variational-problems.rst
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,13 @@ extrusion <extruded-meshes>` 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.
Interpolation **from** a function space is universally supported.

.. csv-table::
:header: "Name", "Short name", "Value shape", "Valid cells"
:widths: 20, 10, 10, 40
:header: "Name", "Short name", "Value shape", "Valid cells", "Valid interpolation target?"
:widths: 20, 10, 10, 40, 10
:file: element_list.csv

In addition, the
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ dependencies = [
"mpi4py>3; python_version >= '3.13'",
"mpi4py; python_version < '3.13'",
"fenics-ufl>=2025.3",
"firedrake-fiat>=2026.4",
# TODO RELEASE
"firedrake-fiat @ git+https://github.com/firedrakeproject/fiat.git@release",
"h5py>3.12.1",
"immutabledict",
"libsupermesh",
Expand Down
Loading