stress/atom

Submitted by thwagner on Thu, 07/07/2011 - 14:30

Hi,

I want to print the stress or pressure of a single atom into a file. When I put the following lines in the input script, no error occurs:

compute stress all stress/atom
variable xx equal c_stress[1][1]

However, trying to print the xx stress component of atom 1:

fix print all print 100 "${xx}" file xx.txt

results in the following error:

ERROR: Per-atom virial was not tallied on needed timestep

I don't understand this ERROR message even after refering to the LAMMPS documentation.

Best regards
Thomas Wagner.

PS: I found a solution in the forum:

1.) compute the total pressure:

compute as all stress/atom
compute p all reduce sum c_as[1] c_as[2] c_as[3]
variable press equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol)

2.) thermo output the pressure:

thermo 100
thermo_style custom step atoms ke f_ts[1] f_ts[2] vol v_press
thermo_modify lost ignore norm no

ckloss's picture

ckloss | Thu, 07/07/2011 - 16:42

There is an issue with the currently LIGGGHTS version not invoking the virial computation, so the current solution would be to invoke it manually. This is resolved in the current LAMMPS version, so the next major LIGGGHTS release should resolve this.

Christoph

PS: moved this thread to the LIGGGHTS user forum