[lammps-users] DUMP file formatting with x, y, z

Hello,

I am getting the x y z coordinates with only one space between them, like this

ITEM: ATOMS id mol type element x y z
1 1 1 TAIL 9.31793 20.8391 19.4706

.
.

1039 95 1 TAIL 8.48205 4.97436 20.7699

Now if I want to read the x coordinate of the dump file using this python line (like coordx=lineA[12:19]), I get an error because the interval 12 to 19 in the dump file is not always the x_coodinate range.

Now if I can increase this spacing like this

ITEM: ATOMS id mol type element x y z
1 1 1 TAIL 9.31793 20.8391 19.4706

.
.

1039 95 1 TAIL 8.48205 4.97436 20.7699, i can easily get my x-coordinates

can i do it in LAMMPPS dump or dump_modify.

I am trying to calculate the lipid bilayer thickness from the x-coordinates of the dump file.

Thanks
SALAH

Why don’t you just improve the parsing in your python script?

for example you could try:

cols = lineA.split()
and then access the x coordinate as cols[4]

or use the dump.py tool from Pizza.py to process dump files.
see the folder tools/python/

axel.