  We use density-functional methods to study the effects of an external
magnetic field on two-dimensional quantum dots with a rectangular hard-wall
confining potential. The increasing magnetic field leads to spin polarization
and formation of a highly inhomogeneous maximum-density droplet at the
predicted magnetic field strength. At higher fields, we find an oscillating
behavior in the electron density and in the magnetization of the dot. We
identify a rich variety of phenomena behind the periodicity and analyze the
complicated many-electron dynamics, which is shown to be highly dependent on
the shape of the quantum dot.
