Evaluation of the magnetic field near a crack with application to magnetic particle inspection