The dynamics of the intergalactic medium