A computational study of the second-harmonic generation in one-dimensional photonic crystals made of GaAs and AlAs with quadratic optical nonlinearity and material dispersion is presented. The computational approach uses a shooting method to solve nonlinear wave equations for coupled fundamental and second-harmonic fields and the invariant imbedding method to obtain the linear transmittance and group index spectra. The photonic crystal is built with an elementary cell consisting of four sublayers whose thicknesses are systematically varied. Doubly-resonant second harmonic generation with high conversion efficiency is achieved by choosing the geometrical parameters of the elementary cell optimally and controlling the band structure. (C) 2009 Optical Society of Americ