Skip to content

Commit

Permalink
Fix BaseFormOperator.ufl_function_space
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Feb 19, 2025
1 parent 31e5be7 commit 3ac569d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ufl/core/base_form_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def count(self):
def ufl_shape(self):
"""Return the UFL shape of the coefficient.produced by the operator."""
arg, *_ = self.argument_slots()
if isinstance(arg, BaseForm):
if isinstance(arg, Coargument):
arg, *_ = arg.arguments()
return arg._ufl_shape

Expand All @@ -144,10 +144,9 @@ def ufl_function_space(self):
I.e. return the dual of the base form operator's Coargument.
"""
arg, *_ = self.argument_slots()
if isinstance(arg, BaseForm):
if isinstance(arg, Coargument):
arg, *_ = arg.arguments()
return arg._ufl_function_space
return arg._ufl_function_space.dual()
return arg._ufl_function_space

def _ufl_expr_reconstruct_(
self, *operands, function_space=None, derivatives=None, argument_slots=None
Expand Down

0 comments on commit 3ac569d

Please sign in to comment.