Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions finat/ufl/finiteelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion finat/ufl/tensorproductelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading