Diffuse-interface modeling of composition evolution in the presence of structural defects