From 6d1ce0f0df06484dc8ccf86835bd6113a0d9a0f5 Mon Sep 17 00:00:00 2001 From: Pablo Brubeck Date: Wed, 4 Jan 2023 10:03:17 -0600 Subject: [PATCH 1/2] add variant for MixedElement (#129) --- 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) From 5abf719713b75c81e787c29285182809728555d2 Mon Sep 17 00:00:00 2001 From: "Patrick E. Farrell" Date: Wed, 4 Jan 2023 16:03:49 +0000 Subject: [PATCH 2/2] Allow VectorElement to take a variant argument. (#17) Co-authored-by: Patrick Farrell