# More detailed information about pairs

Dear LAMMPS developers,

I have 2 questions.

I would be very grateful if you would mind give me a short answer.

I am running a granular style pair potential:

pair_style gran/hooke 1 0 1 0 0 0
pair_coeff * *

Particles are frictionless so you do not need to worry about the tangential force.

I want to dump the following information of ALL of pairs of interacting particles

id1 x1 y1 z1 m1 id2 x2 y2 z2 m2 vx1 vy1 vz1 vx2 vy2 vz2 force

being:

id1 = id if particle 1

x1 = x-component of position of 1 particle – likewise y1 and z1

m1 = mass of particle 1

vx1 = x-component of velocity of particle 1 — likewise for particle 2

and finally force = inte-particle force.

As far as I see I need to use

compute pair/local

but attributes of this function are only:

dist eng force

and with this compute I have no access to the above mentioned parameters such as x y z mass etc.

1. How can I do this in LAMMPS?

2. when I use dump to print the quantities of interest, should I do something like this:

dump my_dmp all local 1000 dump.* id1 x1 y1 z1 m1 id2 x2 y2 z2 m2 vx1 vy1 vz1 vx2 vy2 vz2 force

or there is a more clever way of doing this?

Dear LAMMPS developers,

I have 2 questions.

I would be very grateful if you would mind give me a short answer.

I am running a granular style pair potential:

pair_style gran/hooke 1 0 1 0 0 0
pair_coeff * *

Particles are frictionless so you do not need to worry about the
tangential force.

I want to dump the following information of ALL of pairs of interacting
particles

id1 x1 y1 z1 m1 id2 x2 y2 z2 m2 vx1 vy1 vz1 vx2 vy2
vz2 force

being:

id1 = id if particle 1

x1 = x-component of position of 1 particle -- likewise y1 and z1

m1 = mass of particle 1

vx1 = x-component of velocity of particle 1 --- likewise for particle 2

and finally force = inte-particle force.

As far as I see I need to use

compute pair/local

but attributes of this function are only:

dist eng force

and with this compute I have no access to the above mentioned parameters
such as x y z mass etc.

1) How can I do this in LAMMPS?

​you have to modify the source code get exactly this kind of output.

2) when I use dump to print the quantities of interest, should I do
something like this:

dump my_dmp all local 1000 dump.* id1 x1 y1 z1 m1 id2 x2 y2
z2 m2 vx1 vy1 vz1 vx2 vy2 vz2 force

or there is a more clever way of doing this?

​actually, dumping this information is not clever at all. there is a large
amount of pairs, thus you will have a large amount of data that will
​written out. this will be made even larger by the fact, that most of the
information you want to write out is not pair-wise and thus will be
redundant (coordinates, velocities, mass). it would be much more efficient
to write out a regular dump file with id, m, x, y, z, vx, vy, vz and then
have id1, id2, force as pairwise output. you can then always look up
position and velocity data from the per-atom dump file.

you didn't say what you want to do with this information. perhaps there is
an alternate way to achieve it.

​axel.​

Dear Axel,

Thanks a lot for your kind reply and also very constructive suggestion.

Dear Axel,

Thanks a lot for your kind reply and also very constructive suggestion.

​actually, dumping this information is not clever at all. there is a large

amount of pairs, thus you will have a large amount of data that will
​written out. this will be made even larger by the fact, that most of the
information you want to write out is not pair-wise and thus will be
redundant (coordinates, velocities, mass). it would be much more efficient
to write out a regular dump file with id, m, x, y, z, vx, vy, vz and then
have id1, id2, force as pairwise output. you can then always look up
position and velocity data from the per-atom dump file.

Yes, this is a very good suggestion. Now suppose I want to " dump id1 id2
force" then I should do

compute pair/local force

dump my_dmp all local 1000 dump.* index force

right?

command documentation and the compute property/local​ command documentation
very carefully.

One more question, the wild character in dump.* will be replaced by the
the current number of step. If I want to have simply a sequential
list dump.1 dump.2 dump.3 ... is there any way to make a loop for this in
the script?

​no, but i consider this a good thing. this way, you don't have to remember
what the mapping between an individual file and the time step is, and
looping over any regular equidistant sequence is the same programming
effort. you just have a different increment and start value.

you didn't say what you want to do with this information. perhaps there
is an alternate way to achieve it.

I will look at distribution of the forces and spatial correlations.

as i already mentioned, ​doing this as a post​-processing step can become
very time consuming and inefficient (formatting & writing as well as
reading & parsing of text files is quite slow compared to computing
pairwise interactions of granular pair styles. LAMMPS has a mechanism,
which is demonstrated in the USER-TALLY package, to efficiently insert
computations *while* looping over pairs and using the resulting force
directly instead of recomputing it a second time in a dedicated compute
style using the (less efficient) Pair::single() methods. of course, that
will require some C++ programming.

​axel.​