See this post for a discussion of “ghost cells” commonly used to implement periodic boundary conditions.