[lammps-users] question about the stress tensor of atom

Hi, All,

I have a question about the calculation of atom stress tensor shown in the “computer stress/atom command” doc file:

http://lammps.sandia.gov/doc/compute_stress_atom.html

To calculate the stress contribution from atom (say i atom) which interacts with atoms j, k via angle interaction, the doc file gives the calculation as 1/3(f1r1+f2r2+f3r3), which is third of the virial from the angle 1-2-3 interaction. My question is why not directly using f_ir_i here? Similarly, for dihedral angle interaction, the stress contribution from atom i is 1/4(f1r1+f2r2+f3r3+r4r4) … Are these only in an average meaning?

Thanks for your time!

Dongshan

There is no one right way to compute a per-atom virial from
a list of interactions. We chose one reasonable way to do it.
You could also choose to assign fi*ri (for that one interaction)
to each atom in the interaction. But that's not what we
implemented (in all the pair styles). See the tally3 and tally4
functions in pair.cpp if you want to change it, though that
wouldn't cover all the pair styles.

Steve