From 4d6b0645fe4ca25854fc8c24d8cebed0876982c3 Mon Sep 17 00:00:00 2001 From: Pablo Brubeck Date: Mon, 31 Oct 2022 10:49:00 +0000 Subject: [PATCH] add variant for MixedElement --- ufl/finiteelement/mixedelement.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ufl/finiteelement/mixedelement.py b/ufl/finiteelement/mixedelement.py index e80743fb9..d6715ae11 100644 --- a/ufl/finiteelement/mixedelement.py +++ b/ufl/finiteelement/mixedelement.py @@ -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)