Computation of singular solutions in elliptic problems and elasticity