diff --git a/ufl/cell.py b/ufl/cell.py index 9ef8e9975..086d57195 100644 --- a/ufl/cell.py +++ b/ufl/cell.py @@ -96,7 +96,7 @@ def num_facets(self) -> int: def num_ridges(self) -> int: """Get the number of ridges. - + Ridges are entities of dimension tdim-2. """ tdim = self.topological_dimension() @@ -196,6 +196,10 @@ def peak_types(self) -> typing.Tuple[AbstractCell, ...]: ("triangle", "quadrilateral", "quadrilateral", "quadrilateral", "triangle"), ("prism", )], "pyramid": [tuple("vertex" for i in range(5)), tuple("interval" for i in range(8)), ("quadrilateral", "triangle", "triangle", "triangle", "triangle"), ("pyramid", )], + "pentatope": [tuple("vertex" for i in range(5)), tuple("interval" for i in range(10)), + tuple("triangle" for i in range(10)), tuple("tetrahedron" for i in range(5), ("pentatope", ))], + "tesseract": [tuple("vertex" for i in range(16)), tuple("interval" for i in range(32)), + tuple("quadrilateral" for i in range(24)), tuple("hexahedron" for i in range(8)), ("tesseract", )], } @@ -422,6 +426,8 @@ def simplex(topological_dimension: int, geometric_dimension: typing.Optional[int return Cell("triangle", geometric_dimension) if topological_dimension == 3: return Cell("tetrahedron", geometric_dimension) + if topological_dimension == 4: + return Cell("pentatope", geometric_dimension) raise ValueError(f"Unsupported topological dimension for simplex: {topological_dimension}") @@ -435,6 +441,8 @@ def hypercube(topological_dimension, geometric_dimension=None): return Cell("quadrilateral", geometric_dimension) if topological_dimension == 3: return Cell("hexahedron", geometric_dimension) + if topological_dimension == 4: + return Cell("tesseract", geometric_dimension) raise ValueError(f"Unsupported topological dimension for hypercube: {topological_dimension}") diff --git a/ufl/finiteelement/elementlist.py b/ufl/finiteelement/elementlist.py index da3855641..6ea6a6fa2 100644 --- a/ufl/finiteelement/elementlist.py +++ b/ufl/finiteelement/elementlist.py @@ -12,6 +12,7 @@ # Modified by Marie E. Rognes , 2010 # Modified by Lizao Li , 2015, 2016 # Modified by Massimiliano Leoni, 2016 +# Modified by Robert Kloefkorn, 2022 import warnings from numpy import asarray @@ -82,12 +83,12 @@ def show_elements(): # the future, add mapping name as another element property. # Cell groups -simplices = ("interval", "triangle", "tetrahedron") -cubes = ("interval", "quadrilateral", "hexahedron") +simplices = ("interval", "triangle", "tetrahedron", "pentatope") +cubes = ("interval", "quadrilateral", "hexahedron", "tesseract") any_cell = (None, "vertex", "interval", "triangle", "tetrahedron", "prism", - "pyramid", "quadrilateral", "hexahedron") + "pyramid", "quadrilateral", "hexahedron", "pentatope", "tesseract") # Elements in the periodic table # TODO: Register these as aliases of # periodic table element description instead of the other way around