About next_reneighbour

Dear LAMMPS Developers and users,

I have a small confusion or am struggling to understand about next_reneighbor flag in fixes. Few fixes uses this flag and set to update->ntimestep which forces reneighboring immediately. I am using couple fixes: bond/create and bond/break. My confusion is: does the reneighboring takes place when neighbours->decide() step? Or does it take place right after every fix which invokes next_reneighbor ?

I apologise if this is too elementary question.


First off, please note the spelling. LAMMPS uses American English spelling. When using grep to search for locations of where a variable of function is used, these little differences matter!

A good place to learn about the purpose of a specific flag is to read the header files of the corresponding base class. For Fix::next_reneighbor this says: next time step to force a re-neighboring. Thus, this can obviously not be on the current time step, but it doesn’t necessarily have to be the immediate next time step, but it just means some time step in the future. This makes sense because fixes may or may not be invoked on every time step.

As for when to do a re-neighbor or not, that is the purpose of the Neighbor::decide() function (as implied by its name), and you can see this also of the control flow pseudo-code shown in the documentation at 4.7. How a timestep works — LAMMPS documentation

Fix::next_reneighbor is a member variable, not a function. So your statement here does not make sense.

Thank you for detailed response. It has clarified my doubt.