1D mesh with a border of a 2d mesh

Hello, I would like to keep only one border of my rectangle 2d mesh and I want it to be a 1d mesh, but I dont want to recreate a independant mesh on this border because I would like the functions of the fespace of the 2d mesh to be integrable on the 1d mesh (like it would be on a border), is it possible ? Thank you very much.