# stress and pressure.

would the commands stess/atom and computing the pressure components give the same results ???

would the commands stess/atom and computing the pressure components give the
same results ???

no. stress != pressure.

Actually they are the same, with appropriate normalization
by the system volume. See the compute stress/atom
doc page for details of how to compare the 2 and get
the same result after summing the per-atom stress.

Steve

In the lammps documentation , the command is stress/atom. while i am using it in my script
compute 1 all stress/atom
thermo_style custom steps atom c_2
it shows an error . How am i supposed to find all the six components of stress using this, and one more thing, while using

compute		peratom all stress/atom
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

as given in the documentation , it shows only one value of stress using the summation and then normalizing, but i want to find out all the 6 components of stress,

can you tell me how do i write the script for that??

In the lammps documentation , the command is stress/atom. while i am using
it in my script
compute 1 all stress/atom
thermo_style custom steps atom c_2
it shows an error . How am i supposed to find all the six components of
stress using this,

you cannot output a per atom property in thermo output.

compute peratom all stress/atom
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

as given in the documentation , it shows only one value of stress using the

it shows the total *pressure* by summing the per atom stress tensor
diagonal elements. this is what steve said, how you compute total
pressure from per atom stress. nothing less, nothing more.

summation and then normalizing, but i want to find out all the 6 components
of stress,

you can output the 6 components of the pressure tensor directly as thermo
properties: pxx, pyy, pzz, pxy, pxz, pyz

can you tell me how do i write the script for that??

what steve was showing you, is an *example*.
don't just blindly use it, understand it and then
used things as you need.

axel.

I already did calculate the six components of pressure tensor p. What i am confused about is weather this pressure tensor is equivalent to stress tensor because i think there is sign difference and also how we compute the stress/atom is done differnetly.

a) pressure != stress
as steve explained, you need some computation/normalization
to compute pressure from stress

b) total stress can be computed in two ways. the default "f dot r" method
works for most pair styles and is much more efficient than computing
and accumulating per atom stress contributions. however, as the
example from compute stress/atom is supposed to show, the result
has to be equivalent (or there is a bug in LAMMPS).

axel.

And the doc page for compute stress/atom explains the
sign difference.

Steve