Precise density-functional method for periodic structures.