@@ -1128,6 +1128,30 @@ def test_integral_grouping(compile_args):
1128
1128
assert len (unique_integrals ) == 2
1129
1129
1130
1130
1131
+ def test_derivative_domains (compile_args ):
1132
+ """Test a form with derivatives on two different domains will generate valid code."""
1133
+
1134
+ V_ele = basix .ufl .element ("Lagrange" , "triangle" , 2 )
1135
+ W_ele = basix .ufl .element ("Lagrange" , "interval" , 1 )
1136
+
1137
+ gdim = 2
1138
+ V_domain = ufl .Mesh (basix .ufl .element ("Lagrange" , "triangle" , 1 , shape = (gdim ,)))
1139
+ W_domain = ufl .Mesh (basix .ufl .element ("Lagrange" , "interval" , 1 , shape = (gdim ,)))
1140
+
1141
+ V = ufl .FunctionSpace (V_domain , V_ele )
1142
+ W = ufl .FunctionSpace (W_domain , W_ele )
1143
+
1144
+ u = ufl .TrialFunction (V )
1145
+ q = ufl .TestFunction (W )
1146
+
1147
+ ds = ufl .Measure ("ds" , domain = V_domain )
1148
+
1149
+ forms = [ufl .inner (u .dx (0 ), q .dx (0 )) * ds ]
1150
+ compiled_forms , module , code = ffcx .codegeneration .jit .compile_forms (
1151
+ forms , options = {"scalar_type" : np .float64 }, cffi_extra_compile_args = compile_args
1152
+ )
1153
+
1154
+
1131
1155
@pytest .mark .parametrize ("dtype" , ["float64" ])
1132
1156
@pytest .mark .parametrize ("permutation" , [[0 ], [1 ]])
1133
1157
def test_mixed_dim_form (compile_args , dtype , permutation ):
0 commit comments