1717from numbers import Number
1818
1919from ufl .argument import Argument , Coargument
20- from ufl .coefficient import BaseCoefficient
2120from ufl .constantvalue import as_ufl
2221from ufl .core .operator import Operator
2322from ufl .core .ufl_type import ufl_type
@@ -135,9 +134,9 @@ def count(self):
135134
136135 @property
137136 def ufl_shape (self ):
138- """Return the UFL shape of the coefficient. produced by the operator."""
137+ """Return the UFL shape of the coefficient produced by the operator."""
139138 arg , * _ = self .argument_slots ()
140- if not isinstance (arg , BaseCoefficient ) and isinstance ( arg , ( BaseForm , Coargument ) ):
139+ if not isinstance (arg , Coargument ):
141140 arg , * _ = arg .arguments ()
142141 return arg ._ufl_shape
143142
@@ -147,9 +146,9 @@ def ufl_function_space(self):
147146 I.e. return the dual of the base form operator's Coargument space.
148147 """
149148 arg , * _ = self .argument_slots ()
150- if not isinstance (arg , BaseCoefficient ) and isinstance ( arg , ( BaseForm , Coargument ) ):
149+ if not isinstance (arg , Coargument ):
151150 arg , * _ = arg .arguments ()
152- return arg .ufl_function_space ()
151+ return arg .ufl_function_space (). dual ()
153152
154153 def _ufl_expr_reconstruct_ (
155154 self , * operands , function_space = None , derivatives = None , argument_slots = None
0 commit comments