Phase space compression of the antiproton beam in ELENA will be performed by a new electron cooler. The performance of the cooler is greatly influenced by the properties of the electron beam. Careful design of the electron gun electrodes, the quality of the guiding magnetic field and the efficient recuperation of the electrons in the collector ensure that the cooler performance is optimal. We have used COMSOL Multiphysics to design and optimise the complete electron cooler with particular attention to the gun and collector. This software suite uses physics interfaces for modelling common applications and then allows the user to combine the different interfaces in one multi-physics simulation