Topological_periodic BC vs geometrical_periodic BC

Hi,

For the library dolfinx_mpc, I find that there are basically two types of periodic constraint, but what is the main difference between them for usage?

If I just want to implent something like:
Screenshot from 2023-10-11 15-02-31
which one should I use? Thanks!

For complicated geometries, you do not necessarily have a geometrical marker function to decide what degrees for freedom should map from one side to another. You usually have some facets that are marked in some external meshing software, and imported into dolfinx as a MeshTags object. In this case, you would use the topological_periodic_bc to map all degrees of freedom associated with those facets to the other part of your mesh (through a mapping function). If you know the geometrical location of your dofs, as in your case with straight lines, you can use either function.