<spanid="index-0"></span><h1>fix langevin/drude command<aclass="headerlink"href="#fix-langevin-drude-command"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="syntax">
<h2>Syntax<aclass="headerlink"href="#syntax"title="Permalink to this headline">¶</a></h2>
<li>ID, group-ID are documented in <aclass="reference internal"href="fix.html"><em>fix</em></a> command</li>
<li>langevin/drude = style name of this fix command</li>
<li>Tcom = desired temperature of the centers of mass (temperature units)</li>
<li>damp_com = damping parameter for the thermostat on centers of mass (time units)</li>
<li>seed_com = random number seed to use for white noise of the thermostat on centers of mass (positive integer)</li>
<li>Tdrude = desired temperature of the Drude oscillators (temperature units)</li>
<li>damp_drude = damping parameter for the thermostat on Drude oscillators (time units)</li>
<li>seed_drude = random number seed to use for white noise of the thermostat on Drude oscillators (positive integer)</li>
<li>zero or more keyword/value pairs may be appended</li>
<li>keyword = <em>zero</em></li>
</ul>
<preclass="literal-block">
<em>zero</em> value = <em>no</em> or <em>yes</em>
<em>no</em> = do not set total random force on centers of mass to zero
<em>yes</em> = set total random force on centers of mass to zero
</pre>
</div>
<divclass="section"id="examples">
<h2>Examples<aclass="headerlink"href="#examples"title="Permalink to this headline">¶</a></h2>
<divclass="highlight-python"><divclass="highlight"><pre>fix 3 all langevin/drude 300.0 100.0 19377 1.0 20.0 83451
fix 1 all langevin/drude 298.15 100.0 19377 5.0 10.0 83451 zero yes
</pre></div>
</div>
</div>
<divclass="section"id="description">
<h2>Description<aclass="headerlink"href="#description"title="Permalink to this headline">¶</a></h2>
<p>Apply two Langevin thermostats as described in <aclass="reference internal"href="tutorial_drude.html#jiang"><span>(Jiang)</span></a> for
thermalizing the reduced degrees of freedom of Drude oscillators.
This link describes how to use the <aclass="reference internal"href="tutorial_drude.html"><em>thermalized Drude oscillator model</em></a> in LAMMPS and polarizable models in LAMMPS
are discussed in <aclass="reference internal"href="Section_howto.html#howto-25"><span>this Section</span></a>.</p>
<p>Drude oscillators are a way to simulate polarizables atoms, by
splitting them into a core and a Drude particle bound by a harmonic
bond. The thermalization works by transforming the particles degrees
of freedom by these equations. In these equations upper case denotes
atomic or center of mass values and lower case denotes Drude particle
or dipole values. Primes denote the transformed (reduced) values,
while bare letters denote the original values.</p>
<p>Velocities:
begin{equation} V’ = frac {M, V + m, v} {M’} end{equation}
begin{equation} v’ = v - V end{equation}
Masses:
begin{equation} M’ = M + m end{equation}
begin{equation} m’ = frac {M, m } {M’} end{equation}
<p>Then the real forces acting on the particles are computed from the inverse
transform:
begin{equation} F = frac M {M’}, F’ - f’ end{equation}
begin{equation} f = frac m {M’}, F’ + f’ end{equation}</p>
<p>This fix also thermostates non-polarizable atoms in the group at
temperature <em>Tcom</em>, as if they had a massless Drude partner. The
Drude particles themselves need not be in the group. The center of
mass and the dipole are thermostated iff the core atom is in the
group.</p>
<p>Note that the thermostat effect of this fix is applied to only the
translational degrees of freedom of the particles, which is an
important consideration if finite-size particles, which have
rotational degrees of freedom, are being thermostated. The
translational degrees of freedom can also have a bias velocity removed
from them before thermostating takes place; see the description below.</p>
<divclass="admonition warning">
<pclass="first admonition-title">Warning</p>
<pclass="last">Like the <aclass="reference internal"href="fix_langevin.html"><em>fix langevin</em></a> command,
this fix does NOT perform time integration. It only modifies forces to
effect thermostating. Thus you must use a separate time integration
fix, like <aclass="reference internal"href="fix_nve.html"><em>fix nve</em></a> or <aclass="reference internal"href="fix_nh.html"><em>fix nph</em></a> to actually
update the velocities and positions of atoms using the modified
forces. Likewise, this fix should not normally be used on atoms that
also have their temperature controlled by another fix - e.g. by <aclass="reference internal"href="fix_nh.html"><em>fix nvt</em></a> or <aclass="reference internal"href="fix_temp_rescale.html"><em>fix temp/rescale</em></a> commands.</p>
</div>
<p>See <aclass="reference internal"href="Section_howto.html#howto-16"><span>this howto section</span></a> of the manual for
a discussion of different ways to compute temperature and perform
thermostating.</p>
<hrclass="docutils"/>
<p>This fix requires each atom know whether it is a Drude particle or
not. You must therefore use the <aclass="reference internal"href="fix_drude.html"><em>fix drude</em></a> command to
specify the Drude status of each atom type.</p>
<divclass="admonition warning">
<pclass="first admonition-title">Warning</p>
<pclass="last">only the Drude core atoms need to be in the group
specified for this fix. A Drude electron will be transformed together
with its cores even if it is not itself in the group. It is safe to
include Drude electrons or non-polarizable atoms in the group. The
non-polarizable atoms will simply not be thermostatted as if they had
a massless Drude partner (electron).</p>
</div>
<divclass="admonition warning">
<pclass="first admonition-title">Warning</p>
<pclass="last">Ghost atoms need to know their velocity for this fix
to act correctly. You must use the <aclass="reference internal"href="comm_modify.html"><em>comm_modify</em></a>
command to enable this, e.g.</p>
</div>
<divclass="highlight-python"><divclass="highlight"><pre>comm_modify vel yes
</pre></div>
</div>
<hrclass="docutils"/>
<p><em>Tcom</em> is the target temperature of the centers of mass, which would
be used to thermostate the non-polarizable atoms. <em>Tdrude</em> is the
(normally low) target temperature of the core-Drude particle pairs
(dipoles). <em>Tcom</em> and <em>Tdrude</em> can be specified as an equal-style
<aclass="reference internal"href="variable.html"><em>variable</em></a>. If the value is a variable, it should be
specified as v_name, where name is the variable name. In this case,
the variable will be evaluated each timestep, and its value used to
determine the target temperature.</p>
<p>Equal-style variables can specify formulas with various mathematical
functions, and include <aclass="reference internal"href="thermo_style.html"><em>thermo_style</em></a> command
keywords for the simulation box parameters and timestep and elapsed
time. Thus it is easy to specify a time-dependent temperature.</p>
<p>Like other fixes that perform thermostating, this fix can be used with
<aclass="reference internal"href="compute.html"><em>compute commands</em></a> that remove a “bias” from the atom
velocities. E.g. removing the center-of-mass velocity from a group of
atoms. This is not done by default, but only if the
<aclass="reference internal"href="fix_modify.html"><em>fix_modify</em></a> command is used to assign a temperature
compute to this fix that includes such a bias term. See the doc pages
for individual <aclass="reference internal"href="compute.html"><em>compute commands</em></a> to determine which ones
include a bias. In this case, the thermostat works in the following
manner: bias is removed from each atom, thermostating is performed on
the remaining thermal degrees of freedom, and the bias is added back
in. NOTE: this feature has not been tested.</p>
<p>Note: The temperature thermostating the core-Drude particle pairs
should be chosen low enough, so as to mimic as closely as possible the
self-consistent minimization. It must however be high enough, so that
the dipoles can follow the local electric field exerted by the
neighbouring atoms. The optimal value probably depends on the
temperature of the centers of mass and on the mass of the Drude
particles.</p>
<p><em>damp_com</em> is the characteristic time for reaching thermal equilibrium
of the centers of mass. For example, a value of 100.0 means to relax
the temperature of the centers of mass in a timespan of (roughly) 100
time units (tau or fmsec or psec - see the <aclass="reference internal"href="units.html"><em>units</em></a>
command). <em>damp_drude</em> is the characteristic time for reaching
thermal equilibrium of the dipoles. It is typically a few timesteps.</p>
<p>The number <em>seed_com</em> and <em>seed_drude</em> are positive integers. They set
the seeds of the Marsaglia random number generators used for
generating the random forces on centers of mass and on the
dipoles. Each processor uses the input seed to generate its own unique
seed and its own stream of random numbers. Thus the dynamics of the
system will not be identical on two runs on different numbers of
processors.</p>
<p>The keyword <em>zero</em> can be used to eliminate drift due to the
thermostat on centers of mass. Because the random forces on different
centers of mass are independent, they do not sum exactly to zero. As
a result, this fix applies a small random force to the entire system,
and the momentum of the total center of mass of the system undergoes a
slow random walk. If the keyword <em>zero</em> is set to <em>yes</em>, the total
random force on the centers of mass is set exactly to zero by
subtracting off an equal part of it from each center of mass in the
group. As a result, the total center of mass of a system with zero
initial momentum will not drift over time.</p>
<p>The actual temperatures of cores and Drude particles, in
center-of-mass and relatice coordinates, respectively, can be
calculated using the <aclass="reference internal"href="compute_temp_drude.html"><em>compute temp/drude</em></a>
command.</p>
<hrclass="docutils"/>
<p>Usage example for rigid bodies in the NPT ensemble:</p>
<divclass="highlight-python"><divclass="highlight"><pre>comm_modify vel yes
fix TEMP all langevin/drude 300. 100. 1256 1. 20. 13977 zero yes
fix NPH ATOMS rigid/nph/small molecule iso 1. 1. 500.
fix NVE DRUDES nve
thermo_style custom step cpu etotal ke pe ebond ecoul elong press vol temp c_TATOM c_TDRUDE f_TEMP[1] f_TEMP[2]
</pre></div>
</div>
<p>Comments:</p>
<ulclass="simple">
<li>Drude particles should not be in the rigid group, otherwise the Drude</li>
<li>oscillators will be frozen and the system will lose its</li>
<li>polarizability. <em>zero yes</em> avoids a drift of the center of mass of</li>
<li>the system, but is a bit slower. use two different random seeds to</li>
<li>avoid unphysical correlations. temperature is controlled by the fix</li>
<li><em>langevin/drude</em>, so the time-integration fixes do not thermostate.</li>
<li>don’t forget to time-integrate both cores and Drude particles.</li>
<li>pressure is time-integrated only once by using <em>nve</em> for Drude</li>
<li>particles and <em>nph</em> for atoms/cores (or vice versa). Do not use <em>nph</em></li>
<li>for both. contrary to the alternative thermostating using Nose-Hoover</li>
<li>thermostat fix <em>npt</em> and fix <em>drude/transform</em>, the <em>fix_modify</em></li>
<li>command is not required here, because the fix <em>nph</em> computes the</li>
<li>global pressure even if its group is <em>ATOMS</em>. This is what we want. If</li>
<li>we thermostated <em>ATOMS</em> using <em>npt</em>, the pressure should be the global</li>
<li>one, but the temperature should be only that of the cores. That’s why</li>
<li>the command <em>fix_modify</em> should be called in that case. f_TEMP[1]</li>
<li>and f_TEMP[2] contain the reduced temperatures of the cores/atoms</li>
<li>and of the Drude particles (see below). They should be 300. and 1. on</li>
<h2>Restart, fix_modify, output, run start/stop, minimize info<aclass="headerlink"href="#restart-fix-modify-output-run-start-stop-minimize-info"title="Permalink to this headline">¶</a></h2>
<p>No information about this fix is written to <aclass="reference internal"href="restart.html"><em>binary restart files</em></a>. Because the state of the random number generator
is not saved in restart files, this means you cannot do “exact”
restarts with this fix, where the simulation continues on the same as
if no restart had taken place. However, in a statistical sense, a
restarted simulation should produce the same behavior.</p>
<p>The <aclass="reference internal"href="fix_modify.html"><em>fix_modify</em></a><em>temp</em> option is supported by this
fix. You can use it to assign a temperature <aclass="reference internal"href="compute.html"><em>compute</em></a>
you have defined to this fix which will be used in its thermostating
procedure, as described above. For consistency, the group used by the
compute should include the group of this fix and the Drude particles.</p>
<p>This fix is not invoked during <aclass="reference internal"href="minimize.html"><em>energy minimization</em></a>.</p>
</div>
<divclass="section"id="restrictions">
<h2>Restrictions<aclass="headerlink"href="#restrictions"title="Permalink to this headline">¶</a></h2>
<blockquote>
<div>none</div></blockquote>
</div>
<divclass="section"id="related-commands">
<h2>Related commands<aclass="headerlink"href="#related-commands"title="Permalink to this headline">¶</a></h2>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.