Modeling and numerical analysis of masonry structures