<p>This fix allows external programs that are running LAMMPS through its
<aclass="reference internal"href="Section_howto.html#howto-19"><spanclass="std std-ref">library interface</span></a> to modify certain
LAMMPS properties on specific timesteps, similar to the way other
fixes do. The external driver can be a <aclass="reference internal"href="Section_howto.html#howto-19"><spanclass="std std-ref">C/C++ or Fortran program</span></a> or a <aclass="reference internal"href="Section_python.html"><spanclass="doc">Python script</span></a>.</p>
<hrclass="docutils"/>
<p>If mode is <em>pf/callback</em> then the fix will make a callback every
<em>Ncall</em> timesteps or minimization iterations to the external program.
The external program computes forces on atoms by setting values in an
array owned by the fix. The fix then adds these forces to each atom
in the group, once every <em>Napply</em> steps, similar to the way the <aclass="reference internal"href="fix_addforce.html"><spanclass="doc">fix addforce</span></a> command works. Note that if <em>Ncall</em>>
<em>Napply</em>, the force values produced by one callback will persist, and
be used multiple times to update atom forces.</p>
<p>The callback function “foo” is invoked by the fix as:</p>
<p>If mode is <em>pf/array</em> then the fix simply stores force values in an
array. The fix adds these forces to each atom in the group, once
every <em>Napply</em> steps, similar to the way the <aclass="reference internal"href="fix_addforce.html"><spanclass="doc">fix addforce</span></a> command works.</p>
<p>The name of the public force array provided by the FixExternal
<h2>Restart, fix_modify, output, run start/stop, minimize info</h2>
<p>No information about this fix is written to <aclass="reference internal"href="restart.html"><spanclass="doc">binary restart files</span></a>.</p>
<p>The <aclass="reference internal"href="fix_modify.html"><spanclass="doc">fix_modify</span></a><em>energy</em> option is supported by this
fix to add the potential “energy” set by the external driver to the
system’s potential energy as part of <aclass="reference internal"href="thermo_style.html"><spanclass="doc">thermodynamic output</span></a>. This is a fictitious quantity but is
needed so that the <aclass="reference internal"href="minimize.html"><spanclass="doc">minimize</span></a> command can include the
forces added by this fix in a consistent manner. I.e. there is a
decrease in potential energy when atoms move in the direction of the
added force.</p>
<p>This fix computes a global scalar which can be accessed by various
<aclass="reference internal"href="Section_howto.html#howto-15"><spanclass="std std-ref">output commands</span></a>. The scalar is the
potential energy discussed above. The scalar stored by this fix
is “extensive”.</p>
<p>No parameter of this fix can be used with the <em>start/stop</em> keywords of
the <aclass="reference internal"href="run.html"><spanclass="doc">run</span></a> command.</p>
<p>The forces due to this fix are imposed during an energy minimization,
invoked by the <aclass="reference internal"href="minimize.html"><spanclass="doc">minimize</span></a> command.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">If you want the fictitious potential energy associated with the
added forces to be included in the total potential energy of the
system (the quantity being minimized), you MUST enable the
<aclass="reference internal"href="fix_modify.html"><spanclass="doc">fix_modify</span></a><em>energy</em> option for this fix.</p>
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>.