File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -179,12 +179,16 @@ def _check_function_spaces(left, right):
179
179
# `action(Coefficient(V), Cofunction(V.dual()))`.
180
180
if isinstance (left , Coefficient ):
181
181
V_left = left .ufl_function_space ()
182
- else :
182
+ elif isinstance ( left , BaseForm ) :
183
183
V_left = left .arguments ()[- 1 ].ufl_function_space ().dual ()
184
+ else :
185
+ raise TypeError ("Action left argument must be either Coefficient or BaseForm" )
184
186
if isinstance (right , Coefficient ):
185
187
V_right = right .ufl_function_space ()
186
- else :
188
+ elif isinstance ( right , BaseForm ) :
187
189
V_right = right .arguments ()[0 ].ufl_function_space ().dual ()
190
+ else :
191
+ raise TypeError ("Action right argument must be either Coefficient or BaseForm" )
188
192
189
193
if V_left .dual () != V_right :
190
194
raise TypeError ("Incompatible function spaces in Action" )
You can’t perform that action at this time.
0 commit comments