A self-consistent field theory of crystals☆