From d5c7b337e17ffc9414728487c5c8425cda579a0c Mon Sep 17 00:00:00 2001 From: Pablo Brubeck Date: Thu, 14 Nov 2024 10:22:14 +0000 Subject: [PATCH] Fix pullback for symmetric tensors with non-scalar subelements (#322) --- ufl/pullback.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ufl/pullback.py b/ufl/pullback.py index 06cfac9ef..831dda026 100644 --- a/ufl/pullback.py +++ b/ufl/pullback.py @@ -519,8 +519,10 @@ def physical_value_shape(self, element, domain) -> typing.Tuple[int, ...]: Returns: The value shape when the pull back is applied to the given element """ - assert element == self._element - return tuple(i + 1 for i in max(self._symmetry.keys())) + assert isinstance(element, type(self._element)) + subelem = element.sub_elements[0] + pvs = subelem.pullback.physical_value_shape(subelem, domain) + return tuple(i + 1 for i in max(self._symmetry.keys())) + pvs class PhysicalPullback(AbstractPullback):