compute stress

Dear lammps users,

I want to calculate the shear stress and I know two method to calculate.

First one is to putput stress/atom to divide by their voronoi as I show below

#–1 input

compute stress upper stress/atom NULL

compute p5 upper reduce ave c_stress[5]

compute vor all voronoi/atom

compute v all reduce ave c_vor[1]

variable stress1 equal c_p5/(c_v*10) #the units I want to output is Mpa, so I devide by 10 to convert

Second is sum the total force

#–2 input

compute Fx upper reduce sum fx

variable stress2 equal (c_Fx160217.66208)/(lxly)

When I plot the stress-strain curve, the stress1 and stress2 are different!!!

And stress2 is 10 times of stress1

Is there something wrong in my input?

Thanks you all.

從 Windows 10 的郵件傳送