I recently have started working with LAMMPS and having some confusions about the per-atom stress tensor and global stress tensor outuputs from LAMMPS. I am trying to run a simple case of uniaxial tensile deformation of FCC copper crystal. The input script is shown below.
My first problem is about the “compute sum” command which I used to compute the global stress tensor.
The stress output at the beginning of the simulation (dumps.stress.0) shows that the diagonal components of the per-atom stress tensor of each atom are 0. 329042. So for 50,000 atoms, the sum of the per-atom stress tensor or the diagonal components of the global stress tensor should be equal to 16452.1 (=0.329042*50,000) each. I also did the summation by writing a separate routine and got the same result.
However, the screen output for the global stress tensor shows different values for those diagonal components, 4113.0301 each.
Moreover, according to the LAMMPS documentation, the sum of the diagonal components of the per-atom stress tensor for all atoms should give the pressure value P once divided by 3V. The screen output does not agree with that. For example:
-(4113.0301+ 4113.0301+ 4113.0301)/(3*590520.42) is not equal to -0.027860375
However, if I use the value of 16452.1 for each of those diagonal components it gives the right pressure value. Am I missing something or is there anything wrong with the “compute sum” command?
********* Screen output of the global stress tensor, volume and pressure at the beginning of the simulation (0 step) ***************************
2 2 2 2 2 2 Volume Press
4113.0301 4113.0301 4113.0301 -1.3859986e-08 -5.6610679e-08 -6.0104495e-08 590520.42 -0.027860375