Dumping only the velocities every timestep

Hello,

I am trying to dump the velocity of a single atom every timestep, and I’d like the dump file to contain only the velocity and no other text.

I’m using:

group myatom id 30
dump veldump myatom custom 1 vel.txt vx vy vz

which takes atom 30 and dumps the velocities to vel.txt in a format like this:

ITEM: TIMESTEP
1
ITEM: NUMBER OF ATOMS
1
ITEM: BOX BOUNDS pp pp pp
5.53577e-08 10.938
5.53577e-08 10.938
5.53577e-08 10.938
ITEM: ATOMS vx vy vz
0.979761 1.58506 -0.0616853

How can I dump ONLY the velocities into a file, without all the other text like box bounds, timestep, number of atoms, etc… ?

For example, I’d like the output to look like this:
0.979761 1.58506 -0.0616853

I would just do some post processing of this file but for my purposes it gets rather large around 10 million lines, so I’d rather just dump it directly from LAMMPS.

Thanks

You would have to modify the code for that I imagine, on the other hand vi and other large text editors easily open such file sizes so you can just delete the first few lines or if you don’t want to open it at all you can parse the file using a programming script to output another file without the header text.

You would have to modify the code for that I imagine, on the other hand vi
and other large text editors easily open such file sizes so you can just
delete the first few lines or if you don't want to open it at all you can
parse the file using a programming script to output another file without the
header text.

i would try using compression. on a rather repetitive output,
compression rate should be pretty high.
sames as how lammps writes compressed files, they can be uncompressed
on-the-flay when reading from a pipe.

axel.

I suppose that the issue is that the header lines are repeated at each dump step, ie manually removing the first lines is not enough. If I were you Andrew, I’d post-process the file using sed.

arthur

variable vx equal vx[30]
variable vy equal vy[30]
variable vz equal vz[30]
fix printmyatom all print 1 “{vx} {vy} ${vz}” file vmyatom.txt screen no title “vx vy vz”