A second-order sharp numerical method for solving the linear elasticity equations on irregular domains and adaptive grids–application to shape optimization