Skip to content

Commit

Permalink
Merge branch 'main' into pbrubeck/simplify-indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Jan 1, 2025
2 parents 7100560 + eabdb00 commit a2ebdfb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ufl/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,16 @@ def _check_function_spaces(left, right):
# `action(Coefficient(V), Cofunction(V.dual()))`.
if isinstance(left, Coefficient):
V_left = left.ufl_function_space()
else:
elif isinstance(left, BaseForm):
V_left = left.arguments()[-1].ufl_function_space().dual()
else:
raise TypeError("Action left argument must be either Coefficient or BaseForm")
if isinstance(right, Coefficient):
V_right = right.ufl_function_space()
else:
elif isinstance(right, BaseForm):
V_right = right.arguments()[0].ufl_function_space().dual()
else:
raise TypeError("Action right argument must be either Coefficient or BaseForm")

if V_left.dual() != V_right:
raise TypeError("Incompatible function spaces in Action")
Expand Down

0 comments on commit a2ebdfb

Please sign in to comment.