Hi all,
Relatively new LAMMPS user. Doing some tests, I noticed that when I restart from an NPT (fix NPT) simulation (either by reading a restart file, or continuing a run in the same input script with a second run command), the electrostatics energy (e_coul+e_long) and subsequently the instantaneous “pressure” of the system, both slightly change (the electrostatics energy differs in the tenths digit, the pressure in the ones digit) for the same system state. This seems to be due to a change in the portioning of the electrostatics energy calculation between the short and long range portions, as e_coul and e_long both change by ~10x more than what their sum changes by. All other energy terms, the instantaneous “temperature”, and the system volume/dimensions are all identical before/after restart.
It only matters what type of simulation I restart from, not what type I restart to, e.g. restarting from an NVT simulation and starting an NPT simulation, this behavior does not occur, but restarting from an NPT simulation and starting an NVT simulation, it does.
Not running shake or rattle during these tests
Also, when I force the neighbor list to update every time step (neigh_modify check no delay 0 every 1), the behavior still occurs
I understand that if the partitioning of the electrostatics interactions between the short-range/real space and long-range/k space contributions changes, this will change the total electrostatics energy, due to various approximations/interpolations/floating point math numerics performed during the calculation.
My questions are:
-
Why does this only occur upon restarting from an NPT simulation, and not from an NVT (fix NVT) or NVE (fix NVE) simulation as well?
-
What is the root cause of this change in apportioning of interactions between short- and long-range electrostatics upon restart from an NPT simulation?
Simulation Details below. I’m running LAMMPS version 29 Oct 2020. My test system is 433 benzene molecules using the Amber Gaff2 force field
Any input would be helpful, thanks
Initial Interaction Energy Setup:
pair_style lj/cut/coul/long 10.0
pair_modify mix arithmetic
dielectric 1.0
special_bonds amber
bond_style harmonic
angle_style harmonic
dihedral_style charmm
improper_style cvff
Example Input Script for a Restart
units real
atom_style full
boundary p p p
read_restart restart.rst # restart from previous NPT run
reset_timestep 0 # compare energy at time step 0 vs end of run restarting from
kspace_style pppm 1E-4
group mobile union all
timestep 1
thermo_style custom etotal ke pe emol ebond eangle edihed eimp evdwl ecoul elong temp press vol lx ly lz
thermo_modify line multi
thermo 250
thermo_modify flush yes
neigh_modify check no delay 0 every 1 # issue occurs with or without this command
fix 1 mobile npt temp 293 293 $(100.0*dt) iso 1.000000 1.000000 $(1000.0*dt)
dump 2 all dcd 500 test.dcd
run 10000
write_restart restart.A.rst
run 10000 # compare energy at start of this run step vs end of previous run step
write_restart restart.B.rst