Micromechanical analysis of periodic masonry