Second harmonic generation in a photonic crystal