We consider the problem of calculating the eikonal function defined on a certain curved surface from the condition of generating a prescribed irradiance distribution on a target surface. We show that the calculation of the "ray mapping" corresponding to the eikonal function is reduced to the solution of a linear assignment problem (LAP). We propose an iterative algorithm for calculating a refractive optical surface from the condition of generating a prescribed near-field irradiance distribution in a non-paraxial case. The algorithm is based on sequential calculation of eikonal functions defined on curved surfaces using the LAP-based approach. The proposed algorithm is applied to the calculation of refractive optical elements generating uniform irradiance distributions in a rectangular region and in a region in the form of the letters "IPSI" in the case of a circular incident beam. The presented ray-tracing simulations of the designed optical elements demonstrate high efficiency of the proposed iterative algorithm.