Skip to content

Commit

Permalink
Fix Piola pullbacks for VectorElement (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck authored Nov 14, 2024
1 parent d5c7b33 commit 3be472e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ufl/pullback.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def physical_value_shape(self, element, domain) -> typing.Tuple[int, ...]:
The value shape when the pull back is applied to the given element
"""
gdim = domain.geometric_dimension()
return (gdim,) + element.reference_value_shape[1:]
return element.reference_value_shape[:-1] + (gdim,)


class CovariantPiola(AbstractPullback):
Expand Down Expand Up @@ -200,7 +200,7 @@ def physical_value_shape(self, element, domain) -> typing.Tuple[int, ...]:
The value shape when the pull back is applied to the given element
"""
gdim = domain.geometric_dimension()
return (gdim,) + element.reference_value_shape[1:]
return element.reference_value_shape[:-1] + (gdim,)


class L2Piola(AbstractPullback):
Expand Down Expand Up @@ -283,7 +283,7 @@ def physical_value_shape(self, element, domain) -> typing.Tuple[int, ...]:
The value shape when the pull back is applied to the given element
"""
gdim = domain.geometric_dimension()
return (gdim, gdim)
return element.reference_value_shape[:-2] + (gdim, gdim)


class DoubleCovariantPiola(AbstractPullback):
Expand Down Expand Up @@ -326,7 +326,7 @@ def physical_value_shape(self, element, domain) -> typing.Tuple[int, ...]:
The value shape when the pull back is applied to the given element
"""
gdim = domain.geometric_dimension()
return (gdim, gdim)
return element.reference_value_shape[:-2] + (gdim, gdim)


class CovariantContravariantPiola(AbstractPullback):
Expand Down Expand Up @@ -371,7 +371,7 @@ def physical_value_shape(self, element, domain) -> typing.Tuple[int, ...]:
The value shape when the pull back is applied to the given element
"""
gdim = domain.geometric_dimension()
return (gdim, gdim)
return element.reference_value_shape[:-2] + (gdim, gdim)


class MixedPullback(AbstractPullback):
Expand Down

0 comments on commit 3be472e

Please sign in to comment.