A Two-Scale Algorithm for the Nonlinear Analysis of Damaged Masonry Brickwork