Design of a sub-millimetric electron gun with analysis of thermomechanical effects on beam dynamics. (December 2015)