Dear @Meryem,
This code is far away from minimal, which means that it will take quite alot of time for anyone to debug this.
For the sake of clarity, could you:
Try to minimize the problem to:
- Only defining the dirichlet conditions for the two problems, not including the variational forms.
- Use
dolfinx.fem.petsc.set_bc, to apply the boundary condition to an existing function, and store the result, see for example: DirichletBC with mesh tags in dolfinx - weird behavior - #2 by dokken for a use-case of this.