[ase-users] Resort atoms object by atom number

fabian Fabian.T89 at web.de
Fri Dec 8 19:47:20 CET 2017


Dear all,

I read a POSCAR file into an atoms object via

atoms = read("POSCAR")

now i want to resort the atoms object such that the atom with the Number 
*/n_atom/* is moved from its postion to the index 0
(1 if not counted the pythonic way), such that it is later writen as the 
first entry  into the atoms object.
later i want to write the object via:

write('POSCAR', atoms, vasp5=True, sort=False, 
direct=True,long_format=True, format='vasp')

and have the entry corresponding to */n_atom /*as the first Atom in the 
POSCAR file. I found a dirty workaround with temp files but
this means i have to convert each initial structure to the right format 
. Else i create wrong files.

Is this possible within ASE?

On a side not if i pop an atom via:

atoms.pop( */n_atom/*)


is */n_atom /*defined the pythonic way and starting at 0?


Al the best

fabian
*//*

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20171208/3bf2c8cc/attachment.html>


More information about the ase-users mailing list