diff --git a/finat/ufl/finiteelement.py b/finat/ufl/finiteelement.py index f2794226..dade48b0 100644 --- a/finat/ufl/finiteelement.py +++ b/finat/ufl/finiteelement.py @@ -117,6 +117,11 @@ def dq_family_l2(cell): for c in cell.sub_cells], cell=cell) + elif family == "Real": + return TensorProductElement(*[FiniteElement("Real", c, degree, variant=variant) + for c in cell.sub_cells], + cell=cell) + return super().__new__(cls) def __init__(self, diff --git a/finat/ufl/tensorproductelement.py b/finat/ufl/tensorproductelement.py index a580c8c7..a5e81a35 100644 --- a/finat/ufl/tensorproductelement.py +++ b/finat/ufl/tensorproductelement.py @@ -39,7 +39,10 @@ def __init__(self, *elements, **kwargs): raise ValueError("TensorProductElement got an unexpected keyword argument '%s'" % keywords[0]) cell = kwargs.get("cell") - family = "TensorProductElement" + try: + family, = {e.family() for e in elements} + except ValueError: + family = "TensorProductElement" if cell is None: # Define cell as the product of each elements cell