An adaptive discrete-velocity model for the shallow water equations