[lammps-users] problem with fix setforce

Dear Lammps users,

I am trying to use “fix setforce” command in order to fix two particles in a box. The only interaction between them is Lennard-Jones.
I try to define new variable for the component of force (the output of fix setforce) on each particle and print them to different file using fix print command.
When I check the Force on two particles, they are not equal and in the opposite direction according to the Newton’s third law. The surface to surface separation of two particles is almost 1/10 of the box length in order to decouple the pair particles from their periodic images.

I am wondering why the magnitude of the Force on each particle is not the same and why they are not in the opposite direction!!!

Shahzad

How are you getting the force of one atom on the other from fix setforce?
It just computes the total force on the group. If you put both particles
in the group and use fix setforce to zero the forces, the fix will not
output the force of one atom on the other.

Steve

I put two atoms in two different groups and the output of fix setforce is the force on each group which in this case is just one atom.
Actually I was working on a group of atoms forming two rods and I wanted to calculate the force on each rod but this command gave me not equal forces so I tried to simplify the model to two atoms.