# 回复： The difference between compute pressure andcompute stress/atom

Hi Axel,

use the units metal, here we compare output v_p4 (black line) with c_stressz1 (red line), the compute progress is as follows,

compute strs all stress/atom NULL

compute vol all voronoi/atom

variable stress1 atom “c_strs/10000/c_vol”

variable stress2 atom “c_strs/10000/c_vol”

variable stress3 atom “c_strs/10000/c_vol”

compute stressx1 all reduce ave v_stress1

compute stressy1 all reduce ave v_stress2

compute stressz1 all reduce ave v_stress3

# Store final cell length for strain calculations

variable tmp equal “lx”

variable L0 equal \${tmp}

print “Initial Length, L0: \${L0}”

variable tmp equal “ly”

variable L1 equal \${tmp}

print “Initial Length, L1: \${L1}”

variable tmp equal “lz”

variable L2 equal \${tmp}

print “Initial Length, L2: \${L2}”

Hi Axel,

use the units metal, here we compare output v_p4 (black line) with
c_stressz1 (red line), the compute progress is as follows,

script, but the units for the output in your plot!​ i am surprised that you
are not embarrassed by sending such a plot without proper units and
descriptors to the public and thus showing your disregard for common
scientific practice.

​what you have below shows that what you are computing from the pressure
compute is not comparable to what you compute from stress/atom. the output
from compute pressure is the one that is "more correct". the other has an
unphysical weighting included. remember pressure is an "intensive" property.

as i already pointed out, the documentation for compute stress/atom gives
an example how you correctly compute the total pressure from compute
stress/atom. it is trivial to adapt this to getting the individual
components.

axel.