Dynamic analysis of buildings with viscoelastic devices: a numerical method