Dear Steve, Lammps Users,
A very happy new year to all of you.
I am having some problem in understanding the compute sum command. In the doc page of compute_stress_atom, it is mentioned that one can calculate global stress vector as follows.
compute peratom all stress/atom
compute p all sum peratom
variable p equal div(add(add(c_p1,c_p2),c_p3),mult(3.0,vol))
thermo_style custom step temp etotal c_global v_p
When I tried it on my inputscript, I got an error on the second compute command. Here, the compute compute doesn’t seem to be working. I looked at the code (compute_sum.cpp) and understood that probably the command should be written in the following manner.
compute p all sum c_peratom c_peratom c_peratom c_peratom c_peratom c_peratom
This command seems to be working with latest (3rd Jan version). I just want to make sure that I am going the right way. In that case, I doc page could be clarified, If I am misunderstanding something please let me know.
If my version of compute is correct, does it mean that p would be sum of all stress/atom for peratom, same for the case with p, p, etc? In such case, is it fine to define the variable command as
variable p equal div(add(add(c_p 1,c_p2),c_p3),mult(3.0,vol))
or one should define it as
variable p equal div(add(add(c_p,c_p),c_p),mult(3.0,vol))
Any comments will be highly appreciated.