I’d like to get a list of particles that lie within the force-cutoff radius from an arbitrary location in space. If I can get the particles in the computational “bins” surrounding the location, that would certainly be a great start.
I’m developing an algorithm that needs the potential energy and force (on a test-particle) at a series of points in the domain, which are determined dynamically at run-time. This process is part of a calculation that is not part of the integration of the equations of motion, so all other particles can be considered fixed. Bearing this in mind, I’d like to avoid unnecessary re-building of the bin- and neighbor-lists. There will also be many of these calculations, so a loop over all of the processor’s atoms is equally undesirable!
I’ve been digging through the source code a little, and see that Neighbor::coord2bin(…) and Neighbor::binhead can (I think) give me the data I’m after. However, both are protected members of the Neighbor class and are therefore unavailable to my new fix. I’d obviously like to avoid hacking up any internal LAMMPS classes - is there an easy way for me to get the information I need? I’m new to LAMMPS, so may have missed something very obvious.
I'd like to get a list of particles that lie within the force-cutoff
radius from an arbitrary location in space. If I can get the particles in
the computational "bins" surrounding the location, that would certainly be
a great start.
I'm developing an algorithm that needs the potential energy and force (on
a test-particle) at a series of points in the domain, which are determined
dynamically at run-time. This process is part of a calculation that is
*not* part of the integration of the equations of motion, so all other
particles can be considered fixed. Bearing this in mind, I'd like to avoid
unnecessary re-building of the bin- and neighbor-lists. There will also be
many of these calculations, so a loop over all of the processor's atoms is
equally undesirable!
I've been digging through the source code a little, and see that
Neighbor::coord2bin(...) and Neighbor::binhead can (I think) give me the
data I'm after. However, both are protected members of the Neighbor class
and are therefore unavailable to my new fix. I'd obviously like to avoid
hacking up any internal LAMMPS classes - is there an easy way for me to get
the information I need? I'm new to LAMMPS, so may have missed something
very obvious.
the most straightforward approach that i could think of is to include
additional particles at the desired locations that generate no forces or
energy. you could use pair style hybrid and then loop within the compute
function of a custom pair style for these special particles over the
neighbors.
if you then also write a fix that will update the positions of these
particles as needed and exclude their DoFs from the overall temperature
and pressure calculation, you should be on your way. hacking into the
neighbor list classes is something i would advise to avoid unless you know
what you are doing.