A numerical model for environmentally induced deterioration of masonry structures