fixed periodic boundary conditions when only one direction is periodic