Dear lammps user,
Recently I made a tensile test simulation of a polymer bar model. I used two methods to get the stress at different strain.
First, I used the command “setforce” to fix the two ends of the bar and assigned a velocity to one end. After dumping the output of “setforce,” I divided them by the area of the bar.
Second, I used the command “compute stress/atom”. The code is following:
compute peratom all stress/atom NULL
compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3]
variable press equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol)
thermo_style custom step temp etotal press v_press
The problem is these two kinds of stress were not at the same magnitude. I don't know whether the problem is my code.
Has anyone met such a problem? If the code is right, should these two methods get the same stress?
Best
Chi