Force calculation per atom by specific groups of atoms;

Dear Lammps users,

The description of my problem:

I want to calculate total force on type 1 atom, only by type 2 atoms on certain region. Then I want to use this parameter and put an additional condition on velocities of those atoms.

So far, I am trying to do:

I believe that this can be done only by modifying source code. I’m trying to learn “lj/cut” and other pair style formats to see force calculation and then dump as well as “compute per atom command (fx, fy, fz)” to find out, how exactly it store forces per atom. Then I wish to modify them to store only the forces by other types of atom.

-I’m new to LAMMPS, so I’m not certain if the direction I’m taking is correct or not. I would be really grateful if you can suggest an alternate better way of doing my task.

Thank you very much in advance.

Best regards,

Manish Gupta

Dear Lammps users,

The description of my problem:

I want to calculate total force on type 1 atom, only by type 2 atoms on
certain region. Then I want to use this parameter and put an additional
condition on velocities of those atoms.

So far, I am trying to do:

I believe that this can be done only by modifying source code. I'm trying to
learn "lj/cut" and other pair style formats to see force calculation and
then dump as well as "compute per atom command (fx, fy, fz)" to find out,
how exactly it store forces per atom. Then I wish to modify them to store
only the forces by other types of atom.

it is a very bad idea to modify any of the pair styles for this purpose.

rather this would be something that could be done with a variant of
compute group/group or a variant of compute force/tally
you would have to store the data as additional per atom data (which
can be done from inside computes).
you would also have to pay attention to whether you have a half or a
full neighbor list, and whether you have newton's third law applied
for interactions between local and ghost atoms or not. the output of
those computes can then be used in a fix to apply forces or change
velocities or whatever else you want to do.

-I'm new to LAMMPS, so I'm not certain if the direction I'm taking is
correct or not. I would be really grateful if you can suggest an alternate
better way of doing my task.

whichever way you choose, it is going to be somewhat complex and
require more than a casual familiarity with LAMMPS internals.
you'll be doing yourself a big favor, by first trying something