Skip to content

Commit

Permalink
Add changes from tsfc
Browse files Browse the repository at this point in the history
  • Loading branch information
indiamai committed Dec 9, 2024
1 parent 1dec340 commit 94a96dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tsfc/finatinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import FIAT
import finat
import finat.ufl
import redefining_fe
import ufl

__all__ = ("as_fiat_cell", "create_base_element",
Expand Down Expand Up @@ -111,6 +112,8 @@ def as_fiat_cell(cell):
:arg cell: the :class:`ufl.Cell` to convert."""
if not isinstance(cell, ufl.AbstractCell):
raise ValueError("Expecting a UFL Cell")
if isinstance(cell, redefining_fe.cells.CellComplexToUFL):
return cell.to_fiat()
return FIAT.ufc_cell(cell)


Expand Down Expand Up @@ -220,6 +223,9 @@ def convert_finiteelement(element, **kwargs):

return lmbda(cell, element.degree(), **finat_kwargs), set()

@convert.register(redefining_fe.triples.IndiaTripleUFL)
def convert_india_def(element, **kwargs):
return finat.fiat_elements.IndiaDefElement(element.triple), set()

# Element modifiers and compound element types
@convert.register(finat.ufl.BrokenElement)
Expand Down

0 comments on commit 94a96dc

Please sign in to comment.