Complex Calculate using complex solutions of variational formulation

There are multiple issues here.

  1. fem.assemble is not a command in DOLFINx. it would be fem.assemble_scalar.
  2. The input value to your constant is an integer, it should be: fem.Constant(msh, ScakarType(1)).

For the rest of your problem, have you tried using ufl to derive the boundary conditions and sourcing term?
I’ve for instance done this in Poisson problem with Neumann boundary condition - #6 by dokken