Micromechanical and macromechanical approaches for the analysis of periodic masonry structures