Domain swapping in materials design