We developed a novel numerical simulation method for volume diffractive optics based on the Takagi-Taupin (TT) dynamical theory of diffraction. A general integral system of equations with a powerful and convenient distortion function was developed for finite-element analysis (FEA). The proposed framework is promising with regard to flexibility, robustness, and stability and has potential for solving dynamical X-ray diffraction problems related to diffractive optical elements of arbitrary shape and deformation. This FEA method was used for evaluating laterally graded multilayer (LGML) mirrors, and a general coordinate system was introduced to make the geometric optimization simple and effective. Moreover, the easily implemented boundary conditions inherent in FEA, combined with the analysis of the energy resolution derived from the TT theory, can make the simulation of volume diffractive optics, including LGML mirrors, more accurate. Thus, a comprehensive and highly efficient computation of LGML mirror diffraction problems was performed. The evaluation of the effects of the figure errors can provide practical guidance for the fabrication of X-ray optical elements.