temper/npt and fix npt/nph

Dear LAMMPS users

I wish to use “temper/npt” to run replica exchange simulations, and I need a fix to control pressure. However, it seems that “temper/npt” cannot be used with “fix npt”:

e.g. for a small test

variable t world 298 298.5

variable w world 0 1

fix 2 nonrigid npt temp 299.5 299.5 100 iso 1 1 800

temper/npt 1000 1000 $t 2 0 111 1.0

The error is:
"

ERROR: Tempering temperature fix is not supported (…/temper_npt.cpp:106

"

So I am left with the option to use “fix nph” + “temper/npt” (plus a thermostat e.g. fix langevin), and for the “fix-ID = ID of the fix that will control temperature and pressure during the run”, I put down the id of the fix langevin.

I am not very sure whether it is my mistake somewhere or “fix npt” + “temper/npt” cannot be used at the same time indeed, but I am worried that “temper/npt” + “fix nph” + “fix langevin” is too unusual.

Thank you very much.

Best Wishes
Lunna

Dear All

I am sorry for a small mistake, that for the small test, fix npt is actually using the variable temperature $t, although this does not affect error of “ERROR: Tempering temperature fix is not supported (…/temper_npt.cpp:106”)."

e.g. for a small test

variable t world 298 298.5

variable w world 0 1

fix 2 nonrigid npt temp $t $t 100 iso 1 1 800

temper/npt 1000 1000 $t 2 0 111 1.0

I cannot think of another way of including both temperature and pressure control in a single fix as stated in " “fix-ID = ID of the fix that will control temperature and pressure during the run” on the “temper/npt” lammps page.

Best Wishes

Lunna

Hi Lunna,

What version of LAMMPS are you using? One of my old versions had different temper_npt.cpp than the most recent release. This included changed logic near the code near the error that you get. This fix was made on Feb 7th according to github, so any version after that should be fine, although its always best to be using the most recent LAMMPS.

David

Dear David

I was using the October 23th 2017 version. I have tried the latest stable version 13 Mar 2018 and this time “fix temper/npt” works with “fix npt”.

I am sorry for the trouble and thanks for the help.

Best Wishes
Lunna