3131from ufl .algorithms .apply_derivatives import apply_derivatives
3232from ufl .core .external_operator import ExternalOperator
3333from ufl .finiteelement import FiniteElement
34- from ufl .form import BaseForm
34+ from ufl .form import BaseForm , ZeroBaseForm
3535from ufl .pullback import identity_pullback
3636from ufl .sobolevspace import H1
3737
@@ -205,10 +205,10 @@ def test_differentiation_procedure_action(V1, V2):
205205def test_extractions (domain_2d , V1 ):
206206 from ufl .algorithms .analysis import (
207207 extract_arguments ,
208- extract_arguments_and_coefficients ,
209208 extract_base_form_operators ,
210209 extract_coefficients ,
211210 extract_constants ,
211+ extract_terminals_with_domain ,
212212 )
213213
214214 u = Coefficient (V1 )
@@ -219,15 +219,15 @@ def test_extractions(domain_2d, V1):
219219
220220 assert extract_coefficients (e ) == [u ]
221221 assert extract_arguments (e ) == [vstar_e ]
222- assert extract_arguments_and_coefficients (e ) == ([vstar_e ], [u ])
222+ assert extract_terminals_with_domain (e ) == ([vstar_e ], [u ], [ ])
223223 assert extract_constants (e ) == [c ]
224224 assert extract_base_form_operators (e ) == [e ]
225225
226226 F = e * dx
227227
228228 assert extract_coefficients (F ) == [u ]
229229 assert extract_arguments (e ) == [vstar_e ]
230- assert extract_arguments_and_coefficients (e ) == ([vstar_e ], [u ])
230+ assert extract_terminals_with_domain (e ) == ([vstar_e ], [u ], [ ])
231231 assert extract_constants (F ) == [c ]
232232 assert F .base_form_operators () == (e ,)
233233
@@ -236,14 +236,14 @@ def test_extractions(domain_2d, V1):
236236
237237 assert extract_coefficients (e ) == [u ]
238238 assert extract_arguments (e ) == [vstar_e , u_hat ]
239- assert extract_arguments_and_coefficients (e ) == ([vstar_e , u_hat ], [u ])
239+ assert extract_terminals_with_domain (e ) == ([vstar_e , u_hat ], [u ], [ ])
240240 assert extract_base_form_operators (e ) == [e ]
241241
242242 F = e * dx
243243
244244 assert extract_coefficients (F ) == [u ]
245245 assert extract_arguments (e ) == [vstar_e , u_hat ]
246- assert extract_arguments_and_coefficients (e ) == ([vstar_e , u_hat ], [u ])
246+ assert extract_terminals_with_domain (e ) == ([vstar_e , u_hat ], [u ], [ ])
247247 assert F .base_form_operators () == (e ,)
248248
249249 w = Coefficient (V1 )
@@ -252,14 +252,14 @@ def test_extractions(domain_2d, V1):
252252
253253 assert extract_coefficients (e2 ) == [u , w ]
254254 assert extract_arguments (e2 ) == [vstar_e2 , u_hat ]
255- assert extract_arguments_and_coefficients (e2 ) == ([vstar_e2 , u_hat ], [u , w ])
255+ assert extract_terminals_with_domain (e2 ) == ([vstar_e2 , u_hat ], [u , w ], [ ])
256256 assert extract_base_form_operators (e2 ) == [e , e2 ]
257257
258258 F = e2 * dx
259259
260260 assert extract_coefficients (e2 ) == [u , w ]
261261 assert extract_arguments (e2 ) == [vstar_e2 , u_hat ]
262- assert extract_arguments_and_coefficients (e2 ) == ([vstar_e2 , u_hat ], [u , w ])
262+ assert extract_terminals_with_domain (e2 ) == ([vstar_e2 , u_hat ], [u , w ], [ ])
263263 assert F .base_form_operators () == (e , e2 )
264264
265265
@@ -516,3 +516,10 @@ def test_replace(V1):
516516
517517 dN_replaced = dN ._ufl_expr_reconstruct_ (u , argument_slots = (A , uhat ))
518518 assert G == dN_replaced
519+
520+
521+ def test_ZeroDerivative (V1 ):
522+ u = Coefficient (V1 , count = 1 )
523+ N = ExternalOperator (Coefficient (V1 , count = 0 ), function_space = V1 )
524+ dN1 = expand_derivatives (derivative (N , u ))
525+ assert isinstance (dN1 , ZeroBaseForm )
0 commit comments