Damage modelling for performance-based earthquake engineering