colvars giving error when using lammps restart file

Hello all,

Attached is a runfile and restart file created by lammps-7Aug19 (also a forcefield file and an index file).

If you run it, the following line:
fix clvr all colvars in.colvars

causes an error from colvars. However things run fine without it.

One strange thing is that if you uncomment “write_data dd.dat”, colvars runs okey !

This seems like a bug. Please let me know if you know what’s happening.

Thanks,
Jamal

ff (2.99 KB)

in.colvars (390 Bytes)

ndx (323 Bytes)

restart.res (134 KB)

runfile (493 Bytes)

Hello Jamal, I’m not sure why write_data would have any effect on Colvars. I tried also with LAMMPS 7Aug19 (thanks for including a complete input set) and I received an error message related to the following issue:

https://colvars.github.io/README-totalforce.html

which is because you are restarting from a file created with an older version of LAMMPS.

However, there is nothing to do in your case, because both the old and the new versions use the same convention.

Furthermore, the Colvars restart information is embedded in your case in the LAMMPS restart file, but you are using a constant harmonic restraint (i.e. you do not really need a restart for Colvars), so you can simply ignore the Colvars information stored in “restart.res” by changing the fix-ID for Colvars:

https://lammps.sandia.gov/doc/read_restart.html

You can do this for example by changing this in “runfile”:

fix clvr2 all colvars in.colvars

For as long as you keep using the same LAMMPS version, this step will not be needed any more.

Let me know if this helps.

Giacomo

Hi Giacomo,

Thanks for your helpful response.

As you mentioned, I realized my restart file was made from a slightly older version of lammps. I didn’t realize it because the error message was vague.

I guess why write_data was affecting things remains a mystery! But It’s not important for me now.

Best,
Jamal

The write_data command triggers a reinitialization which would clear any data held from the read_restart.

No mystery.

Axel