This function returns a MeshFunction which marks mesh entities of dimension dim according to:
2: slave entities 1: master entities 0: all other entities
It is useful for visualising and debugging the Expression::map function that is used to apply periodic boundary conditions.