File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 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):
179179 # `action(Coefficient(V), Cofunction(V.dual()))`.
180180 if isinstance (left , Coefficient ):
181181 V_left = left .ufl_function_space ()
182- else :
182+ elif isinstance ( left , BaseForm ) :
183183 V_left = left .arguments ()[- 1 ].ufl_function_space ().dual ()
184+ else :
185+ raise TypeError ("Action left argument must be either Coefficient or BaseForm" )
184186 if isinstance (right , Coefficient ):
185187 V_right = right .ufl_function_space ()
186- else :
188+ elif isinstance ( right , BaseForm ) :
187189 V_right = right .arguments ()[0 ].ufl_function_space ().dual ()
190+ else :
191+ raise TypeError ("Action right argument must be either Coefficient or Base Form" )
188192
189193 if V_left .dual () != V_right :
190194 raise TypeError ("Incompatible function spaces in Action" )
You can’t perform that action at this time.
0 commit comments