Thanks for your reply. But, I want stress components (i.e) total stress xy, yz, and xz tensors for the whole system. To get this, I added all the stress tensor/atom. Is this a right thing to do? I mean do I get the total stress tensor components if I added all the individual stress tensor component/atom?
Yes, I think if you add all the per-atom stresses you will get
the total stress = pressure. But you should just add xx,yy,zz and
average by 3 - that is what LAMMPS essentially does to get
pressure - see pressure.cpp