Commit 78e01882 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

Merge branch 'grem-feature' of https://github.com/dstelter92/lammps into grem-feature

parents 4e62e58d 2a026c9a
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -44,17 +44,28 @@ Boltzmann ensemble. {H0} is a reference enthalpy, and is typically set
as the lowest desired sampled enthalpy.  Further explanation can be
found in our recent papers "(Malolepsza)"_#Malolepsza.

This fix requires a Nose-Hoover thermostat reference passed to the grem
by {thermostat-ID}. Two distinct temperatures exist in this generalized
This fix requires a Nose-Hoover thermostat fix reference passed to the
grem as {thermostat-ID}. Two distinct temperatures exist in this generalized
ensemble, the effective temperature defined above, and a kinetic
temperature that controls the velocity distribution of particles as
usual. Either constant volume or constant pressure algorithms can be
used.

The fix enforces a generalized ensemble in a single replica only.
Typically, different replicas only differ by {lambda} for simplicity,
but this is not necessary. Multi-replica runs need to be run outside
of LAMMPS. An example of this can be found in examples/USER/misc/grem
The fix enforces a generalized ensemble in a single replica
only. Typically, this ideaology is combined with replica 
exchange with replicas differing by {lambda} only
for simplicity, but this is not required. A multi-replica 
simulation can be run within the LAMMPS environment using the
"grem"_temper_grem.html command. This utilizes LAMMPS partition
mode and requires the number of available processors be 
on the order of the number of desired replicas. A 100-replica
simulation would require at least 100 processors (1 per world
at minimum). If a many replicas are needed on a small number of
processors, multi-replica runs can be run outside of LAMMPS.
An example of this can be found in examples/USER/misc/grem and 
has no limit on the number of replicas per processor. However, 
this is very inefficient and error prone and should be avoided
if possible. 

In general, defining the generalized ensembles is unique for every
system. When starting a many-replica simulation without any knowledge of
@@ -86,7 +97,7 @@ LAMMPS"_Section_start.html#start_3 section for more info.

[Related commands:]

"fix nvt"_fix_nh.html, "fix npt"_fix_nh.html, "thermo_modify"_thermo_modify.html
"grem"_temper_grem.html, "fix nvt"_fix_nh.html, "fix npt"_fix_nh.html, "thermo_modify"_thermo_modify.html

[Default:] none

+101 −0
Original line number Diff line number Diff line
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c

:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)

:line

grem command :h3

[Syntax:]

grem N M lambda fix-ID thermostat-ID seed1 seed2 index :pre

N = total # of timesteps to run
M = attempt a tempering swap every this many steps
lambda = initial lambda for this ensemble
fix-ID = ID of fix_grem
thermostat-ID = ID of the thermostat that controls kinetic temperature
seed1 = random # seed used to decide on adjacent temperature to partner with
seed2 = random # seed for Boltzmann factor in Metropolis swap
index = which temperature (0 to N-1) I am simulating (optional) :ul

[Examples:]

grem 100000 1000 ${lambda} fxgREM fxnvt 0 58728
grem 40000 100 ${lambda} fxgREM fxnpt 0 32285 ${walkers} :pre

[Description:]

Run a parallel tempering or replica exchange simulation in LAMMPS partition
mode using multiple generalized replicas (ensembles) of a system defined by 
"fix_grem"_fix_grem.html. Two or more replicas must be used. 

This command is a modification of the "temper"_temper.html command and has
the same dependencies, restraints, and input variables which are discussed
there in greater detail.

Instead of temperature, this command performs replica exchanges in lambda
as per the generalized ensemble enforced by "fix_grem"_fix_grem.html.
The desired lambda is specified by {lambda}, which is typically a
variable previously set in the input script, so that each partition is
assigned a different temperature.  See the "variable"_variable.html
command for more details.  For example:

variable lambda world 400 420 440 460
fix fxnvt all nvt temp 300.0 300.0 100.0
fix fxgREM all grem ${lambda} -0.05 -50000 fxnvt
temper 100000 100 ${lambda} fxgREM fxnvt 3847 58382 :pre

would define 4 lambdas with constant kinetic temperature but unique
generalized temperature, and assign one of them to 
"fix_grem"_fix_grem.html used by each replica, and to the grem command.

As the gREM simulation runs for {N} timesteps, a swap
between adjacent ensembles will be attempted every {M} timesteps.  If
{seed1} is 0, then the swap attempts will alternate between odd and
even pairings.  If {seed1} is non-zero then it is used as a seed in a
random number generator to randomly choose an odd or even pairing each
time.  Each attempted swap of temperatures is either accepted or
rejected based on a Metropolis criterion, derived for gREM by 
"(Kim)"_#Kim, which uses {seed2} in the random number generator.

File management works identical to the "temper"_temper.html command.
Dump files created by this fix contain continuous trajectories and
require post-processing to obtain per-replica information.

The last argument {index} in the grem command is optional and is
used when restarting a run from a set of restart files (one
for each replica) which had previously swapped to new lambda.
This is done using a variable. For example if the
log file listed the following for a simulation with 5 replicas:

500000 2 4 0 1 3 :pre

then a setting of

variable walkers world 2 4 0 1 3 :pre

would be used to restart the run with a grem command like the
example above with ${walkers} as the last argument. This functionality
is identical to "temper"_temper.html.

:line

[Restrictions:]

This command can only be used if LAMMPS was built with the USER-MISC
package.  See the "Making LAMMPS"_Section_start.html#start_3 section
for more info on packages.

This command must be used with "fix_grem"_fix_grem.html.

[Related commands:]

"fix_grem"_fix_grem.html, "temper"_temper.html, "variable"_variable.html

[Default:] none

:link(Kim)
[(Kim)] Kim, Keyes, Straub, J. Chem. Phys., 132, 224107 (2010).
+2 −2
Original line number Diff line number Diff line
@@ -13,8 +13,8 @@ thermo_style custom step temp pe etotal press vol

timestep        1.0

fix             fxnvt all npt temp ${T0} ${T0} 1000.0 iso ${press} ${press} 10000.0 
fix             fxgREM all grem 400 -.01 -30000 fxnvt
fix             fxnpt all npt temp ${T0} ${T0} 1000.0 iso ${press} ${press} 10000.0 
fix             fxgREM all grem 400 -.01 -30000 fxnpt
thermo_modify   press fxgREM_press
run             1000

+1 −0
Original line number Diff line number Diff line
/run.sh
/screen.*
/log.lammps.*
Loading