I want to modify the position of atoms that fulfil a specific condition.
Currently, I can apply translation to all atoms or one atom but not multiple selected atoms.
from pyiron import Project
pr = Project('test')
uc = pr.create_ase_bulk('Fe',cubic=True)
uc.set_repeat(2)
shift = [.1,.2,.3]
uc.positions
For example, I want to translate only atoms whose Z coordinate is less than 1:
uc[uc.positions[:,2] < 1].positions += shift
uc.positions
Neither it moves atoms nor it returns any error.
However, translating only one atom or all atoms are working properly.
uc.positions += shift
uc.positions
uc[0].position += shift
uc[0]