Hi,
I think this is possible, but I’m not entirely sure because I haven’t tried it myself and I don’t think anyone has actually done this yet.
Briefly, you would have to split your mesh in half, call one side masters and the other side slaves. You would then have to create one periodic subdomain with a large map that takes care of all the dofs on all the boundary facets. You would have to make sure that there is a one-to-one correspondence between facets on slave and master domains, i.e., you would have to make sure that such a correspondence exists when you create the mesh. This is not always the case, at least not with Gmesh. Note that if this works it will only do so for regular (Lagrange) finite elements with point evaluation of basis functions.