Domain structure caused by internal stresses in heterophase solids