Modelling masonry structures through the Mady code