# How to compute the 6-element vector of per-atom stress?

Dear all lammps users.
Recently, I study the mechanical property of CNT by lammps. Here part of the command are following:

``````compute		peratom all stress/atom NULL
compute		p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3]
``````
``````I feel confused to the "[1], [2],[3]" . What does the "[1], [2],[3]" meanning?
``````
`````` If I want to computer the 6-element vector （xx, yy, zz, xy, xz, yz）of per-atom stress,  and what should I do.
``````

Dear all lammps users.
Recently, I study the mechanical property of CNT by lammps. Here part of
the command are following:

compute peratom all stress/atom NULL
compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3]

I feel confused to the "[1], [2],[3]" . What does the "[1], [2],[3]" meanning?

​they mean, take the first, second, and third element of the per-atom
vector computed by the compute.​

If I want to computer the 6-element vector （xx, yy, zz, xy, xz, yz）of per-atom stress, and what should I do.

​that is done by the compute stress/atom as you see it in the example and
the documentation also explains how the 6 elements of the stress tensor are
ordered in the per-atom vector that the compute style provides.

the rest is just a question of how LAMMPS handles computed properties in
general, and i would suggest you re-read the relevant sections of the
LAMMPS manual and make some simple experiments with the various examples.

axel.​