Nanomechanical control of optical field and quality factor in photonic crystal structures