  How does the spectrum of a Schr\"odinger operator vary if the corresponding
geometry and dynamics change? Is it possible to define approximations of the
spectrum of such operators by defining approximations of the underlying
structures? In this work a positive answer is provided using the rather general
setting of groupoid $C^\ast$-algebras. A characterization of the convergence of
the spectra by the convergence of the underlying structures is proved. In order
to do so, the concept of continuous field of groupoids is slightly extended by
adding continuous fields of cocycles. With this at hand, magnetic Schr\"odinger
operators on dynamical systems or Delone systems fall into this unified
setting. Various approximations used in computational physics, like the
periodic or the finite cluster approximations, are expressed through the
tautological groupoid, which provides a universal model for fields of
groupoids. The use of the Hausdorff topology turns out to be fundamental in
understanding why and how these approximations work.
  Corrigendum: A correct statement of Theorem 4 is provided. The change does
not affect the main results.
