  In this paper we investigate the higher dimensional divergence functions of
mapping class groups of surfaces and of CAT(0)--groups. We show that, for
mapping class groups of surfaces, these functions exhibit phase transitions at
the rank (as measured by thrice the genus plus the number of punctures minus
3). We also provide inductive constructions of CAT(0)--spaces with co-compact
group actions, for which the divergence below the rank is (exactly) a
polynomial function of our choice, with degree arbitrarily large compared to
the dimension.
