An improved approach for modeling discrete cracks in two-dimensional anisotropic functional graded materials FGMs by XFEM is described. A general node meshing type-T3 with sub-triangle technique for enhancing the Gauss quadrature accuracy near the crack is applied to increase the accuracy of numerical results. Also, the useful incompatible interaction integral method (M-integral method) is used to calculate the stress intensity factors. Numerical simulations have proved that provides accurate results by less number of nodes (DOFs) in comparison with reference. The results of LEFM (liner elastic fracture mechanics) have been compared with the reference results, showing the reliability, stability, and the efficiency of present meshing of XFEM. Matlab program (M-file) is used to solve the aim of this paper.