Global and local analysis of masonry buildings