# Calculate forces between atoms and group

Hello LAMMPS Users,

I want to calculate per-atom force in one group during interactions with another group of atoms, but I also use fix setforce 0 0 0 to make this group as a rigid body. I think this command will give me 0 force value if I then dump the fx fy and fz. So, I would like to ask whether there is a way to derive per-atom force in such a situation?

Thank you!

This is too vague a description to give any specific advice.

Also it is inconsistent, e.g. using fix setforce 0 0 0 does not create rigid objects. People often use the term “rigid” incorrectly when they mean “immobilize”, but even then fix setforce 0 0 0 is not sufficient by itself and not the only option to achieve this effect.

Dear Prof. Akohlmey,

Sorry I didn’t ask my question clearly.

The question is like: I have a system containing a tool and a block material. I want to calculate the per-atom force on tool atoms added by the block material during the simulation. I use fix setforce to make the tool atoms fixed and then scratch the surface of the block material under fix move command, but with fix setforce, I can only get 0 value for the forces. And I want to ask if there is a way to solve this problem.

Also thank you very much for your clarification on “rigid” and “immobilize”. I misunderstood it before. Could you please give me some hints if I can actually use other commands to replace fix setforce?

Best,
Steven

The simplest way to immobilize atoms is to not apply time integration to them. Then you don’t need to wipe out their forces.

also using fix setforce on atoms that are subject to fix move is completely pointless. fix move does time integration without looking at forces or velocities of atoms but strictly following a prescribed motion.

Using the term “fixed” is not any better than “rigid” in the context of LAMMPS since there is also the “fix” command, so a term like “fixed” is just as ambiguous.

In research it is important to describe items in a specific and non-ambiguous manner. So any “slang” or “shortcut notation” requires a careful checking whether the people you are communicating with will interpret them the same way. it is usually best to assume they don’t.

Dear Prof. Akohlmey,

Thank you for your reply! Your suggestions are very comprehensive and useful to me! I never thought I can immobilize atoms by not applying time integration to the atoms. That’s a very cool idea to me. And yes, I should use “immobilized” but not “fixed”. Thanks for your instructions!

Best,
Steven