Influence of the spatial structure of the gain on the dynamic properties of a laser