  Miniaturized optical resonators with spatial dimensions of the order of the
wavelength of the trapped light offer prospects for a variety of new
applications like quantum processing or construction of meta-materials. Light
propagation in these structures is modelled by Maxwell's equations. For a
deeper numerical analysis one may compute the scattered field when the
structure is illuminated or one may compute the resonances of the structure. We
therefore address in this paper the electromagnetic scattering problem as well
as the computation of resonances in an open system. For the simulation
efficient and reliable numerical methods are required which cope with the
infinite domain. We use transparent boundary conditions based on the Perfectly
Matched Layer Method (PML) combined with a novel adaptive strategy to determine
optimal discretization parameters like the thickness of the sponge layer or the
mesh width. Further a novel iterative solver for time-harmonic Maxwell's
equations is presented.
