[lammps-users] Outputing Distances Between Different Types of Atoms


I want to create an output file containing data in the format shown below.

D, typ1, x1,y1,z1, typ2, x2,y2,z2

, where

D is the distance between atom 1 and atom 2 having coordinates (x1,y1,z1) and (x2,y2,z2) respectively. I only want output if atom 1 and 2 are different types, typ1 != typ2.

My attempt, using the following lines of script, generated only errors ("Could not dump custom compute ID" ).

compute 1 all pair/local dist
dump ani all 10 c_dist .....

I was thinking I might have to write my own code for this, but I wanted to see if I could use "compute" and "dump" commands to do this in LAMMPS first. Can someone suggest the proper syntax?

Thanks very much!

Nicholas Jabari Lee

To dump pairwise info about pairs of atoms, you need dump local, not
dump custom. The latter outputs per-atom info (one line per atom).
Dump local can dump the distance between two pairs, but not the
other stuff. So you probably need to create two dump files, one
with one line per atom, one with one line per pair. And merge them
in an intelligent way, after a run.