How to set Neumann boundary conditions to solve adjoint variable

Dear @Pasuta

It is quite hard to give you any guidance when you do not specify mathematically what problems you are solving.

I have already sketched out how to set up the adjoint equations in DOLFINx at: Calculate sensitivity when the control is a fem function - #3 by dokken
which I have sent to you before.