To play around, I looked a naive implementation of the stationary Navier-Stokes problem
from dolfin import *
mesh = UnitSquareMesh(20, 20)
V = FunctionSpace(mesh, 'CG', 2)
W = MixedFunctionSpace([V, V])
P = FunctionSpace(mesh, 'CG', 1)
WP = MixedFunctionSpace([W, P])
up = Function(WP)
u, p = up.split()
v, q = TestFunctions(WP)
rho = 1.0
mu = 1.0
f = Expression(('0.0', '-1.0'))
F = dot(grad(u) * u, v) * dx \
+ dot(grad(p), v) * dx \
+ mu * inner(grad(u), grad(v)) * dx \
+ dot(f, v) * dx \
+ div(u) * q * dx
solve(F == 0, up)
The above yields the error
No Jacobian form specified for nonlinear variational problem.
Differentiating residual form F to obtain Jacobian J = F'.
All terms in form must have same rank.
[...]
ufl.log.UFLException: All terms in form must have same rank.
which I fail to interprete. Any hint on what's going wrong?