Fast calculation of the quality factor for two-dimensional photonic crystal slab nanocavities.