The discrete energy-momentum method