Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing domain kwarg in pullback #361

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ufl/pullback.py
Original file line number Diff line number Diff line change
@@ -348,17 +348,18 @@ def is_identity(self) -> bool:
"""Is this pull back the identity (or the identity applied to mutliple components)."""
return False

def apply(self, expr):
def apply(self, expr, domain=None):
"""Apply the pull back.
Args:
expr: A function on a physical cell
domain: The domain on which the function is defined
Returns: The function pulled back to the reference cell
"""
from ufl.classes import Jacobian, JacobianDeterminant, JacobianInverse

domain = extract_unique_domain(expr)
domain = domain or extract_unique_domain(expr)
J = Jacobian(domain)
detJ = JacobianDeterminant(J)
K = JacobianInverse(domain)