A damage model for masonry structures