Fix addforce per atom (using atom ids) not per group (using group ids)

It is strange how one cannot make a one-to-one mapping between group-ID and atom-ID. If this can be done, which is not allowed through a hard constraint (32) on unique groups, then all the fixes etc. can be applied to uniquely identifiable atoms and not just groups of them. Of course, this can be done for Natoms <= 32 but this is exceptional since we care about Natoms spanning 10^3- 10^7 atoms in most cases.

If this can be solved I can simply use the existing fix addforce method to add a nonconservative drive to individual particles (simulating active particles), with the fx,fy,fz determined by my python script. Before you mention: fix propel/self appears to not reproduce known phenonomena in simple active systems such as Motility Induced Phase Separation, and, as such, I avoid using it though it may other specific applications.

Unless I have missed something in my years of using LAMMPs, there is not a simple way (or obviously embedded in the existing documentation) to kick individual atoms without doing this through groups.

Using one fix per atom would be a very bad idea since it will serialize execution of the fixes and thus massively slow down your calculation.

You can provide per-atom unique forces with LAMMPS. This can be done with atom style variables for example, or you can couple to an external code that computes forces using fix external. That functionality is also available from the LAMMPS python module using python callbacks. But keep in mind that using python will also slow down your calculation, as execution of python code is usually about 100x slower than compiled code.
If you prefer to run LAMMPS the traditional way as an executable you can also look into using fix python/move. There is an example in the examples/python folder that shows how to implement fix nve this way.

Rather that badmouthing other people’s work that has been useful to them and that they were generous enough to contribute it to the LAMMPS distribution, you should show us how it can be done better. Complaining only alienates people.

Nice recommendation for “fix external”, this didn’t surface whilst I was googling around and exploring the documentation. It might be useful, in the documentation, to relate this command to fix addforce, and vice-versa, where the relation is in manipulating forces on particles beyond pair-wise interactions.

Yes python code is slower, using PyPy or even compiling to XLA helps but not worth the effort for something simple. Python/move is new to me and will check that out.

Feel free to write what you think should be added to the documentation and submit it as a pull request. LAMMPS is open source and its development is community-driven.

But fix external is meant for bringing forces “in” from an external script while fix addforce calculates those forces inside LAMMPS itself – two very different use cases. Here’s an example of using atom-style variables to impose custom per-atom (and per-position and -velocity!) forces:

variable myForceX atom -2*vx*(id==1)
variable myForceZ 5*(y-4)*(id==8)-0.5*fz*(id==4)
fix myForce all addforce v_myForceX 0 v_myForceZ
# viscous x-damping on particle ID 1
# and scale down z-forces on particle ID 4 by half
# and funky y-z shear on particle ID 8

I’d argue against making this an explicit example in the documentation (we don’t need to show people more ways to point and shoot at their own feet) but it’s all implicitly there and easy enough to experiment with.