# Issues with handling neighlists

Hello everyone,

I am trying to implement a potential which is based on the number of neighbors of type A atoms around type B and also distance based.
My initial thoughts was to modify pair_morse.cpp and create a new pair potential. I was less successful in listing/storing the total neighbors around each atoms.

Currently, I tried to test with compute coord/atom.
conf file has “compute 1 all coord/atom 45 3”, and included a line in compute_coord_atom.cpp

line 241 cvec[i] = n;
printf(“i = %d, cvec[%d]= %d, n = %d\n”, i, i, cvec[i], n);
line 242 } else cvec[i] = 0.0;

I am getting results as

current procs: 0
current procs: 1
i = 0, cvec[0]= 0, n = 4
i = 1, cvec[1]= 0, n = 8
i = 2, cvec[2]= 0, n = 8
i = 3, cvec[3]= 0, n = 8
i = 4, cvec[4]= 0, n = 4
i = 5, cvec[5]= 0, n = 1
i = 6, cvec[6]= 0, n = 1
i = 7, cvec[7]= 0, n = 8
i = 8, cvec[8]= 0, n = 4
i = 9, cvec[9]= 0, n = 300

I am using LAMMPS version SEP 2016, using mpi in 2 procs.

Question #1: why is cvec[0] = 0 instead of 4? Does this has anything to MPI?
Question #2: Is there a way to define an array which stores cvec and making it available to pair_morse.cpp?
Question #3: Is it possible to list out all the atoms, x, y, z in the unit cell without using ghost cells and images?
Question #4: Does anyone conduct LAMMPS workshop on modifying and extending it. I have seen the 2014 presentation of Steve, wondering any new hands-on workshops are offered.

any help would save a young man’s life in a dark room.
Joseph Gordon

Hello everyone,

I am trying to implement a potential which is based on the number of
neighbors of type A atoms around type B and also distance based.
My initial thoughts was to modify pair_morse.cpp and create a new pair
potential. I was less successful in listing/storing the total neighbors
around each atoms.

​please have a look at pair_eam.cpp instead. the EAM potential contains an
embedding term that is computed from density contributions at each atoms's
location.

check out how the "rho" values are collected in a first pass, and then
applied in the second pass. with the newton flag set to on for pair
computations, you also need a reverse communication to send the collected
information from local atoms to their corresponding ghosts in neighboring
cells.

​axel.​