LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Could lammps calculate the stress tensor based onintermolecular interactions

# Re: [lammps-users] Could lammps calculate the stress tensor based onintermolecular interactions

 From: Axel Kohlmeyer Date: Wed, 15 Nov 2017 08:18:44 -0500

On Wed, Nov 15, 2017 at 6:46 AM, 1185201182 wrote:
Hi Axel
I have read the manual for the command "compute stress/atom command" , and I have several questions about the formula to calculate the stress tensor.

If I take x for a and b,the second term for the pair interaction in the formula is 1/2Σ(R1x*F1x+R2x*F2x).The pair interaction is the interactions between two atoms,so only R1x*F1x or R2x*F2x is supposed to appear, but if one image of the atom, and only one image of the atom is taken into account, then the second term which contains both R1x*F1x and R2x*F2x is correct. If the image of the atom is taken into account, for the third term for angled atoms, it is not correct. The reason is that there are two atoms which are bonded with atom I, thus an angle is formed. If the image of the two bonded atoms are taken into account, there should be four terms (two plus two) instead of three,but there are only three terms in the manual for the angle.

Could you please kindly explain why the manual is written so?

​the manual is written this way because it is correct and describes what is computed (if all explicit pairs are considered and not the - more efficient - F dot r​ shortcut can be used).
please note, that the pair sum is over all pairs of atoms as computed inside pair styles based on the neighbor list. they consider the two closest images of a pair of atoms.
you are not making sense about "angled atoms". angle force terms are additive, so is the stress term. for normal classical force fields, of course, the pairs related to an explicit angle interactions are excluded and thus don't show up in the list of pairs.

axel.

p.s.: one word of advice before making claims that something is wrong: please consider the probabilities. LAMMPS is a software that is around for over 20 years now and lots and lots of people have looked at the source code and documentation. many of these people are very knowledgeable and experienced. while that doesn't guarantee, that there are no mistakes or bugs (in fact, we are occasionally made aware of mistakes or bugs, that should have been found long ago, following the consideration i just outlined), it still makes it very, very unlikely for anything to be so obviously wrong as you claim in a basic, often used feature.

Thanks

Fan L

Dear lammps users
I am wondering if there is  a way to calculate stress tensor based on  intermolecular. I have read the manual the compute stress/tally command is able to calculate the stress tensor based on  intermolecular for the system without
no bonds, no Kspace, and no manybody interactions. But my system has bonds and Kspace, so is there any ways to do that?

​compute pressure and compute stress/atom allows you to select which components contributing to the total virial to include (or not).​
compute pressure collects the total data and is already divided by the volume of the simulation cell, while stress/atom is per atom data and not divided by volume.

axel.

Fan Li

--
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.