Abstract In order to launch a high-density electron beam to be focused in the 5 T superconducting solenoid of the Frankfurt EBIS [R. Becker et al., Nucl. Instr. and Meth. B24 (1987) 838], an electron gun has been designed, with a 0.5 mm diameter LaB 6 cathode (FEI Comp., Beaverton, USA) in a 70 mm diameter electrode geometry. The emitting surface is placed in the axial fringing field of the solenoid, modified by an axial shielding disk and a bucking coil, to provide either immersed flow or Brillouin flow conditions for the focused beam. Since the cathode diameter is small as compared to the electrodes, a new feature of EGN2 [W.B. Herrmannsfeldt, SLAC-331 (1988)] had to be used in order to have a sufficient number of meshes along the emitting surface. By starting a field line in the large geometry, a curved Neumann boundary is found for a subdivided part of the gun, which represents the influence of the larger part. EGN2 writes the coordinates of this field line on a file, which can be used by POLYGON [R. Becker, Nucl. Instr. and Meth. B42 (1989) 162] (a boundary setup program for EGN2) to define a curved Neumann boundary. By this procedure, it becomes possible to get a reliable simulation of the emission properties of a small cathode in large gun electrodes. The magnetostatic field calculations have been performed with INTMAG [R. Becker, Nucl. Instr. and Meth. B42 (1989) 303], which is a new program of the boundary element method type. Due to the integration calculus, the results do not need smoothing or “Maxwellisation” for the use in EGN2, where the off-axis fields are evaluated by radial expansion. INTMAG provides an output file, which is suitably formatted to be read in by EGN2. The gun design is based on space-charge-limited emission, but no Pierce-type electrode has been provided in the vicinity of the cathode; instead a Wehnelt electrode on negative bias with respect to the cathode is used to create the correct Pierce-type equipotential in free space, ending on the cathode edge with the correct angle. This gives an additional adjustment tool, if the axial position of the gun is not perfect and it relaxes the radial tolerance requirements considerably.