A computational study of the third-harmonic (TH) generation (THG) and enhancement through an process in one-dimensional nonlinear photonic crystals is presented in this paper. We have introduced a canonical variational problem with a small increment factor to solve the THG problem. The problem with a large input pump intensity or strong nonlinear susceptibilities can be handled by a versatile and accurate method, which combines finite-element methods and a continuation fixed-point iteration algorithm. The TH signal generation and enhancement through the direct process are displayed by two periodic structures. Numerical experiments show that the TH signal is significantly enhanced when the frequencies of the fundamental wave and the TH wave are turned to the corresponding photonic band edges to meet the phase-matching condition. Results of numerical experiments also indicate that our proposed method is computationally efficient and precise to handle strong nonlinearities, i.e., large values of input pump power.