add an npair_binning_style


If I wanted to create a substyle of npair for neighbor list construction with its own request flag that I could incur in a pair style, what would be the necessary variables, flags, etc. needed, if any, by the request class, the neighbor class, and such callers after creating the sub style.

There’s not a simple answer to this Q. You should look
at how other specialized NPair classes work, like granular neighbor lists.
The trickiest part is to define a mask flag that is selected
correctly in Neighbor::choose_pair() for exactly the pairmask

(defined in the npair_foo.h header file as the 3rd argument
of the NPairStyle macro. So that you get the neighbor list method
when you want it, but never when you don’t.


Yea I noticed that as far as I gathered from staring at the code; I created an npair header with a new bitmask variable added to the third macro argument and added that bitmask variable to neighbor.h. Then added a new request flag to the neighbor request header file followed by an additional if statement for that request flag in the choose_pair method of neighbor.cpp that checks for the new bitmask. Would that be sufficient for a pair style to seamlessly request this npair style? provided I didn’t mix up the masks that is.

That’s the right methodology. Then just look at the LAMMPS output
when it sets up a run. It should list info about which neighbor list(s)
are being used.


Alright, Thanks.

Adrian Diaz
Graduate Research Fellow – Mechanical and Aerospace Engineering
Herbert Wertheim College of Engineering
University of Florida

Contact – 786-863-2326