Adjoint optimization of a photonic crystal