I'm getting an error "Expecting equal argument rank terms among summands." when JIT comes across the following. This is the MWE that I was able to reproduce the error although if it is the global 'M'.
from fenics import *
mesh = IntervalMesh(10, 0, 1)
Pi = VectorElement("Lagrange",mesh.ufl_cell(),1,dim=2)
PS = MixedElement([Pi,Pi])
V = FunctionSpace(mesh,PS)
U = Function(V)
u1,u2 = split(U)
test_u1, test_u2 = TestFunctions(V)
dU = TrialFunction(V)
a = inner(u1,u1)*conditional(gt(1,0),u2[0],u2[0]) #error
#a = inner(u1,u1)*u2[0] # works
b = derivative(a,u1,test_u1)
F = b*dx
problem = NonlinearVariationalProblem(F, U, [], derivative(F, U, dU))
As far as I can tell, the error comes from the 'conditional' function.
Thanks!