Gmsh mesh with dolphin adjoint

You need to wrap the mesh with the dolfin_adjoint mesh class, i.e.

mesh = dolfin_adjoint.Mesh(mesh)

See for instance: Dolfin-adjoint overloaded solve fails but regular dolfin solve succeeds? - #2 by dokken