Statistical physics of grain-boundary engineering.