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 diff --git a/pyproject.toml b/pyproject.toml index 1f3a7f92cc..0feff1cb55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ dependencies = [ # TODO RELEASE "fenics-ufl @ git+https://github.com/FEniCS/ufl.git@main", # TODO RELEASE - "firedrake-fiat @ git+https://github.com/firedrakeproject/fiat.git@main", + "firedrake-fiat @ git+https://github.com/firedrakeproject/fiat.git@leo/misc-fixes", "h5py>3.12.1", "immutabledict", "libsupermesh",