2010-06-22 22:52:12 +08:00
|
|
|
<HTML>
|
|
|
|
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
|
|
|
|
</CENTER>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H3>fix adapt command
|
|
|
|
</H3>
|
|
|
|
<P><B>Syntax:</B>
|
|
|
|
</P>
|
2010-10-23 05:24:19 +08:00
|
|
|
<PRE>fix ID group-ID adapt N attribute args ... keyword value ...
|
2010-06-22 22:52:12 +08:00
|
|
|
</PRE>
|
|
|
|
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
|
|
|
|
|
|
|
|
<LI>adapt = style name of this fix command
|
|
|
|
|
|
|
|
<LI>N = adapt simulation settings every this many timesteps
|
|
|
|
|
2010-10-23 05:24:19 +08:00
|
|
|
<LI>one or more attribute/arg pairs may be appended
|
2010-06-22 22:52:12 +08:00
|
|
|
|
2010-10-23 05:24:19 +08:00
|
|
|
<LI>attribute = <I>pair</I> or <I>kspace</I> or <I>atom</I>
|
2010-06-22 22:52:12 +08:00
|
|
|
|
2010-08-13 07:10:38 +08:00
|
|
|
<PRE> <I>pair</I> args = pstyle pparam I J v_name
|
2010-06-22 22:52:12 +08:00
|
|
|
pstyle = pair style name, e.g. lj/cut
|
|
|
|
pparam = parameter to adapt over time
|
|
|
|
I,J = type pair(s) to set parameter for
|
2010-08-13 07:10:38 +08:00
|
|
|
v_name = variable with name that calculates value of pparam
|
2010-10-23 05:24:19 +08:00
|
|
|
<I>kspace</I> arg = v_name
|
|
|
|
v_name = variable with name that calculates scale factor on K-space terms
|
2010-08-13 07:10:38 +08:00
|
|
|
<I>atom</I> args = aparam v_name
|
2010-06-22 22:52:12 +08:00
|
|
|
aparam = parameter to adapt over time
|
2010-08-13 07:10:38 +08:00
|
|
|
v_name = variable with name that calculates value of aparam
|
2010-06-22 22:52:12 +08:00
|
|
|
</PRE>
|
2010-10-23 05:24:19 +08:00
|
|
|
<LI>zero or more keyword/value pairs may be appended
|
|
|
|
|
|
|
|
<LI>keyword = <I>scale</I> or <I>reset</I>
|
|
|
|
|
|
|
|
<PRE> <I>scale</I> value = <I>no</I> or <I>yes</I>
|
|
|
|
<I>no</I> = the variable value is the new setting
|
|
|
|
<I>yes</I> = the variable value multiplies the original setting
|
|
|
|
</PRE>
|
|
|
|
<PRE> <I>reset</I> value = <I>no</I> or <I>yes</I>
|
|
|
|
<I>no</I> = values will remain altered at the end of a run
|
|
|
|
<I>yes</I> = reset altered values to their original values at the end of a run
|
|
|
|
</PRE>
|
2010-06-22 22:52:12 +08:00
|
|
|
|
|
|
|
</UL>
|
|
|
|
<P><B>Examples:</B>
|
|
|
|
</P>
|
2010-08-13 07:10:38 +08:00
|
|
|
<PRE>fix 1 all adapt 1 pair soft a 1 1 v_prefactor
|
|
|
|
fix 1 all adapt 1 pair soft a 2* 3 v_prefactor
|
2011-05-18 07:43:48 +08:00
|
|
|
fix 1 all adapt 1 pair lj/cut epsilon * * v_scale1 coul/cut scale 3 3 v_scale2 scale yes reset yes
|
2010-08-13 07:10:38 +08:00
|
|
|
fix 1 all adapt 10 atom diameter v_size
|
2010-06-22 22:52:12 +08:00
|
|
|
</PRE>
|
|
|
|
<P><B>Description:</B>
|
|
|
|
</P>
|
2010-10-23 05:24:19 +08:00
|
|
|
<P>Change or adapt one or more specific simulation attributes or settings
|
|
|
|
over time as a simulation runs. Pair potential and K-space and atom
|
|
|
|
attributes which can be varied by this fix are discussed below. Many
|
|
|
|
other fixes can also be used to time-vary simulation parameters,
|
|
|
|
e.g. the "fix deform" command will change the simulation box
|
|
|
|
size/shape and the "fix move" command will change atom positions and
|
|
|
|
velocities in a prescribed manner.
|
|
|
|
</P>
|
|
|
|
<P>If <I>N</I> is specified as 0, the specified attributes are only changed
|
|
|
|
once, before the simulation begins. This is all that is needed if the
|
|
|
|
associated variables are not time-dependent. If <I>N</I> > 0, then changes
|
|
|
|
are made every <I>N</I> steps during the simulation, presumably with a
|
|
|
|
variable that is time-dependent.
|
|
|
|
</P>
|
|
|
|
<P>Depending on the value of the <I>reset</I> keyword, attributes changed by
|
|
|
|
this fix will or will not be reset back to their original values at
|
|
|
|
the end of a simulation. Even if <I>reset</I> is specified as <I>yes</I>, a
|
|
|
|
restart file written during a simulation will contain the modified
|
|
|
|
settings.
|
|
|
|
</P>
|
2010-10-23 06:22:51 +08:00
|
|
|
<P>IMPORTANT NOTE: Currently, only the <I>pair</I> and <I>kspace</I> params
|
|
|
|
are resettable. <I>Atom</I> attributes are not. This will be
|
|
|
|
added at some point.
|
|
|
|
</P>
|
2010-10-23 05:24:19 +08:00
|
|
|
<P>If the <I>scale</I> keyword is set to <I>no</I>, then the value the parameter is
|
|
|
|
set to will be whatever the variable generates. If the <I>scale</I>
|
|
|
|
keyword is set to <I>yes</I>, then the value of the altered parameter will
|
|
|
|
be the initial value of that parameter multiplied by whatever the
|
|
|
|
variable generates. I.e. the variable is now a "scale factor" applied
|
|
|
|
in (presumably) a time-varying fashion to the parameter. Internally,
|
|
|
|
the parameters themselves are actually altered; make sure you use the
|
|
|
|
<I>reset yes</I> option if you want the parameters to be restored to their
|
|
|
|
initial values after the run.
|
2010-07-21 03:26:18 +08:00
|
|
|
</P>
|
2010-10-23 05:24:19 +08:00
|
|
|
<HR>
|
|
|
|
|
2010-06-22 22:52:12 +08:00
|
|
|
<P>The <I>pair</I> keyword enables various parameters of potentials defined by
|
|
|
|
the <A HREF = "pair_style.html">pair_style</A> command to be changed, if the pair
|
2010-10-23 05:24:19 +08:00
|
|
|
style supports it. Note that the <A HREF = "pair_style.html">pair_style</A> and
|
|
|
|
<A HREF = "pair_coeff.html">pair_coeff</A> commands must be used in the usual manner
|
|
|
|
to specify these parameters initially; the fix adapt command simply
|
|
|
|
overrides the parameters.
|
|
|
|
</P>
|
|
|
|
<P>The <I>pstyle</I> argument is the name of the pair style. If <A HREF = "pair_hybrid.html">pair_style
|
|
|
|
hybrid or hybrid/overlay</A> is used, <I>pstyle</I> should be
|
|
|
|
a sub-style name. For example, <I>pstyle</I> could be specified as "soft"
|
|
|
|
or "lubricate". The <I>pparam</I> argument is the name of the parameter to
|
|
|
|
change. This is the current list of pair styles and parameters that
|
|
|
|
can be varied by this fix. See the doc pages for individual pair
|
|
|
|
styles and their energy formulas for the meaning of these parameters:
|
2010-06-22 22:52:12 +08:00
|
|
|
</P>
|
|
|
|
<DIV ALIGN=center><TABLE BORDER=1 >
|
2011-08-07 04:48:42 +08:00
|
|
|
<TR><TD ><A HREF = "pair_born.html">born</A></TD><TD > a,b,c</TD><TD > type pairs</TD></TR>
|
|
|
|
<TR><TD ><A HREF = "pair_buck.html">buck</A></TD><TD > a,c</TD><TD > type pairs</TD></TR>
|
|
|
|
<TR><TD ><A HREF = "pair_coul.html">coul/cut</A></TD><TD > scale</TD><TD > type pairs</TD></TR>
|
|
|
|
<TR><TD ><A HREF = "pair_coul.html">coul/debye</A></TD><TD > scale</TD><TD > type pairs</TD></TR>
|
|
|
|
<TR><TD ><A HREF = "pair_coul.html">coul/long</A></TD><TD > scale</TD><TD > type pairs</TD></TR>
|
|
|
|
<TR><TD ><A HREF = "pair_lj.html">lj/cut</A></TD><TD > epsilon</TD><TD > type pairs</TD></TR>
|
|
|
|
<TR><TD ><A HREF = "pair_lj.html">lj/cut/opt</A></TD><TD > epsilon</TD><TD > type pairs</TD></TR>
|
|
|
|
<TR><TD ><A HREF = "pair_lubricate.html">lubricate</A></TD><TD > mu</TD><TD > global</TD></TR>
|
|
|
|
<TR><TD ><A HREF = "pair_gauss.html">gauss</A></TD><TD > a</TD><TD > type pairs</TD></TR>
|
|
|
|
<TR><TD ><A HREF = "pair_soft.html">soft</A></TD><TD > a</TD><TD > type pairs
|
2010-06-22 22:52:12 +08:00
|
|
|
</TD></TR></TABLE></DIV>
|
|
|
|
|
2010-10-23 06:01:31 +08:00
|
|
|
<P>IMPORTANT NOTE: It is easy to add new potentials and their parameters
|
|
|
|
to this list. All it typically takes is adding an extract() method to
|
|
|
|
the pair_*.cpp file associated with the potential.
|
|
|
|
</P>
|
2010-06-22 22:52:12 +08:00
|
|
|
<P>Some parameters are global settings for the pair style, e.g. the
|
|
|
|
viscosity setting "mu" for <A HREF = "pair_lubricate.html">pair_style lubricate</A>.
|
2010-10-23 05:24:19 +08:00
|
|
|
Other parameters apply to atom type pairs within the pair style,
|
|
|
|
e.g. the prefactor "a" for <A HREF = "pair_soft.html">pair_style soft</A>.
|
|
|
|
</P>
|
|
|
|
<P>Note that for many of the potentials, the parameter that can be varied
|
|
|
|
is effectively a prefactor on the entire energy expression for the
|
|
|
|
potential, e.g. the lj/cut epsilon. The parameters listed as "scale"
|
|
|
|
are exactly that, since the energy expression for the
|
|
|
|
<A HREF = "pair_coul.html">coul/cut</A> potential (for example) has no labeled
|
|
|
|
prefactor in its formula. To apply an effective prefactor to some
|
|
|
|
potentials, multiple parameters need to be altered. For example, the
|
|
|
|
<A HREF = "pair_buck.html">Buckingham potential</A> needs both the A and C terms
|
|
|
|
altered together. To scale the Buckingham potential, you should thus
|
|
|
|
list the pair style twice, once for A and once for C.
|
|
|
|
</P>
|
|
|
|
<P>If a type pair parameter is specified, the <I>I</I> and <I>J</I> settings should
|
|
|
|
be specified to indicate which type pairs to apply it to. If a global
|
|
|
|
parameter is specified, the <I>I</I> and <I>J</I> settings still need to be
|
|
|
|
specified, but are ignored.
|
2010-06-22 22:52:12 +08:00
|
|
|
</P>
|
|
|
|
<P>Similar to the <A HREF = "pair_coeff.html">pair_coeff command</A>, I and J can be
|
|
|
|
specified in one of two ways. Explicit numeric values can be used for
|
|
|
|
each, as in the 1st example above. I <= J is required. LAMMPS sets
|
|
|
|
the coefficients for the symmetric J,I interaction to the same values.
|
|
|
|
</P>
|
|
|
|
<P>A wild-card asterisk can be used in place of or in conjunction with
|
|
|
|
the I,J arguments to set the coefficients for multiple pairs of atom
|
|
|
|
types. This takes the form "*" or "*n" or "n*" or "m*n". If N = the
|
|
|
|
number of atom types, then an asterisk with no numeric values means
|
|
|
|
all types from 1 to N. A leading asterisk means all types from 1 to n
|
|
|
|
(inclusive). A trailing asterisk means all types from n to N
|
|
|
|
(inclusive). A middle asterisk means all types from m to n
|
|
|
|
(inclusive). Note that only type pairs with I <= J are considered; if
|
|
|
|
asterisks imply type pairs where J < I, they are ignored.
|
|
|
|
</P>
|
2010-10-23 05:24:19 +08:00
|
|
|
<P>IMPROTANT NOTE: If <A HREF = "pair_hybrid.html">pair_style hybrid or
|
|
|
|
hybrid/overlay</A> is being used, then the <I>pstyle</I> will
|
|
|
|
be a sub-style name. You must specify I,J arguments that correspond
|
|
|
|
to type pair values defined (via the <A HREF = "doc/pair_coeff.html">pair_coeff</A>
|
|
|
|
command) for that sub-style.
|
2010-06-22 22:52:12 +08:00
|
|
|
</P>
|
2010-08-13 07:10:38 +08:00
|
|
|
<P>The <I>v_name</I> argument for keyword <I>pair</I> is the name of an
|
|
|
|
<A HREF = "variable.html">equal-style variable</A> which will be evaluated each time
|
|
|
|
this fix is invoked to set the parameter to a new value. It should be
|
|
|
|
specified as v_name, where name is the variable name. Equal-style
|
|
|
|
variables can specify formulas with various mathematical functions,
|
|
|
|
and include <A HREF = "thermo_style.html">thermo_style</A> command keywords for the
|
|
|
|
simulation box parameters and timestep and elapsed time. Thus it is
|
|
|
|
easy to specify parameters that change as a function of time or span
|
2010-06-22 22:52:12 +08:00
|
|
|
consecutive runs in a continuous fashion. For the latter, see the
|
|
|
|
<I>start</I> and <I>stop</I> keywords of the <A HREF = "run.html">run</A> command and the
|
|
|
|
<I>elaplong</I> keyword of <A HREF = "thermo_style.html">thermo_style custom</A> for
|
|
|
|
details.
|
|
|
|
</P>
|
|
|
|
<P>For example, these commands would change the prefactor coefficient of
|
|
|
|
the <A HREF = "pair_soft.html">pair_style soft</A> potential from 10.0 to 30.0 in a
|
2010-08-05 05:36:27 +08:00
|
|
|
linear fashion over the course of a simulation:
|
2010-06-22 22:52:12 +08:00
|
|
|
</P>
|
2010-08-05 05:36:27 +08:00
|
|
|
<PRE>variable prefactor equal ramp(10,30)
|
2010-08-13 07:10:38 +08:00
|
|
|
fix 1 all adapt 1 pair soft a * * v_prefactor
|
2010-06-22 22:52:12 +08:00
|
|
|
</PRE>
|
2010-10-23 05:24:19 +08:00
|
|
|
<HR>
|
|
|
|
|
|
|
|
<P>The <I>kspace</I> keyword used the specified variable as a scale factor on
|
|
|
|
the energy, forces, virial calculated by whatever K-Space solver is
|
|
|
|
defined by the <A HREF = "kspace_style.html">kspace_style</A> command. If the
|
|
|
|
variable has a value of 1.0, then the solver is unaltered.
|
|
|
|
</P>
|
|
|
|
<P>The <I>kspace</I> keyword works this way whether the <I>scale</I> keyword
|
|
|
|
is set to <I>no</I> or <I>yes</I>.
|
|
|
|
</P>
|
|
|
|
<HR>
|
|
|
|
|
2010-06-22 22:52:12 +08:00
|
|
|
<P>The <I>atom</I> keyword enables various atom properties to be changed. The
|
|
|
|
<I>aparam</I> argument is the name of the parameter to change. This is the
|
|
|
|
current list of atom parameters that can be varied by this fix:
|
|
|
|
</P>
|
|
|
|
<UL><LI>diameter = diameter of particle
|
|
|
|
</UL>
|
2010-08-13 07:10:38 +08:00
|
|
|
<P>The <I>v_name</I> argument of the <I>atom</I> keyword is the name of an
|
|
|
|
<A HREF = "variable.html">equal-style variable</A> which will be evaluated each time
|
|
|
|
this fix is invoked to set the parameter to a new value. It should be
|
|
|
|
specified as v_name, where name is the variable name. See the
|
|
|
|
discussion above describing the formulas associated with equal-style
|
|
|
|
variables. The new value is assigned to the corresponding attribute
|
|
|
|
for all atoms in the fix group.
|
2010-06-22 22:52:12 +08:00
|
|
|
</P>
|
2010-09-11 01:12:21 +08:00
|
|
|
<P>If the atom parameter is <I>diameter</I> and per-atom density and per-atom
|
|
|
|
mass are defined for particles (e.g. <A HREF = "atom_style.html">atom_style
|
|
|
|
granular</A>), then the mass of each particle is also
|
|
|
|
changed when the diameter changes (density is assumed to stay
|
|
|
|
constant).
|
|
|
|
</P>
|
2010-06-22 22:52:12 +08:00
|
|
|
<P>For example, these commands would shrink the diameter of all granular
|
|
|
|
particles in the "center" group from 1.0 to 0.1 in a linear fashion
|
|
|
|
over the course of a 1000-step simulation:
|
|
|
|
</P>
|
2010-08-13 07:10:38 +08:00
|
|
|
<PRE>variable size equal ramp(1.0,0.1)
|
|
|
|
fix 1 center adapt 10 atom diameter v_size
|
2010-06-22 22:52:12 +08:00
|
|
|
</PRE>
|
|
|
|
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
|
|
|
|
</P>
|
|
|
|
<P>No information about this fix is written to <A HREF = "restart.html">binary restart
|
|
|
|
files</A>. None of the <A HREF = "fix_modify.html">fix_modify</A> options
|
|
|
|
are relevant to this fix. No global or per-atom quantities are stored
|
|
|
|
by this fix for access by various <A HREF = "Section_howto.html#4_15">output
|
|
|
|
commands</A>. No parameter of this fix can be
|
|
|
|
used with the <I>start/stop</I> keywords of the <A HREF = "run.html">run</A> command.
|
|
|
|
This fix is not invoked during <A HREF = "minimize.html">energy minimization</A>.
|
|
|
|
</P>
|
|
|
|
<P><B>Restrictions:</B> none
|
|
|
|
</P>
|
2010-10-23 05:24:19 +08:00
|
|
|
<P><B>Related commands:</B>
|
|
|
|
</P>
|
|
|
|
<P><A HREF = "compute_ti.html">compute ti</A>
|
|
|
|
</P>
|
|
|
|
<P><B>Default:</B>
|
2010-06-22 22:52:12 +08:00
|
|
|
</P>
|
2010-10-23 05:24:19 +08:00
|
|
|
<P>The option defaults are scale = no, reset = no.
|
2010-06-22 22:52:12 +08:00
|
|
|
</P>
|
|
|
|
</HTML>
|