Simple Question regarding the np-fixes

Hi,

Maybe it is a simple question, but I do not understand why we are required to set the start values manually. For example the nph Fix, I currently load the initial pressure values using:

variable tmp equal pxx
variable pxx0 equal \{tmp\} \.\.\. fix 1 all nph x {pxx0} 0.0 1.0 y ...

Now as far as I can see the results are just fine, but as I am new to lammps I was wondering if this way is ok, or if it is recommended to set the values manually for some reason.

Regards Jan

The code uses the start/stop values of pressure to pick
a target pressure at timesteps during the run. Hence a starting
value is needed.

You could also do this:

fix 1 all nph x $(pxx) 0.0 1.0 y … (note parens instead of brackets, for an “immediate” variable,

see Section 3.2 of manual)

instead of this:

variable tmp equal pxx
variable pxx0 equal {tmp} fix 1 all nph x {pxx0} 0.0 1.0 y …

Assuming that pressure can be evaluated between

runs. It won’t work before the 1st run, b/c pressure
can’t be evaluated until forces have been calculated.

You could work around that by doing a run 0 before
your first run.

Steve

jan,

Hi,

Maybe it is a simple question, but I do not understand why we are required to set the start values manually. For example the nph Fix, I currently load the initial pressure values using:

variable tmp equal pxx
variable pxx0 equal \{tmp\} \.\.\. fix 1 all nph x {pxx0} 0.0 1.0 y ...

Now as far as I can see the results are just fine, but as I am new to lammps I was wondering if this way is ok, or if it is recommended to set the values manually for some reason.

like with most thermostats, you are not required to put the current
instantaneous value here, but your desired target pressure. the
pressure will not be adjusted in a big jump, but gradually via
coupling to fictitious degrees of freedom in the nose-hoover chains.

please note that if your pressure is far off the desired value, you
may be better off to make some manual adjustments to the system, e.g.
adjust the volume/density or start with a minimization, or simply run
with constant volume for a bit. all nose-hoover thermostats are not
the best choice to *bring* a system to a specific state and once
derailed it can take a long time until they get back to equilibrium.

axel.