Insights into nanoparticle shape transformation by energetic ions