[lammps-users] Ndensity


I want to divide the system into 10 equal boxes according to Z cycle, and then calculate the PXX, PYY and PZZ pressure in each box. How to achieve this?


Yang Feng


[email protected]


签名由 网易邮箱大师 定制

the documentation for compute stress/atom has an example for how to compute the total pressure from the per atom stress information.
if you want to do that for smaller volumes, e.g. regions or chunks, you have to do the reduction for those regions/chunks and then use the volume of that subset to convert stress to pressure. similarly, if you want only one component of the stress tensor, then you don’t need to compute the average of its trace.


Ok, thank you very much. I use the way to do it, but the results are not very well, usually the results are about 1atm while the results are about 3e+6 by using it. Why?

Thanks very much


Yang Feng



邮箱:[email protected]


I don’t have a crystal ball, so I don’t know a) whether you are doing the computation correctly and b) assuming you do, whether the results are supposed to be like that considering that pressure will fluctuate a lot and increasingly more with smaller volumes. so for small volumes you can only trust results when averaging a lot.