An efficient method for seismic analysis of structures