The extended finite element method (XFEM) is proposed for discontinuous problems. It is widely used to solve discontinuous problems due to the independence of computational meshes and discontinuous interfaces. Therefore
the preprocessing that transforms discontinuous interfaces and computational meshes geometry information to topological information becomes precondition of this method. According to the application of two-dimensional XFEM to discontinuous rock masses problems
generation of mesh and topological information of elements are studied. Two-dimensional preprocessing program is developed according to the algorithm of automatic generation of topological information. The geometry information of interfaces and meshes is converted to topological information which is needed in the computation. The results demonstrate the applicability and correctness of the program. In addition
the promising potential of the XFEM application to discontinuous rock masses problems is proved