File /usr/local/lib/python3.9/dist-packages/ufl/algorithms/check_arities.py:170, in check_integrand_arity(expr, arguments, complex_mode)
168 for arg, conj in arg_tuples:
169 if arg.number() == 0 and not conj:
--> 170 raise ArityMismatch("Failure to conjugate test function in complex Form")
171 elif arg.number() > 0 and conj:
172 raise ArityMismatch("Argument {0} is spuriously conjugated in complex Form".format(arg))
ArityMismatch: Failure to conjugate test function in complex Form
Do you know where the problem comes from?
I guess it comes from the following variational problem but I don’t see how to fix it:
a = u * v * ufl.dx + dt*ufl.dot(ufl.grad(u), ufl.grad(v)) * ufl.dx
L = (u_n + dt * f) * v * ufl.dx
which will properly conjugate v. Alternatively you can swap to real mode of dolfinx and the code will run as is. I don’t know if this behaviour is intended or a bug, but if intended I think it may be a good idea to change the code in the tutorials so that everything works in both real and complex modes.
There should be two kernels available in the docker-image dolfinx/lab. Go to Kernel->Change Kernel->Python 3 (ipykernel) as opposed to Python3 (DOLFINx complex)