Skip to content

Commit

Permalink
Fix pullback for symmetric tensors with non-scalar subelements (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck authored Nov 14, 2024
1 parent f7ef9fc commit d5c7b33
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ufl/pullback.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit d5c7b33

Please sign in to comment.