[lammps-users] change kspace style on restart

Dear LAMMPS users,

When I attempt to read a restart file from a simulation that used kspace_style ewald (or pppm), but change the pair_style to one which does not use kspace (setting kspace_style to none), I receive the following error: “ERROR: Pair style is incompatible with KSpace style.” The input script is show below, where meoh.rst used lj/charmm/coul/long pair_style. In my application, I am using a custom pair_style I developed to post-process which doesn’t require kspace, but the pair_style ‘lj/charm/coul/charmm’ experiences the same problem.

I attempted to get around this problem by converting the restart file to a data file, however, the data file loses too much precision to be an accurate representation of the simulated ensemble (for example, energy and pressure are too different). So I need a way to use the binary coordinates.

One solution I considered is to convert my custom pair_style to a compute. It was much simpler to edit a pair_style when developing the post-processing calculation, because there wasn’t a compute that was similar to what I wanted to calculate. It seems to me that it would be easier to suppress the kspace style when reading a restart, than to convert the custom pair_style to a compute.

Thank you,

Harold Hatch

units real

neigh_modify delay 0 every 1 check yes

atom_style full

bond_style harmonic

angle_style charmm

dihedral_style charmm

pair_style lj/charmm/coul/charmm 8.0 9.0

pair_modify mix arithmetic

kspace_style none

read_restart meoh.rst

special_bonds charmm

How about changing the pair style and kspace style after reading in the restart file.

Paul

Dear Paul,

Thank you for the suggestion. I seemed to have understood this problem wrong, because read_restart actually doesn’t read anything about the kspace style, as I saw in the manual. So if I change the order like you mentioned as below:

You’re welcome. I meant that you specify the old pair style before, then read the restart file, then specify the new pair style. You’ll have to respecify the pair coeffs.

Paul

You're correct that LAMMPS stores no info about KSPACE
settings in the restart file. So you have to re-specify them
in your input script. And they will have to be compatible
with whatever pair style you have defined when the
run begins.

Steve