@@ -81,7 +81,7 @@ def test_function_coefficients(self):
8181
8282 assert np .all (np .isclose (f0 .data [:] - f1 .data [:], 0.0 , atol = 1e-5 , rtol = 0 ))
8383
84- def test_function_coefficients_xderiv (self ):
84+ def test_function_coefficients_xderiv_legacy (self ):
8585 p = Dimension ('p' )
8686
8787 nstc = 8
@@ -105,6 +105,21 @@ def test_function_coefficients_xderiv(self):
105105 op = Operator (eqn )
106106 op ()
107107
108+ @pytest .mark .parametrize ('order' , [2 , 4 , 6 , 8 ])
109+ def test_function_coefficients_xderiv (self , order ):
110+ p = Dimension ('p' )
111+
112+ grid = Grid (shape = (51 , 51 , 51 ))
113+ x , y , z = grid .dimensions
114+
115+ f = Function (name = 'f' , grid = grid , space_order = order )
116+ w = Function (name = 'w' , space_order = 0 , shape = (* grid .shape , order + 1 ),
117+ dimensions = (x , y , z , p ))
118+
119+ expr0 = f .dx (w = w ).dy (w = w ).evaluate
120+ expr1 = f .dxdy (w = w ).evaluate
121+ assert sp .simplify (expr0 - expr1 ) == 0
122+
108123 def test_coefficients_w_xreplace (self ):
109124 """Test custom coefficients with an xreplace before they are applied"""
110125 grid = Grid (shape = (4 , 4 ))
0 commit comments