Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
44 changes: 31 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,43 @@
2: 'tensor'
}

def cells(cellnames):
firedrake_cells = ("interval",
"triangle",
"tetrahedron",
"quadrilateral",
"hexahedron")
Comment thread
leo-collins marked this conversation as resolved.
Outdated

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 {"Q", "DQ", "DQ L2"}:
cell = cell_list[-1]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes zero sense without a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we can't do these elements on an interval, even though it says in the manual we can. I think the correct fix is in finat/ufl/elementlist.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that seems more reasonable, but @pbrubeck needs to look this all over. Once this line goes I'm happy with everything else.

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)

try:
finat_element.dual_basis
interpolatable = "Yes"
except NotImplementedError:
interpolatable = "No"
Comment thread
leo-collins marked this conversation as resolved.

csvwriter.writerow((family, short_name, shape, cellnames, interpolatable))
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.
Comment thread
leo-collins marked this conversation as resolved.
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies = [
"mpi4py>3; python_version >= '3.13'",
"mpi4py; python_version < '3.13'",
"fenics-ufl>=2025.3",
"firedrake-fiat>=2026.4",
"firedrake-fiat @ git+https://github.com/firedrakeproject/fiat.git@leo/misc-fixes",
Comment thread
dham marked this conversation as resolved.
Outdated
"h5py>3.12.1",
"immutabledict",
"libsupermesh",
Expand Down
Loading