Can fix atom/swap be localized

Structural equilibration using atom/swap would be more effective (an perhaps more like the actual process) if the pair of atoms chosen were nearby - so the switching of the two also modifies the potential that they go into. A convenient approach might be to select as the second atom one which is on the neighbor list of the first. Has anyone implemented something like that? Or have some advice on that approach?
Thanks

I am not aware of any attempt to implement this. The number of modifications to fix atom/swap should not be a lot. For the most part one needs to request a neighbor list and then use that instead of the existing function to select the two atoms to be swapped. I am not sure whether this is better implemented as a derived class (with fix atom/swap as parent) or by just adding a keyword (similar to semi-grand) to the existing code.

Axel.

Thanks for the encouragement - the changes do seem trivial - but of course it is easy to miss critical components. Taking a first pass, I found it only necessary to add an optional neighbor key word, and force the local_atom_jswap_list to contain only neighbors of the i atom. I’ve probably missed some other critical components. Is this something you’d be willing to look over? (I would attach the modified fix_atom_swap.cpp but as new user I’m not allowed to upload)

I only have time to review people’s code, if they prepare it for submission into the LAMMPS code base through creating a pull request on github. For basic debugging, you are on your own. Sorry.