Polydomain formation in epitaxial PbTiO3 films