Skip to content

Commit

Permalink
add variant for MixedElement
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Nov 1, 2022
1 parent 844154e commit 51af898
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ufl/finiteelement/mixedelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,13 @@ def degree(self, component=None):
def reconstruct(self, **kwargs):
return MixedElement(*[e.reconstruct(**kwargs) for e in self.sub_elements()])

def variant(self):
try:
variant, = {e.variant() for e in self.sub_elements()}
return variant
except ValueError:
return None

def __str__(self):
"Format as string for pretty printing."
tmp = ", ".join(str(element) for element in self._sub_elements)
Expand Down

0 comments on commit 51af898

Please sign in to comment.