periodic boundary conditions