Discrete modeling of masonry structures under dynamic loading