forked from lijiext/lammps
81 lines
3.1 KiB
Plaintext
81 lines
3.1 KiB
Plaintext
"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
|
|
|
|
fix ave/time command :h3
|
|
|
|
[Syntax:]
|
|
|
|
fix ID group-ID ave/time Nevery Nfreq compute-ID flag file :pre
|
|
|
|
ID, group-ID are documented in "fix"_fix.html command
|
|
ave/time = style name of this fix command
|
|
Nevery = calculate property every this many timesteps
|
|
Nfreq = write average property to file every this many steps
|
|
compute-ID = ID of compute that performs the calculation
|
|
flag = 0 for scalar quantity, 1 for vector quantity, 2 for both
|
|
file = filename to write results to :ul
|
|
|
|
[Examples:]
|
|
|
|
fix 1 all ave/time 100 1000 myTemp 0 temp.stats :pre
|
|
|
|
[Description:]
|
|
|
|
Calculate one or more instantaneous quantities every few timesteps,
|
|
average them over a longer timescale, and print the results to a file.
|
|
This can be used to time-average any "compute" entity in LAMMPS such
|
|
as a temperature or pressure.
|
|
|
|
The {compute-ID} specifies a "compute"_compute.html which calculates
|
|
the desired property. The compute can be previously defined in the
|
|
input script. Or it can be a compute defined by "thermodynamic
|
|
output"_thermo_style.html or other fixes such as "fix
|
|
nvt"_fix_nvt.html or "fix temp/rescale"_fix_temp_rescale.html. Users
|
|
can also write code for their own compute styles and "add them to
|
|
LAMMPS"_Section_modify.html.
|
|
|
|
In all these cases, the fix ave/time style uses the global scalar or
|
|
vector calculated by the compute. See the "fix
|
|
ave/spatial"_fix_ave_spatial.html command if you wish to average
|
|
spatially, e.g. via a compute that calculates per-atom quantities.
|
|
|
|
The {Nevery} and {Nfreq} arguments specify how the property will be
|
|
averaged. The property is calculated once each Nevery timesteps. It
|
|
is averaged and output every Nfreq timesteps. Nfreq must be a
|
|
multiple of Nevery. In the example above, the property is calculated
|
|
every 100 steps. After 10 calculations, the average result is written
|
|
to the file, once every 1000 steps.
|
|
|
|
The {flag} argument chooses whether the scalar and/or vector
|
|
calculation of the compute is invoked. The former computes a single
|
|
global value. The latter computes N global values, where N is defined
|
|
by the compute, e.g. 6 pressure tensor components. In the vector
|
|
case, each of the N values is averaged independently and N values are
|
|
written to the file at each output.
|
|
|
|
Since the calculation is performed by the compute which stores its own
|
|
"group" definition, the group specified for the fix is ignored.
|
|
LAMMPS prints a warning if the fix group and compute group do not
|
|
match.
|
|
|
|
If the compute calculates pressure, it will cause the force
|
|
computations performed by LAMMPS (pair, bond, angle, etc) to calculate
|
|
virial terms each Nevery timesteps. If this is more frequent than
|
|
thermodynamic output, this adds extra cost to a simulation. However,
|
|
if a constant pressure simulation is being run ("fix npt"_fix_npt.html
|
|
or "fix nph"_fix_nph.html), LAMMPS is already calculating virial terms
|
|
for the pressure every timestep.
|
|
|
|
[Restrictions:] none
|
|
|
|
[Related commands:]
|
|
|
|
"compute"_compute.html, "fix ave/spatial"_fix_ave_spatial.html
|
|
|
|
[Default:] none
|