# How to extract per atom force from pair interaction between certain types of atoms

Dear all,
I am wondering whether there is a way to separate per atom force from different type of pair interaction. For example, If I have type 1 and type 2 atoms interact between 1-2 and themselves 1-1 and 2-2. Is there a way to output per atom force on type 1 atom fx,fy,fz from 1-1 and 1-2 pairwise interactions? Also, can we output per atom force, separating pairwise interaction and bond interaction?

Best
Frank

Dear all,
I am wondering whether there is a way to separate per atom force from
different type of pair interaction. For example, If I have type 1 and type 2
atoms interact between 1-2 and themselves 1-1 and 2-2. Is there a way to
output per atom force on type 1 atom fx,fy,fz from 1-1 and 1-2 pairwise
interactions? Also, can we output per atom force, separating pairwise
interaction and bond interaction?

no and no.

to do that would require significant changes to the various
force computation modules that would have a significant
performance impact, not to mention requiring a lot of
additional memory to store all those properties.

what do you need those for?

perhaps there is an alternate way to do the same.

axel.

Thank for the reply. The actual reason is that I need to compute off-diagonal pressure/stress tensor distribution in an inhomogeneous system. To do that, spatial averaging Irving-Kirkwood per atom stress tensor is not good enough. I have to apply the Method of Planes algorithm. It not easy and time consuming to write additional compute feature, so the post-processing will be a much better choice. For that, I can simply output atom configuration and write a small code to compute the pairwise interaction and then compute the pressure/stress tensor distribution. But the time averaging needs many snapshot, so the dump file is very large and computing pressure/stress tensor distribution is expensive since every time step computational time it needs is O(N^2). If I can simply output per atom force from certain type of pair, the computing time will be O(N).

Best
Frank

Thank for the reply. The actual reason is that I need to compute
off-diagonal pressure/stress tensor distribution in an inhomogeneous system.
To do that, spatial averaging Irving-Kirkwood per atom stress tensor is not
good enough. I have to apply the Method of Planes algorithm. It not easy and
time consuming to write additional compute feature, so the post-processing
will be a much better choice. For that, I can simply output atom
configuration and write a small code to compute the pairwise interaction and
then compute the pressure/stress tensor distribution. But the time averaging
needs many snapshot, so the dump file is very large and computing
pressure/stress tensor distribution is expensive since every time step
computational time it needs is O(N^2). If I can simply output per atom force
from certain type of pair, the computing time will be O(N).

thanks for the info. this seems to be another case, where
a "rerun" feature would be desirable. this way you would run
a normal trajectory first and regularly save the positions.
the you would then subsequently read in this trajectory
instead of propagating it and then define (and output!)
only the forces or other properties that you desire, rinse
and repeat.

too bad, i don't have the time to do it right now, but it seems
there is an increasing demand for something like this... hmmm.

cheers,
axel.