Multiscale damage contact-friction model for periodic masonry walls