Finite-element analysis of disorder effects in photonic crystals