Multigroup radiation hydrodynamics with flux-limited diffusion and adaptive mesh refinement