O ct 2 01 8 Extension of Discrete Mechanics towards Electromagnetism