2007-09-28 07:28:06 +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 ave/atom command
|
|
|
|
</H3>
|
|
|
|
<P><B>Syntax:</B>
|
|
|
|
</P>
|
2008-01-03 03:25:15 +08:00
|
|
|
<PRE>fix ID group-ID ave/atom Nevery Nrepeat Nfreq value1 value2 ...
|
2007-09-28 07:28:06 +08:00
|
|
|
</PRE>
|
2008-01-03 03:25:15 +08:00
|
|
|
<UL><LI>ID, group-ID are documented in <A HREF = "fix.html">fix</A> command
|
|
|
|
|
|
|
|
<LI>ave/atom = style name of this fix command
|
|
|
|
|
2009-12-15 09:21:23 +08:00
|
|
|
<LI>Nevery = use input values every this many timesteps
|
2008-01-03 03:25:15 +08:00
|
|
|
|
2009-12-15 09:21:23 +08:00
|
|
|
<LI>Nrepeat = # of times to use input values for calculating averages
|
2008-01-03 03:25:15 +08:00
|
|
|
|
2009-12-15 09:21:23 +08:00
|
|
|
<LI>Nfreq = calculate averages every this many timesteps
|
|
|
|
one or more input values can be listed
|
2008-01-03 03:25:15 +08:00
|
|
|
|
2009-12-17 01:12:09 +08:00
|
|
|
<LI>value = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID[i], f_ID, f_ID[i], v_name
|
2008-01-03 03:25:15 +08:00
|
|
|
|
2009-12-17 01:12:09 +08:00
|
|
|
<PRE> x,y,z,vx,vy,vz,fx,fy,fz = atom attribute (position, velocity, force component)
|
2009-12-10 05:20:59 +08:00
|
|
|
c_ID = per-atom vector calculated by a compute with ID
|
|
|
|
c_ID[I] = Ith column of per-atom array calculated by a compute with ID
|
|
|
|
f_ID = per-atom vector calculated by a fix with ID
|
|
|
|
f_ID[I] = Ith column of per-atom array calculated by a fix with ID
|
2009-12-05 05:04:00 +08:00
|
|
|
v_name = per-atom vector calculated by an atom-style variable with name
|
2008-01-03 03:25:15 +08:00
|
|
|
</PRE>
|
|
|
|
|
2007-09-28 07:28:06 +08:00
|
|
|
</UL>
|
|
|
|
<P><B>Examples:</B>
|
|
|
|
</P>
|
2008-01-03 03:25:15 +08:00
|
|
|
<PRE>fix 1 all ave/atom 1 100 100 vx vy vz
|
2011-09-15 04:59:08 +08:00
|
|
|
fix 1 all ave/atom 10 20 1000 c_my_stress[1]
|
2007-09-28 07:28:06 +08:00
|
|
|
</PRE>
|
|
|
|
<P><B>Description:</B>
|
|
|
|
</P>
|
2009-12-15 09:21:23 +08:00
|
|
|
<P>Use one or more per-atom vectors as inputs every few timesteps, and
|
|
|
|
average them atom by atom over longer timescales. The resulting
|
2011-08-26 01:01:01 +08:00
|
|
|
per-atom averages can be used by other <A HREF = "Section_howto.html#howto_15">output
|
2008-01-03 03:25:15 +08:00
|
|
|
commands</A> such as the <A HREF = "fix_ave_spatial.html">fix
|
|
|
|
ave/spatial</A> or <A HREF = "dump.html">dump custom</A> commands.
|
|
|
|
</P>
|
2009-12-15 09:21:23 +08:00
|
|
|
<P>The group specified with the command means only atoms within the group
|
|
|
|
have their averages computed. Results are set to 0.0 for atoms not in
|
|
|
|
the group.
|
2008-01-03 03:25:15 +08:00
|
|
|
</P>
|
2009-12-17 01:12:09 +08:00
|
|
|
<P>Each input value can be an atom attribute (position, velocity, force
|
|
|
|
component) or can be the result of a <A HREF = "compute.html">compute</A> or
|
|
|
|
<A HREF = "fix.html">fix</A> or the evaluation of an atom-style
|
|
|
|
<A HREF = "variable.html">variable</A>. In the latter cases, the compute, fix, or
|
|
|
|
variable must produce a per-atom vector, not a global quantity or
|
|
|
|
local quantity. If you wish to time-average global quantities from a
|
|
|
|
compute, fix, or variable, then see the <A HREF = "fix_ave_time.html">fix
|
2009-03-18 00:11:05 +08:00
|
|
|
ave/time</A> command.
|
2008-01-03 03:25:15 +08:00
|
|
|
</P>
|
2009-12-10 05:20:59 +08:00
|
|
|
<P><A HREF = "compute.html">Computes</A> that produce per-atom vectors or arrays are
|
|
|
|
those which have the word <I>atom</I> in their style name. See the doc
|
|
|
|
pages for individual <A HREF = "fix.html">fixes</A> to determine which ones produce
|
|
|
|
per-atom vectors or arrays. <A HREF = "variable.html">Variables</A> of style <I>atom</I>
|
2009-12-15 09:21:23 +08:00
|
|
|
are the only ones that can be used with this fix since they produce
|
|
|
|
per-atom vectors.
|
|
|
|
</P>
|
|
|
|
<P>Each per-atom value of each input vector is averaged independently.
|
2008-01-03 03:25:15 +08:00
|
|
|
</P>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<P>The <I>Nevery</I>, <I>Nrepeat</I>, and <I>Nfreq</I> arguments specify on what
|
2009-12-15 09:21:23 +08:00
|
|
|
timesteps the input values will be used in order to contribute to the
|
2010-11-23 23:13:14 +08:00
|
|
|
average. The final averaged quantities are generated on timesteps
|
|
|
|
that are a multiple of <I>Nfreq</I>. The average is over <I>Nrepeat</I>
|
|
|
|
quantities, computed in the preceding portion of the simulation every
|
|
|
|
<I>Nevery</I> timesteps. <I>Nfreq</I> must be a multiple of <I>Nevery</I> and
|
|
|
|
<I>Nevery</I> must be non-zero even if <I>Nrepeat</I> is 1. Also, the timesteps
|
|
|
|
contributing to the average value cannot overlap, i.e. Nfreq >
|
|
|
|
(Nrepeat-1)*Nevery is required.
|
2008-01-03 03:25:15 +08:00
|
|
|
</P>
|
|
|
|
<P>For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on
|
|
|
|
timesteps 90,92,94,96,98,100 will be used to compute the final average
|
2008-02-20 05:47:37 +08:00
|
|
|
on timestep 100. Similarly for timesteps 190,192,194,196,198,200 on
|
2008-01-03 03:25:15 +08:00
|
|
|
timestep 200, etc.
|
|
|
|
</P>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<P>The atom attribute values (x,y,z,vx,vy,vz,fx,fy,fz) are
|
2009-12-17 01:12:09 +08:00
|
|
|
self-explanatory. Note that other atom attributes can be used as
|
|
|
|
inputs to this fix by using the <A HREF = "compute_property_atom.html">compute
|
|
|
|
property/atom</A> command and then specifying
|
|
|
|
an input value from that compute.
|
2008-01-03 03:25:15 +08:00
|
|
|
</P>
|
2012-10-02 22:20:50 +08:00
|
|
|
<P>IMPORTANT NOTE: The x,y,z attributes are values that are re-wrapped
|
|
|
|
inside the periodic box whenever an atom crosses a periodic boundary.
|
|
|
|
Thus if you time average an atom that spends half its time on either
|
|
|
|
side of the periodic box, you will get a value in the middle of the
|
|
|
|
box. If this is not what you want, consider averaging unwrapped
|
|
|
|
coordinates, which can be provided by the <A HREF = "compute_property_atom.html">compute
|
|
|
|
property/atom</A> command via its xu,yu,zu
|
|
|
|
attributes.
|
|
|
|
</P>
|
2008-01-03 03:25:15 +08:00
|
|
|
<P>If a value begins with "c_", a compute ID must follow which has been
|
|
|
|
previously defined in the input script. If no bracketed term is
|
2009-12-05 05:04:00 +08:00
|
|
|
appended, the per-atom vector calculated by the compute is used. If a
|
2009-12-10 05:20:59 +08:00
|
|
|
bracketed term containing an index I is appended, the Ith column of
|
|
|
|
the per-atom array calculated by the compute is used. Users can also
|
|
|
|
write code for their own compute styles and <A HREF = "Section_modify.html">add them to
|
|
|
|
LAMMPS</A>.
|
2008-01-03 03:25:15 +08:00
|
|
|
</P>
|
|
|
|
<P>If a value begins with "f_", a fix ID must follow which has been
|
|
|
|
previously defined in the input script. If no bracketed term is
|
2009-12-05 05:04:00 +08:00
|
|
|
appended, the per-atom vector calculated by the fix is used. If a
|
2009-12-10 05:20:59 +08:00
|
|
|
bracketed term containing an index I is appended, the Ith column of
|
|
|
|
the per-atom array calculated by the fix is used. Note that some
|
|
|
|
fixes only produce their values on certain timesteps, which must be
|
|
|
|
compatible with <I>Nevery</I>, else an error will result. Users can also
|
|
|
|
write code for their own fix styles and <A HREF = "Section_modify.html">add them to
|
|
|
|
LAMMPS</A>.
|
2008-01-03 03:25:15 +08:00
|
|
|
</P>
|
|
|
|
<P>If a value begins with "v_", a variable name must follow which has
|
2009-12-10 05:20:59 +08:00
|
|
|
been previously defined in the input script as an <A HREF = "variable.html">atom-style
|
|
|
|
variable</A> Variables of style <I>atom</I> can reference
|
|
|
|
thermodynamic keywords, or invoke other computes, fixes, or variables
|
|
|
|
when they are evaluated, so this is a very general means of generating
|
|
|
|
per-atom quantities to time average.
|
2007-09-28 07:28:06 +08:00
|
|
|
</P>
|
2009-11-18 23:22:46 +08:00
|
|
|
<HR>
|
|
|
|
|
2007-10-11 06:28:11 +08:00
|
|
|
<P><B>Restart, fix_modify, output, run start/stop, minimize info:</B>
|
2007-09-28 07:28:06 +08:00
|
|
|
</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
|
2007-10-11 06:28:11 +08:00
|
|
|
are relevant to this fix. No global scalar or vector quantities are
|
2011-08-26 01:01:01 +08:00
|
|
|
stored by this fix for access by various <A HREF = "Section_howto.html#howto_15">output
|
2007-10-11 06:28:11 +08:00
|
|
|
commands</A>.
|
|
|
|
</P>
|
2009-12-05 05:04:00 +08:00
|
|
|
<P>This fix produces a per-atom vector or array which can be accessed by
|
2011-08-26 01:01:01 +08:00
|
|
|
various <A HREF = "Section_howto.html#howto_15">output commands</A>. A vector is
|
2008-01-03 03:25:15 +08:00
|
|
|
produced if only a single quantity is averaged by this fix. If two or
|
2009-12-05 05:04:00 +08:00
|
|
|
more quantities are averaged, then an array of values is produced.
|
2008-01-03 03:25:15 +08:00
|
|
|
The per-atom values can only be accessed on timesteps that are
|
|
|
|
multiples of <I>Nfreq</I> since that is when averaging is performed.
|
2007-10-11 06:28:11 +08:00
|
|
|
</P>
|
|
|
|
<P>No parameter of this fix can be used with the <I>start/stop</I> keywords of
|
2007-09-28 07:28:06 +08:00
|
|
|
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>
|
|
|
|
<P><B>Related commands:</B>
|
|
|
|
</P>
|
2009-12-15 09:21:23 +08:00
|
|
|
<P><A HREF = "compute.html">compute</A>, <A HREF = "fix_ave_histo.html">fix ave/histo</A>, <A HREF = "fix_ave_spatial.html">fix
|
|
|
|
ave/spatial</A>, <A HREF = "fix_ave_time.html">fix ave/time</A>,
|
|
|
|
<A HREF = "variable.html">variable</A>,
|
2007-09-28 07:28:06 +08:00
|
|
|
</P>
|
|
|
|
<P><B>Default:</B> none
|
|
|
|
</P>
|
|
|
|
</HTML>
|