  Topology optimization of permanent magnet systems consisting of permanent
magnets, high permeability iron and air is presented. An implementation of
topology optimization for magnetostatics is discussed and three examples are
considered. First, the Halbach cylinder is topology optimized with iron and an
increase of 15% in magnetic efficiency is shown, albeit with an increase of 3.8
pp. in field inhomogeneity - a value compared to the inhomogeneity in a 16
segmented Halbach cylinder. Following this a topology optimized structure to
concentrate a homogeneous field is shown to increase the magnitude of the field
by 111% for the chosen dimensions. Finally, a permanent magnet with alternating
high and low field regions is considered. Here a $\Lambda_\mathrm{cool}$ figure
of merit of 0.472 is reached, which is an increase of 100% compared to a
previous optimized design.
