[lammps-users] Pressure difference using stress


I am trying to calculate the pressure on a particular group of atoms using
the stress tensor example in the documentation. However when I try to get
the difference in pressure between the start of the run and the current
step, it gives the following error message:
p0_18942: p4_error: interrupt SIGSEGV: 11

Here is a code snippet, where it fails on the last line:
compute s all stress/atom
compute p all reduce sum c_s[1] c_s[2] c_s[3]
variable pressure equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol)
variable diffPressure equal v_pressure-${pressure}

Using the global thermo pressure compute value works fine, but I want to be
able to calculate the pressure for a subgroup of atoms.

I am using version 21 May 2008. Is there something obvious that I'm missing?

Thanks in advance for your help.

I think you are running into the July 2008 bug listed on this page:


The problem is that LAMMPS can't compute the pressure at an
arbitrary point in time, unless the virial has been computed. I'll take
a look at this next week when I'm back in town and see if I can
figure it out in more detail.