[lammps-users] Output neighbor list

Hi, LAMMPS users and developers,
Does anybody know if LAMMPS is capable of outputting the neighbor list at a certain time step?

Regards,

Hi, LAMMPS users and developers,
Does anybody know if LAMMPS is capable of outputting the neighbor list at a
certain time step?

no. that is not unless you modify the code.
why do you want to do that?
this is a huge amount of numbers.

cheers,
     axel.

Hi, Axel,
I am planning to do some Slip Vector Analysis (SVA, Zimmerman et al 2001), which needs a neighbor list.
I have considered to write a short code to compute the list, but for a non-parallel code it is going to take for ever to run on a large computational cell.
Actually, all I need is only one neighbor list from the very beginning of the simulation.
When it comes to modifying the source code, besides neighbor.cpp/h, what else should I look at?

Regards,
Shuai

Hi, Axel,
I am planning to do some Slip Vector Analysis (SVA, Zimmerman et al 2001),
which needs a neighbor list.

writing a code to build a neighbor lists is pretty straightforward.
you just have to program binning (or a cell list) first to make it
an O(N) instead of O(N**2) operation. you can "steal" and adjust
a simple minded implementation for cubic cells from here.
http://sites.google.com/site/akohlmey/software/ljmd

make sure you have a look at the talk slides first to see
what this is about.

I have considered to write a short code to compute the list, but for a
non-parallel code it is going to take for ever to run on a large
computational cell.

it will take _even_ longer to read in all that data, particularly
if you read it from text files. moreover, the neighbor lists are
generated with "local" atom indices, without knowing the mapping
to global atom indices ("tags") it will be utterly useless when
generated from a parallel run.

Actually, all I need is only one neighbor list from the very beginning of
the simulation.
When it comes to modifying the source code, besides neighbor.cpp/h, what
else should I look at?

why not write your analysis as a compute from within lammps?

cheers,
   axel.

Hi,
Thanks for the information. I am cheered.
I have heard of this “faster” algorithm of calculating the neighbor list. But still, if I can have a neighbor list good to go, I don’t even need to implement that algorithm into code.
However, it looks likes obtaining a neighbor list from LAMMPS is practically impossible for me - I am going to reconsider the first option you provided.
Writing this analysis into a compute will be ideal to me, however my poor familiarity to the structure of LAMMPS may prohibit me from doing so.

Thank you for advice,
Shuai

(1) You can dump something close to a neighbor list
via the compute property/local command and the dump local
command. See the patom1 and patom2 keywords.

Only atom pairs within the force cutoff are included which
is a subset of the neighbor list.

(2) There are several computes that use neighbor lists,
so you could create a similar one to do SVA. Grep
for the word neighbor in compute*cpp.

Steve

Steve,
Thanks for the advice, but:
(1) I could not find these two key words, patom1 and p atom2, could you please tell me where they are?
(2) I know that several computes use neighbor lists, but I guess one question lies in front of me is that how to store the neighbor list of the very first frame (probably a frame right after a relaxation) - I only need the neighbor list of the reference configuration.

Regards,
Shuai

See the compute property/local command. I also added natom1 and natom2
keywords if you want the full neighbor list (including pairs outside the force
cutoff.

Don't know why you would want to store a neighbor list. It's not meaningful
after atoms move. There would be no easy way to do that in LAMMPS.
And its generally a huge amount of memory.

Steve

Steve,
Thank you, I found those two keywords.
It may sound weird storing that neighbor list, and it could be meaningless if we are talking about something like centro-symmetry analysis. But this is crucial to slip vector analysis. In order to do this analysis I have to keep track ALL atoms that WERE inside of the cutoff distance of a given atom. And by comparing their relative positions (W. R. T. the atom of interest or center atom) between two frames (e.g. a reference frame in the beginning of a simulation and some intermediate frame during the simulation) I can quantify the slip happened locally. At least this is my understanding of how SVA is implemented.

Regards,
Shuai

You could write a fix that stores the neighbors of each atom
in a list at some reference time and carries that info around
with each atom as it moves. Again it would potentially be
a huge amount of storage. And you could write a compute
that accesses the info in that fix at later timesteps. However,
once atoms move to some arbitrary new position, they
will migrate to new processors. And some of the other atoms in atom I's
list will not be available to atom I for computation. I.e. the processor
that owns atom I will not know anything about arbitrary other atoms
in the simulation unless they still happen to be quite close to atom I.
That's why I think this may not work as you expect.

Steve

Thank you, Steve, I can see the problem now.
I’ll try to use the compute property/local command first, and write a code outside LAMMPS to do the analysis.

Regards,