Ferromagnetic resonance in thin films and heterostructures is studied by micromagnetic simulation. Using a Fourier transform, we obtain the power spectrum of modes of precession and demonstrate that they agree with experimental results. Additional resonance modes associated with demagnetization effects are observed and studied as a function of the sample dimensions. Sufficiently confined geometries lead to a reorientation of the resonance mode, and a dramatic change in its frequency. Finally, the simulations are extended to exchange-coupled bilayers where energy is transferred between magnetic materials. © 2014 AIP Publishing LLC.