Usually, the lammps code use half neighbor list to calculate the two body
interactions. Now if I do not skip half of the j atoms (neighbor list of
atomi), and calculate the force between all i and j atoms. Then do the
no, using full neighbor lists works differently.
in init_style() you have to have the following code:
int irequest = neighbor->request(this);
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1;
fpair does not need to be halved only the energy.
f\[i\]\[0\] \+= delx\*fpair;
f\[i\]\[1\] \+= dely\*fpair;
f\[i\]\[2\] \+= dely\*fpair;
and then you do not need to add forces to "j"-particles.
f\[j\]\[0\] \-= delx\*fpair;
f\[j\]\[1\] \-= dely\*fpair;
f\[j\]\[2\] \-= delz\*fpair;
finally, you have to use ev_tally_full(...);
Except the difference of the computing efficiency, does this have the same
meaning with the half neighbor list?
yes, it should give the same results. i would _highly_ recommend
to try this first with pair_lj_cut.cpp and see if you can get this set up
so that both pair styles produce the same forces and energies.
only have you have understood how this works, i would go back
to working on your custom pair style. otherwise, you are likely
to get lost. i followed this path when i was working on adding
multi-threading to pair styles and it worked very well for me.