[lammps-users] Error: Per atom virial was not tallied on needed timestep

Hello everyone,
I have been getting the error " Per-atom virial was not tallied on needed timestep" or sometimes its “energy” instead of “virial.”
I had seen the previous mails on this subject earlier and did not find anything. Moreover I cannot find those emails in the archive now. Can someone please explain why we get this error?

I have seen that I get the error when I change the dump frequency of either a energy/atom or stress/atom compute.
Written below, is a small sample input file where I get the error during the 3rd run after the 7000th timestep. I have tried to reduce the size of the problem while keeping it as similar as possible to my original system, hence the 3 runs.

Basic settings

units metal
dimension 3
boundary p p p
atom_style atomic

neighbor settings

neighbor 2 bin
neigh_modify delay 1

create geometry, unit 3.524 A

lattice fcc 3.524
region box block -20 20 -20 20 -2.5 2.5

#create_atoms
create_box 1 box
create_atoms 1 box
mass 2 58.71

EAM potentials

pair_style eam
pair_coeff * * //Ni_u3.eam

********** Define groups ************

Boundary atoms

region btop block INF INF 19 INF INF INF
region bbot block INF INF INF -19 INF INF
group btop region btop
group bbot region bbot

group boundary union btop bbot
group mobile subtract all boundary

A region in the middle to dump atoms

region dumpregion block -10 10 -10 10 INF INF
group dumpregion region dumpregion

initial velocities

compute new mobile temp/deform
velocity mobile create 100 887723 temp new

compute PE and stress

compute PE all pe/atom
compute stress dumpregion stress/atom pair

fixes

fix 1 all nve
fix 2 mobile temp/rescale 100 1E-3 1E-3 0.05 0.5
fix 3 boundary setforce 0.0 0.0 0.0

run

timestep 0.001
thermo 200
thermo_modify temp new

dump 1 all cfg 1000 all_.cfg id type xs ys zs type c_PE c_stress[2]
dump 2 dumpregion cfg 1000 cfgdata_
.cfg id type xs ys zs id type c_PE c_stress[2]
dump 3 dumpregion custom 20000 energy.dat c_PE c_stress[2]

run 2000

#****************** 2nd run **********************#

Fixes

unfix 1
unfix 2
fix 4 boundary setforce 0.0 0.0 0.0
fix 5 all nvt 1E-3 1E-3 5 drag 0.1

Apply fix deform to apply a strain

fix deform1 all deform 1 y delta 0 0.1 remap x

dump_modify 1 every 500
dump_modify 2 every 500
dump_modify 3 every 500

timestep 0.001
run 5000

#****************** 3rd run **********************#

strain rate: 3.524 A / 10000 timestep

unfix deform1
fix deform2 all deform 1 y delta 0 0.1 remap x

dump_modify 1 every 200
dump_modify 2 every 200
dump_modify 3 every 200

timestep 0.001
run 5000

It has been fixed I think. See the 18th May patch for this or install the latest version and give your simulation a test run.

Hi Vikas,
Thanks for your mail. I tried it with the latest version of LAMMPS. I still get the same error.
Santosh

fix 5 all nvt 1E-3 1E-3 5 drag 0.1

This command is not the syntax for the most current version
of LAMMPS. When I change it (add "temp"), then your
script runs fine with the current version, without the per-atom virial
error you indicated.

Steve

Thanks for your mail Steve!
I was away for the last few days, so just checked the input file with new LAMMPS.

Sadly, I still get the error with the May 10th distribution. I am attaching the log file for you to see.
The error comes in the last part of the run when I change the dump frequency to 200, but again there was no error when the dump frequency was changed to 500 before that.
Santosh

log.lammps (7.06 KB)

May 10 is not the current version of the code.
This script (below) from bench/in.lj works fine for me. It seems to have
all the dump properties of your much more complex script.

Steve

# 3d Lennard-Jones melt

units lj
atom_style atomic

lattice fcc 0.8442
region box block 0 5 0 5 0 5
create_box 1 box
create_atoms 1 box
mass 1 1.0

velocity all create 1.44 87287 loop geom

pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5

neighbor 0.3 bin
neigh_modify delay 0 every 20 check no

fix 1 all nve

thermo 200

compute 1 all pe/atom
dump 1 all cfg 1000 tmp1.*.dump id type xs ys zs c_1
dump 2 all cfg 1000 tmp2.*.dump id type xs ys zs c_1
dump 3 all cfg 20000 tmp3.*.dump id type xs ys zs c_1

run 2000
dump_modify 1 every 500
dump_modify 2 every 500
dump_modify 3 every 500
run 5000
dump_modify 1 every 200
dump_modify 2 every 200
dump_modify 3 every 200
run 5000