refactoring of global and local hyper, including amended doc pages
This commit is contained in:
@ -54,9 +54,10 @@ local quantities have the word "local" in their style,
|
||||
e.g. {bond/local}. Styles with neither "atom" or "local" in their
|
||||
style produce global quantities.
|
||||
|
||||
Note that a single compute produces either global or per-atom or local
|
||||
quantities, but never more than one of these (with only a few
|
||||
exceptions, as documented by individual compute commands).
|
||||
Note that a single compute can produce either global or per-atom or
|
||||
local quantities, but not both global and per-atom. It can produce
|
||||
local quantities in tandem with global or per-atom quantities. The
|
||||
compute doc page will explain.
|
||||
|
||||
Global, per-atom, and local quantities each come in three kinds: a
|
||||
single scalar value, a vector of values, or a 2d array of values. The
|
||||
|
||||
@ -83,8 +83,10 @@ not in the specified fix group. Local quantities are calculated by
|
||||
each processor based on the atoms it owns, but there may be zero or
|
||||
more per atoms.
|
||||
|
||||
Note that a single fix may produces either global or per-atom or local
|
||||
quantities (or none at all), but never more than one of these.
|
||||
Note that a single fix can produce either global or per-atom or local
|
||||
quantities (or none at all), but not both global and per-atom. It can
|
||||
produce local quantities in tandem with global or per-atom quantities.
|
||||
The fix doc page will explain.
|
||||
|
||||
Global, per-atom, and local quantities each come in three kinds: a
|
||||
single scalar value, a vector of values, or a 2d array of values. The
|
||||
|
||||
@ -35,6 +35,7 @@ keyword = {mode} or {file} or {ave} or {start} or {beyond} or {overwrite} or {ti
|
||||
{mode} arg = {scalar} or {vector}
|
||||
scalar = all input values are scalars
|
||||
vector = all input values are vectors
|
||||
{kind} arg = {global} or {peratom} or {local}
|
||||
{file} arg = filename
|
||||
filename = name of file to output histogram(s) to
|
||||
{ave} args = {one} or {running} or {window}
|
||||
@ -92,7 +93,8 @@ either all global, all per-atom, or all local quantities. Inputs of
|
||||
different kinds (e.g. global and per-atom) cannot be mixed. Atom
|
||||
attributes are per-atom vector values. See the doc page for
|
||||
individual "compute" and "fix" commands to see what kinds of
|
||||
quantities they generate.
|
||||
quantities they generate. See the optional {kind} keyword below for
|
||||
how to force the fix ave/histo command to dis-ambiguate if necessary.
|
||||
|
||||
Note that the output of this command is a single histogram for all
|
||||
input values combined together, not one histogram per input value.
|
||||
@ -231,6 +233,14 @@ keyword is set to {vector}, then all input values must be global or
|
||||
per-atom or local vectors, or columns of global or per-atom or local
|
||||
arrays.
|
||||
|
||||
The {kind} keyword only needs to be set if a compute or fix produces
|
||||
more than one kind of output (global, per-atom, local). If this is
|
||||
not the case, then LAMMPS will determine what kind of input is
|
||||
provided and whether all the input arguments are consistent. If a
|
||||
compute or fix produces more than one kind of output, the {kind}
|
||||
keyword should be used to specify which output will be used. The
|
||||
remaining input arguments must still be consistent.
|
||||
|
||||
The {beyond} keyword determines how input values that fall outside the
|
||||
{lo} to {hi} bounds are treated. Values such that {lo} <= value <=
|
||||
{hi} are assigned to one bin. Values on a bin boundary are assigned
|
||||
@ -240,7 +250,7 @@ If {beyond} is set to {end} then values < {lo} are counted in the
|
||||
first bin and values > {hi} are counted in the last bin. If {beyond}
|
||||
is set to {extend} then two extra bins are created, so that there are
|
||||
Nbins+2 total bins. Values < {lo} are counted in the first bin and
|
||||
values > {hi} are counted in the last bin (Nbins+1). Values between
|
||||
values > {hi} are counted in the last bin (Nbins+2). Values between
|
||||
{lo} and {hi} (inclusive) are counted in bins 2 through Nbins+1. The
|
||||
"coordinate" stored and printed for these two extra bins is {lo} and
|
||||
{hi}.
|
||||
@ -354,5 +364,6 @@ ave/chunk"_fix_ave_chunk.html, "fix ave/time"_fix_ave_time.html,
|
||||
|
||||
[Default:] none
|
||||
|
||||
The option defaults are mode = scalar, ave = one, start = 0, no file
|
||||
output, beyond = ignore, and title 1,2,3 = strings as described above.
|
||||
The option defaults are mode = scalar, kind = figured out from input
|
||||
arguments, ave = one, start = 0, no file output, beyond = ignore, and
|
||||
title 1,2,3 = strings as described above.
|
||||
|
||||
@ -102,7 +102,7 @@ Bi = exp(beta * Vij(max)) :pre
|
||||
where beta = 1/kTequil, and {Tequil} is the temperature of the system
|
||||
and an argument to this fix. Note that Bi >= 1 at every step.
|
||||
|
||||
NOTE: To run GHD, the input script must also use the "fix
|
||||
NOTE: To run a GHD simulation, the input script must also use the "fix
|
||||
langevin"_fix_langevin.html command to thermostat the atoms at the
|
||||
same {Tequil} as specified by this fix, so that the system is running
|
||||
constant-temperature (NVT) dynamics. LAMMPS does not check that this
|
||||
@ -166,9 +166,9 @@ correctly. There will just be fewer events because the hyper time
|
||||
|
||||
NOTE: If you have no physical intuition as to the smallest barrier
|
||||
height in your system, a reasonable strategy to determine the largest
|
||||
{Vmax} you can use for an LHD model, is to run a sequence of
|
||||
{Vmax} you can use for a GHD model, is to run a sequence of
|
||||
simulations with smaller and smaller {Vmax} values, until the event
|
||||
rate does not change.
|
||||
rate does not change (as a function of hyper time).
|
||||
|
||||
The {Tequil} argument is the temperature at which the system is
|
||||
simulated; see the comment above about the "fix
|
||||
@ -177,7 +177,8 @@ beta term in the exponential factor that determines how much boost is
|
||||
achieved as a function of the bias potential.
|
||||
|
||||
In general, the lower the value of {Tequil} and the higher the value
|
||||
of {Vmax}, the more boost will be achievable by the GHD algorithm.
|
||||
of {Vmax}, the more time boost will be achievable by the GHD
|
||||
algorithm.
|
||||
|
||||
:line
|
||||
|
||||
@ -190,41 +191,43 @@ The "fix_modify"_fix_modify.html {energy} option is supported by this
|
||||
fix to add the energy of the bias potential to the the system's
|
||||
potential energy as part of "thermodynamic output"_thermo_style.html.
|
||||
|
||||
This fix computes a global scalar and global vector of length 11, which
|
||||
This fix computes a global scalar and global vector of length 12, which
|
||||
can be accessed by various "output commands"_Howto_output.html. The
|
||||
scalar is the magnitude of the bias potential (energy units) applied on
|
||||
the current timestep. The vector stores the following quantities:
|
||||
|
||||
1 = boost factor on this step (unitless)
|
||||
2 = max strain Eij of any bond on this step (unitless)
|
||||
2 = max strain Eij of any bond on this step (absolute value, unitless)
|
||||
3 = ID of first atom in the max-strain bond
|
||||
4 = ID of second atom in the max-strain bond
|
||||
5 = average # of bonds/atom on this step :ul
|
||||
|
||||
6 = fraction of timesteps with bias = 0.0 during this run
|
||||
7 = max drift distance of any atom during this run (distance units)
|
||||
8 = max bond length during this run (distance units) :ul
|
||||
6 = fraction of timesteps where the biased bond has bias = 0.0 during this run
|
||||
7 = fraction of timesteps where the biased bond has negative strain during this run
|
||||
8 = max drift distance of any atom during this run (distance units)
|
||||
9 = max bond length during this run (distance units) :ul
|
||||
|
||||
9 = cumulative hyper time since fix was defined (time units)
|
||||
10 = cumulative count of event timesteps since fix was defined
|
||||
11 = cumulative count of atoms in events since fix was defined :ul
|
||||
10 = cumulative hyper time since fix was defined (time units)
|
||||
11 = cumulative count of event timesteps since fix was defined
|
||||
12 = cumulative count of atoms in events since fix was defined :ul
|
||||
|
||||
The first 5 quantities are for the current timestep. Quantities 6-8
|
||||
are for the current hyper run. Quantities 9-11 are cumulative across
|
||||
multiple runs (since the fix was defined in the input script).
|
||||
The first 5 quantities are for the current timestep. Quantities 6-9
|
||||
are for the current hyper run. They are reset each time a new hyper
|
||||
run is performed. Quantities 19-12 are cumulative across multiple
|
||||
runs (since the point in the input script the fix was defined).
|
||||
|
||||
For value 7, drift is the distance an atom moves between timesteps
|
||||
when the bond list is reset, i.e. between events. Atoms involved in
|
||||
an event will typically move the greatest distance since others are
|
||||
typically oscillating around their lattice site.
|
||||
For value 8, drift is the distance an atom moves between two quenched
|
||||
states when the second quench determines an event has occurred. Atoms
|
||||
involved in an event will typically move the greatest distance since
|
||||
others typically remain near their original quenched position.
|
||||
|
||||
For value 10, events are checked for by the "hyper"_hyper.html command
|
||||
For value 11, events are checked for by the "hyper"_hyper.html command
|
||||
once every {Nevent} timesteps. This value is the count of those
|
||||
timesteps on which one (or more) events was detected. It is NOT the
|
||||
number of distinct events, since more than one event may occur in the
|
||||
same {Nevent} time window.
|
||||
|
||||
For value 11, each time the "hyper"_hyper.html command checks for an
|
||||
For value 12, each time the "hyper"_hyper.html command checks for an
|
||||
event, it invokes a compute to flag zero or more atoms as
|
||||
participating in one or more events. E.g. atoms that have displaced
|
||||
more than some distance from the previous quench state. Value 11 is
|
||||
|
||||
@ -22,10 +22,9 @@ Dcut = minimum distance between boosted bonds (distance units) :l
|
||||
alpha = boostostat relaxation time (time units) :l
|
||||
Btarget = desired time boost factor (unitless) :l
|
||||
zero or more keyword/value pairs may be appended :l
|
||||
keyword = {lost} or {check/bias} or {check/coeff}
|
||||
{lostbond} value = error/warn/ignore
|
||||
{check/bias} values = Nevery error/warn/ignore
|
||||
{check/coeff} values = Nevery error/warn/ignore :pre
|
||||
keyword = {check/ghost} or {check/bias} :l
|
||||
{check/ghost} values = none
|
||||
{check/bias} values = Nevery error/warn/ignore :pre
|
||||
:ule
|
||||
|
||||
[Examples:]
|
||||
@ -65,8 +64,8 @@ To understand this description, you should first read the description
|
||||
of the GHD algorithm on the "fix hyper/global"_fix_hyper_global.html
|
||||
doc page. This description of LHD builds on the GHD description.
|
||||
|
||||
The definition of bonds, Eij, and Emax are the same for GHD and LHD.
|
||||
The formulas for Vij(max) and Fij(max) are also the same except for a
|
||||
The definition of bonds and Eij are the same for GHD and LHD. The
|
||||
formulas for Vij(max) and Fij(max) are also the same except for a
|
||||
pre-factor Cij, explained below.
|
||||
|
||||
The bias energy Vij applied to a bond IJ with maximum strain is
|
||||
@ -117,11 +116,11 @@ where Vkl(max) is the bias energy of the maxstrain bond KL within bond
|
||||
IJ's neighborhood, beta = 1/kTequil, and {Tequil} is the temperature
|
||||
of the system and an argument to this fix.
|
||||
|
||||
NOTE: To run LHD, the input script must also use the "fix
|
||||
langevin"_fix_langevin.html command to thermostat the atoms at the
|
||||
same {Tequil} as specified by this fix, so that the system is running
|
||||
constant-temperature (NVT) dynamics. LAMMPS does not check that this
|
||||
is done.
|
||||
NOTE: To run an LHD simulation, the input script must also use the
|
||||
"fix langevin"_fix_langevin.html command to thermostat the atoms at
|
||||
the same {Tequil} as specified by this fix, so that the system is
|
||||
running constant-temperature (NVT) dynamics. LAMMPS does not check
|
||||
that this is done.
|
||||
|
||||
Note that if IJ = KL, then bond IJ is a biased bond on that timestep,
|
||||
otherwise it is not. But regardless, the boost factor Bij can be
|
||||
@ -216,20 +215,20 @@ each pair. E.g. something like 2x the cutoff of the interatomic
|
||||
potential. In practice a {Dcut} value of ~10 Angstroms seems to work
|
||||
well for many solid-state systems.
|
||||
|
||||
NOTE: You must also insure that ghost atom communication is performed
|
||||
for a distance of at least {Dcut} + {cutevent} where {cutevent} = the
|
||||
distance one or more atoms move (between quenched states) to be
|
||||
considered an "event". It is an argument to the "compute
|
||||
event/displace" command used to detect events. By default the ghost
|
||||
communication distance is set by the pair_style cutoff, which will
|
||||
typically be < {Dcut}. The "comm_modify cutoff"_comm_modify.html
|
||||
command can be used to set the ghost cutoff explicitly, e.g.
|
||||
NOTE: You should insure that ghost atom communication is performed for
|
||||
a distance of at least {Dcut} + {cutevent} = the distance one or more
|
||||
atoms move (between quenched states) to be considered an "event". It
|
||||
is an argument to the "compute event/displace" command used to detect
|
||||
events. By default the ghost communication distance is set by the
|
||||
pair_style cutoff, which will typically be < {Dcut}. The "comm_modify
|
||||
cutoff"_comm_modify.html command should be used to override the ghost
|
||||
cutoff explicitly, e.g.
|
||||
|
||||
comm_modify cutoff 12.0 :pre
|
||||
|
||||
This fix does not know the {cutevent} parameter, but uses half the
|
||||
bond length as an estimate to warn if the ghost cutoff is not long
|
||||
enough.
|
||||
Note that this fix does not know the {cutevent} parameter, but uses
|
||||
half the {cutbond} parameter as an estimate to warn if the ghost
|
||||
cutoff is not long enough.
|
||||
|
||||
As described above the {alpha} argument is a pre-factor in the
|
||||
boostostat update equation for each bond's Cij prefactor. {Alpha} is
|
||||
@ -269,7 +268,30 @@ NOTE: If you have no physical intuition as to the smallest barrier
|
||||
height in your system, a reasonable strategy to determine the largest
|
||||
{Btarget} you can use for an LHD model, is to run a sequence of
|
||||
simulations with smaller and smaller {Btarget} values, until the event
|
||||
rate does not change.
|
||||
rate does not change (as a function of hyper time).
|
||||
|
||||
:line
|
||||
|
||||
Here is additional information on the optional keywords for this fix.
|
||||
|
||||
The {check/ghost} keyword turns on extra computation each timestep to
|
||||
compute statistics about ghost atoms used to determine which bonds to
|
||||
bias. The output of these stats are the vector values 14 and 15,
|
||||
described below. If this keyword is not enabled, the output
|
||||
of the stats will be zero.
|
||||
|
||||
The {check/bias} keyword turns on extra computation and communcation
|
||||
to check if any biased bonds are closer than {Dcut} to each other,
|
||||
which should not be the case if LHD is operating correctly. Thus it
|
||||
is a debugging check. The {Nevery} setting determines how often the
|
||||
check is made. The {error}, {warn}, or {ignore} setting determines
|
||||
what is done if the count of too-close bonds is not zero. Either the
|
||||
code will exit, or issue a warning, or silently tally the count. The
|
||||
count can be output as vector value 17, as described below. If this
|
||||
keyword is not enabled, the output of that statistic will be 0.
|
||||
|
||||
Note that both of these computations are costly, hence they are only
|
||||
enabled by these keywords.
|
||||
|
||||
:line
|
||||
|
||||
@ -282,95 +304,120 @@ The "fix_modify"_fix_modify.html {energy} option is supported by this
|
||||
fix to add the energy of the bias potential to the the system's
|
||||
potential energy as part of "thermodynamic output"_thermo_style.html.
|
||||
|
||||
This fix computes a global scalar and global vector of length 23,
|
||||
which can be accessed by various "output
|
||||
commands"_Howto_output.html. The scalar is the magnitude of
|
||||
the bias potential (energy units) applied on the current timestep,
|
||||
summed over all biased bonds. The vector stores the following
|
||||
quantities:
|
||||
This fix computes a global scalar and global vector of length 21,
|
||||
which can be accessed by various "output commands"_Howto_output.html.
|
||||
The scalar is the magnitude of the bias potential (energy units)
|
||||
applied on the current timestep, summed over all biased bonds. The
|
||||
vector stores the following quantities:
|
||||
|
||||
1 = # of biased bonds on this step
|
||||
2 = max strain Eij of any bond on this step (unitless)
|
||||
3 = average bias potential for all biased bonds on this step (energy units)
|
||||
2 = max strain Eij of any bond on this step (absolute value, unitless)
|
||||
3 = average bias coeff for all bonds on this step (unitless)
|
||||
4 = average # of bonds/atom on this step
|
||||
5 = average neighbor bonds/bond on this step within {Dcut} :ul
|
||||
|
||||
6 = fraction of steps and bonds with no bias during this run
|
||||
7 = max drift distance of any atom during this run (distance units)
|
||||
8 = max bond length during this run (distance units)
|
||||
9 = average # of biased bonds/step during this run
|
||||
10 = average bias potential for all biased bonds during this run (energy units)
|
||||
11 = max bias potential for any biased bond during this run (energy units)
|
||||
12 = min bias potential for any biased bond during this run (energy units)
|
||||
13 = max distance from my sub-box of any ghost atom with maxstrain < qfactor during this run (distance units)
|
||||
14 = max distance outside my box of any ghost atom with any maxstrain during this run (distance units)
|
||||
15 = count of ghost neighbor atoms not found on reneighbor steps during this run
|
||||
16 = count of lost bond partners during this run
|
||||
17 = average bias coeff for lost bond partners during this run
|
||||
18 = count of bias overlaps found during this run
|
||||
19 = count of non-matching bias coefficients found during this run :ul
|
||||
6 = max bond length during this run (distance units)
|
||||
7 = average # of biased bonds/step during this run
|
||||
8 = fraction of biased bonds with no bias during this run
|
||||
9 = fraction of biased bonds with negative strain during this run
|
||||
10 = average bias coeff for all bonds during this run (unitless)
|
||||
11 = min bias coeff for any bond during this run (unitless)
|
||||
12 = max bias coeff for any bond during this run (unitless)
|
||||
|
||||
20 = cumulative hyper time since fix created (time units)
|
||||
21 = cumulative count of event timesteps since fix created
|
||||
22 = cumulative count of atoms in events since fix created
|
||||
23 = cumulative # of new bonds since fix created :ul
|
||||
13 = max drift distance of any bond atom during this run (distance units)
|
||||
14 = max distance from proc subbox of any ghost atom with maxstrain < qfactor during this run (distance units)
|
||||
15 = max distance outside my box of any ghost atom with any maxstrain during this run (distance units)
|
||||
16 = count of ghost atoms that could not be found on reneighbor steps during this run
|
||||
17 = count of bias overlaps (< Dcut) found during this run
|
||||
|
||||
18 = cumulative hyper time since fix created (time units)
|
||||
19 = cumulative count of event timesteps since fix created
|
||||
20 = cumulative count of atoms in events since fix created
|
||||
21 = cumulative # of new bonds formed since fix created :ul
|
||||
|
||||
The first quantities (1-5) are for the current timestep. Quantities
|
||||
6-19 are for the current hyper run. They are reset each time a new
|
||||
hyper run is performed. Quantities 20-23 are cumulative across
|
||||
multiple runs (since the fix was defined in the input script).
|
||||
6-17 are for the current hyper run. They are reset each time a new
|
||||
hyper run is performed. Quantities 18-21 are cumulative across
|
||||
multiple runs (since the point in the input script the fix was
|
||||
defined).
|
||||
|
||||
For value 6, the numerator is a count of all biased bonds on every
|
||||
For value 8, the numerator is a count of all biased bonds on each
|
||||
timestep whose bias energy = 0.0 due to Eij >= {qfactor}. The
|
||||
denominator is the count of all biased bonds on all timesteps.
|
||||
|
||||
For value 7, drift is the distance an atom moves between timesteps
|
||||
when the bond list is reset, i.e. between events. Atoms involved in
|
||||
an event will typically move the greatest distance since others are
|
||||
typically oscillating around their lattice site.
|
||||
For value 9, the numerator is a count of all biased bonds on each
|
||||
timestep with negative strain. The denominator is the count of all
|
||||
biased bonds on all timesteps.
|
||||
|
||||
For values 13 and 14, the maxstrain of a ghost atom is the maxstrain
|
||||
of any bond it is part of, and it is checked for ghost atoms within
|
||||
the bond neighbor cutoff.
|
||||
Values 13-17 are mostly useful for debugging and diagnostic purposes.
|
||||
|
||||
Values 15-19 are mostly useful for debugging and diagnostic purposes.
|
||||
For value 13, drift is the distance an atom moves between two quenched
|
||||
states when the second quench determines an event has occurred. Atoms
|
||||
involved in an event will typically move the greatest distance since
|
||||
others typically remain near their original quenched position.
|
||||
|
||||
For values 15-17, it is possible that a ghost atom owned by another
|
||||
processor will move far enough (e.g. as part of an event-in-progress)
|
||||
that it will no longer be within the communication cutoff distance for
|
||||
acquiring ghost atoms. Likewise it may be a ghost atom bond partner
|
||||
that cannot be found because it has moved too far. These values count
|
||||
those occurrences. Because they typically involve atoms that are part
|
||||
of events, they do not usually indicate bad dynamics. Value 16 is the
|
||||
average bias coefficient for bonds where a partner atom was lost.
|
||||
For values 14-16, neighbor atoms in the full neighbor list with cutoff
|
||||
{Dcut} may be ghost atoms outside a processor's sub-box. Before the
|
||||
next event occurs they may move further than {Dcut} away from the
|
||||
sub-box boundary. Value 14 is the furthest (from the sub-box) any
|
||||
ghost atom in the neighbor list with maxstrain < {qfactor} was
|
||||
accessed during the run. Value 15 is the same except that the ghost
|
||||
atom's maxstrain may be >= {qfactor}, which may mean it is about to
|
||||
participate in an event. Value 16 is a count of how many ghost atoms
|
||||
could not be found on reneighbor steps, presumably because they moved
|
||||
too far away due to their participation in an event (which will likely
|
||||
be detected at the next quench).
|
||||
|
||||
For value 18, no two bonds should be biased if they are within a
|
||||
Typical values for 14 and 15 should be slightly larger than {Dcut},
|
||||
which accounts for ghost atoms initially at a {Dcut} distance moving
|
||||
thermally before the next event takes place.
|
||||
|
||||
Note that for values 14 and 15 to be computed, the optional keyword
|
||||
{check/ghost} must be specified. Otherwise these values will be zero.
|
||||
This is because computing them incurs overhead, so the values are only
|
||||
computed if requested.
|
||||
|
||||
Value 16 should be zero or small. As explained above a small count
|
||||
likely means some ghost atoms were participating in their own events
|
||||
and moved a longer distance. If the value is large, it likely means
|
||||
the communication cutoff for ghosts is too close to {Dcut} leading to
|
||||
many not-found ghost atoms before the next event. This may lead to a
|
||||
reduced number of bonds being selected for biasing, since the code
|
||||
assumes those atoms are part of highly strained bonds. As explained
|
||||
above, the "comm_modify cutoff"_comm_modify.html command can be used
|
||||
to set a longer cutoff.
|
||||
|
||||
For value 17, no two bonds should be biased if they are within a
|
||||
{Dcut} distance of each other. This value should be zero, indicating
|
||||
that no pair of bonds "overlap", meaning they are closer than {Dcut}
|
||||
from each other.
|
||||
that no pair of biased bonds are closer than {Dcut} from each other.
|
||||
|
||||
For value 19, the same bias coefficient is stored by both atoms in an
|
||||
IJ bond. This value should be zero, indicating that for all bonds,
|
||||
each atom in the bond stores the a bias coefficient with the same
|
||||
value.
|
||||
Note that for values 17 to be computed, the optional keyword
|
||||
{check/bias} must be specified and it determines how often this check
|
||||
is performed. This is because performing the check incurs overhead,
|
||||
so if only computed as often as requested.
|
||||
|
||||
Value 20 is simply the specified {boost} factor times the number of
|
||||
timestep times the timestep size.
|
||||
The result at the end of the run is the cumulative total from every
|
||||
timestep the check was made. Note that the value is a count of atoms
|
||||
in bonds which found other atoms in bonds too close, so it is almost
|
||||
always an over-count of the number of too-close bonds.
|
||||
|
||||
For value 21, events are checked for by the "hyper"_hyper.html command
|
||||
Value 18 is simply the specified {boost} factor times the number of
|
||||
timesteps times the timestep size.
|
||||
|
||||
For value 19, events are checked for by the "hyper"_hyper.html command
|
||||
once every {Nevent} timesteps. This value is the count of those
|
||||
timesteps on which one (or more) events was detected. It is NOT the
|
||||
number of distinct events, since more than one event may occur in the
|
||||
same {Nevent} time window.
|
||||
|
||||
For value 22, each time the "hyper"_hyper.html command checks for an
|
||||
For value 20, each time the "hyper"_hyper.html command checks for an
|
||||
event, it invokes a compute to flag zero or more atoms as
|
||||
participating in one or more events. E.g. atoms that have displaced
|
||||
more than some distance from the previous quench state. Value 22 is
|
||||
more than some distance from the previous quench state. Value 20 is
|
||||
the cumulative count of the number of atoms participating in any of
|
||||
the events that were found.
|
||||
|
||||
Value 23 tallies the number of new bonds created by the bond reset
|
||||
Value 21 tallies the number of new bonds created by the bond reset
|
||||
operation. Bonds between a specific I,J pair of atoms may persist for
|
||||
the entire hyperdynamics simulation if neither I or J are involved in
|
||||
an event.
|
||||
@ -378,6 +425,16 @@ an event.
|
||||
The scalar and vector values calculated by this fix are all
|
||||
"intensive".
|
||||
|
||||
This fix also computes a local vector of length the number of bonds
|
||||
currently in the system. The value for each bond is its Cij prefactor
|
||||
(bias coefficient). These values can be can be accessed by various
|
||||
"output commands"_Howto_output.html. A particularly useful one is the
|
||||
"fix ave/histo"_fix_ave_histo.html command which can be used to
|
||||
histogram the Cij values to see if they are distributed reasonably
|
||||
close to 1.0, which indicates a good choice of {Vmax}.
|
||||
|
||||
The local values calculated by this fix are unitless.
|
||||
|
||||
No parameter of this fix can be used with the {start/stop} keywords of
|
||||
the "run"_run.html command. This fix is not invoked during "energy
|
||||
minimization"_minimize.html.
|
||||
@ -392,7 +449,9 @@ doc page for more info.
|
||||
|
||||
"hyper"_hyper.html, "fix hyper/global"_fix_hyper_global.html
|
||||
|
||||
[Default:] None
|
||||
[Default:]
|
||||
|
||||
The check/ghost and check/bias keywords are not enabled by default.
|
||||
|
||||
:line
|
||||
|
||||
|
||||
@ -12,6 +12,8 @@ variable cutevent index 1.1
|
||||
variable steps index 100000
|
||||
variable nevent index 1000
|
||||
variable zoom index 1.8
|
||||
variable seed index 826626413
|
||||
variable tol index 1.0e-15
|
||||
|
||||
units metal
|
||||
atom_style atomic
|
||||
@ -45,7 +47,7 @@ neighbor 0.5 bin
|
||||
neigh_modify every 1 delay 5 check yes
|
||||
|
||||
fix 1 mobile nve
|
||||
fix 2 mobile langevin ${Tequil} ${Tequil} 1.0 858872873 zero yes
|
||||
fix 2 mobile langevin ${Tequil} ${Tequil} 1.0 ${seed} zero yes
|
||||
|
||||
timestep 0.005
|
||||
|
||||
@ -92,4 +94,4 @@ dump_modify 1 pad 6 amap 1 3 sa 1 3 blue red green
|
||||
|
||||
# run
|
||||
|
||||
hyper ${steps} ${nevent} HG event min 1.0e-6 1.0e-6 100 100 dump 1
|
||||
hyper ${steps} ${nevent} HG event min ${tol} ${tol} 1000 1000 dump 1
|
||||
|
||||
@ -107,6 +107,12 @@ dump 1 all image 10000000 local.*.jpg v_acolor type size 1024 1024 &
|
||||
zoom ${zoom} adiam 2.5 view 0.0 0.0 up 0 1 0 axes yes 0.9 0.01
|
||||
dump_modify 1 pad 6 amap 1 3 sa 1 3 blue red green
|
||||
|
||||
# test of histogramming and dump output of bias coeffs
|
||||
|
||||
#fix histo all ave/histo 10 100 1000 0.9 1.1 100 f_HL &
|
||||
# mode vector kind local file tmp.histo
|
||||
#dump 2 all local 1000 tmp.local f_HL
|
||||
|
||||
# run
|
||||
|
||||
hyper ${steps} ${nevent} HL event min ${tol} ${tol} 1000 1000 dump 1
|
||||
|
||||
@ -37,7 +37,7 @@ using namespace FixConst;
|
||||
|
||||
// possible enhancements
|
||||
// should there be a virial contribution from boosted bond?
|
||||
// allow newton off? see Note in pre_reverse()
|
||||
// allow newton off?
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -52,7 +52,7 @@ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) :
|
||||
hyperflag = 1;
|
||||
scalar_flag = 1;
|
||||
vector_flag = 1;
|
||||
size_vector = 11;
|
||||
size_vector = 12;
|
||||
global_freq = 1;
|
||||
extscalar = 0;
|
||||
extvector = 0;
|
||||
@ -76,6 +76,7 @@ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) :
|
||||
maxold = 0;
|
||||
xold = NULL;
|
||||
tagold = NULL;
|
||||
old2now = NULL;
|
||||
|
||||
me = comm->me;
|
||||
firstflag = 1;
|
||||
@ -94,6 +95,7 @@ FixHyperGlobal::~FixHyperGlobal()
|
||||
memory->sfree(blist);
|
||||
memory->destroy(xold);
|
||||
memory->destroy(tagold);
|
||||
memory->destroy(old2now);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -114,6 +116,7 @@ void FixHyperGlobal::init_hyper()
|
||||
maxdriftsq = 0.0;
|
||||
maxbondlen = 0.0;
|
||||
nobias = 0;
|
||||
negstrain = 0;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -155,14 +158,16 @@ void FixHyperGlobal::setup_pre_neighbor()
|
||||
|
||||
void FixHyperGlobal::setup_pre_reverse(int eflag, int vflag)
|
||||
{
|
||||
// no increment in nobias or hyper time when pre-run forces are calculated
|
||||
// no increment in these quantities when pre-run forces are calculated
|
||||
|
||||
int nobias_hold = nobias;
|
||||
int negstrain_hold = negstrain;
|
||||
double t_hyper_hold = t_hyper;
|
||||
|
||||
pre_reverse(eflag,vflag);
|
||||
|
||||
nobias = nobias_hold;
|
||||
negstrain = negstrain_hold;
|
||||
t_hyper = t_hyper_hold;
|
||||
}
|
||||
|
||||
@ -171,7 +176,7 @@ void FixHyperGlobal::setup_pre_reverse(int eflag, int vflag)
|
||||
void FixHyperGlobal::pre_neighbor()
|
||||
{
|
||||
int i,m,iold,jold,ilocal,jlocal;
|
||||
double distsq;
|
||||
// double distsq;
|
||||
|
||||
// reset local indices for owned bond atoms, since atoms have migrated
|
||||
// must be done after ghost atoms are setup via comm->borders()
|
||||
@ -182,6 +187,7 @@ void FixHyperGlobal::pre_neighbor()
|
||||
// closest_image() returns the ghost atom index in that case
|
||||
// also compute max drift of any atom in a bond
|
||||
// drift = displacement from quenched coord while event has not yet occured
|
||||
// NOTE: drift calc is now done in bond_build(), between 2 quenched states
|
||||
|
||||
for (i = 0; i < nall_old; i++) old2now[i] = -1;
|
||||
|
||||
@ -199,8 +205,8 @@ void FixHyperGlobal::pre_neighbor()
|
||||
if (ilocal < 0)
|
||||
error->one(FLERR,"Fix hyper/global bond atom not found");
|
||||
old2now[iold] = ilocal;
|
||||
distsq = MathExtra::distsq3(x[ilocal],xold[iold]);
|
||||
maxdriftsq = MAX(distsq,maxdriftsq);
|
||||
//distsq = MathExtra::distsq3(x[ilocal],xold[iold]);
|
||||
//maxdriftsq = MAX(distsq,maxdriftsq);
|
||||
}
|
||||
if (jlocal < 0) {
|
||||
jlocal = atom->map(tagold[jold]);
|
||||
@ -208,40 +214,13 @@ void FixHyperGlobal::pre_neighbor()
|
||||
if (jlocal < 0)
|
||||
error->one(FLERR,"Fix hyper/global bond atom not found");
|
||||
old2now[jold] = jlocal;
|
||||
distsq = MathExtra::distsq3(x[jlocal],xold[jold]);
|
||||
maxdriftsq = MAX(distsq,maxdriftsq);
|
||||
//distsq = MathExtra::distsq3(x[jlocal],xold[jold]);
|
||||
//maxdriftsq = MAX(distsq,maxdriftsq);
|
||||
}
|
||||
|
||||
blist[m].i = ilocal;
|
||||
blist[m].j = jlocal;
|
||||
}
|
||||
|
||||
/* old way - nblocal loop is re-doing index-find calculation
|
||||
|
||||
// NOTE: drift may not include J atoms moving (if not themselves bond owners)
|
||||
|
||||
int flag = 0;
|
||||
|
||||
for (m = 0; m < nblocal; m++) {
|
||||
iold = blist[m].iold;
|
||||
jold = blist[m].jold;
|
||||
ilocal = atom->map(tagold[iold]);
|
||||
jlocal = atom->map(tagold[jold]);
|
||||
ilocal = domain->closest_image(xold[iold],ilocal);
|
||||
jlocal = domain->closest_image(xold[iold],jlocal);
|
||||
blist[m].i = ilocal;
|
||||
blist[m].j = jlocal;
|
||||
|
||||
if (ilocal < 0 || jlocal < 0) flag++;
|
||||
else {
|
||||
distsq = MathExtra::distsq3(x[ilocal],xold[iold]);
|
||||
maxdriftsq = MAX(distsq,maxdriftsq);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag) error->one(FLERR,"Fix hyper/global bond atom not found");
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -254,12 +233,12 @@ void FixHyperGlobal::pre_reverse(int /* eflag */, int /* vflag */)
|
||||
double ebias,vbias,fbias,fbiasr;
|
||||
|
||||
// compute current strain of each owned bond
|
||||
// eabs_max = maximum absolute value of strain of any bond I own
|
||||
// emax = maximum abs value of strain of any bond I own
|
||||
// imax,jmax = local indices of my 2 atoms in that bond
|
||||
// rmax,r0max = current and relaxed lengths of that bond
|
||||
|
||||
double **x = atom->x;
|
||||
double estrain_maxabs = 0.0;
|
||||
double emax = 0.0;
|
||||
|
||||
for (m = 0; m < nblocal; m++) {
|
||||
i = blist[m].i;
|
||||
@ -272,8 +251,8 @@ void FixHyperGlobal::pre_reverse(int /* eflag */, int /* vflag */)
|
||||
r0 = blist[m].r0;
|
||||
estrain = fabs(r-r0) / r0;
|
||||
|
||||
if (estrain > estrain_maxabs) {
|
||||
estrain_maxabs = estrain;
|
||||
if (estrain > emax) {
|
||||
emax = estrain;
|
||||
rmax = r;
|
||||
r0max = r0;
|
||||
imax = i;
|
||||
@ -285,7 +264,7 @@ void FixHyperGlobal::pre_reverse(int /* eflag */, int /* vflag */)
|
||||
// finds max strain and what proc owns it
|
||||
// owner = proc that owns that bond
|
||||
|
||||
pairme.value = estrain_maxabs;
|
||||
pairme.value = emax;
|
||||
pairme.proc = me;
|
||||
MPI_Allreduce(&pairme,&pairall,1,MPI_DOUBLE_INT,MPI_MAXLOC,world);
|
||||
owner = pairall.proc;
|
||||
@ -311,16 +290,14 @@ void FixHyperGlobal::pre_reverse(int /* eflag */, int /* vflag */)
|
||||
// Fix = x component of force on atom I
|
||||
// = Fbias dEbias/dr dr/dxi, dEbias/dr = 1/r0, dr/dxi = delx/r
|
||||
// dt_boost = time boost factor = exp(Vbias/kT)
|
||||
// NOTE: logic here would need to be different for newton off
|
||||
|
||||
double **f = atom->f;
|
||||
|
||||
vbias = fbias = 0.0;
|
||||
dt_boost = 1.0;
|
||||
|
||||
if (estrain_maxabs < qfactor) {
|
||||
//ebias = (rmax-r0max) / r0max;
|
||||
ebias = fabs(rmax-r0max) / r0max;
|
||||
if (emax < qfactor) {
|
||||
ebias = (rmax-r0max) / r0max;
|
||||
vbias = vmax * (1.0 - ebias*ebias*invqfactorsq);
|
||||
fbias = 2.0 * vmax * ebias * invqfactorsq;
|
||||
dt_boost = exp(beta*vbias);
|
||||
@ -338,13 +315,15 @@ void FixHyperGlobal::pre_reverse(int /* eflag */, int /* vflag */)
|
||||
f[jmax][1] -= dely*fbiasr;
|
||||
f[jmax][2] -= delz*fbiasr;
|
||||
|
||||
if (ebias < 0.0) negstrain++;
|
||||
|
||||
} else nobias++;
|
||||
|
||||
// output quantities
|
||||
|
||||
outvec[0] = vbias;
|
||||
outvec[1] = dt_boost;
|
||||
outvec[2] = ebias;
|
||||
outvec[2] = emax;
|
||||
outvec[3] = atom->tag[imax];
|
||||
outvec[4] = atom->tag[jmax];
|
||||
|
||||
@ -356,8 +335,8 @@ void FixHyperGlobal::pre_reverse(int /* eflag */, int /* vflag */)
|
||||
|
||||
void FixHyperGlobal::build_bond_list(int natom)
|
||||
{
|
||||
int i,j,ii,jj,inum,jnum;
|
||||
double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
|
||||
int i,j,m,ii,jj,iold,jold,ilocal,jlocal,inum,jnum;
|
||||
double xtmp,ytmp,ztmp,delx,dely,delz,rsq,distsq;
|
||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||
|
||||
if (natom) {
|
||||
@ -365,6 +344,27 @@ void FixHyperGlobal::build_bond_list(int natom)
|
||||
nevent_atom += natom;
|
||||
}
|
||||
|
||||
// compute max distance any bond atom has moved between 2 quenched states
|
||||
// xold[iold] = last quenched coord for iold
|
||||
// x[ilocal] = current quenched coord for same atom
|
||||
|
||||
double **x = atom->x;
|
||||
int nlocal = atom->nlocal;
|
||||
int nall = nlocal + atom->nghost;
|
||||
|
||||
for (m = 0; m < nblocal; m++) {
|
||||
iold = blist[m].iold;
|
||||
ilocal = atom->map(tagold[iold]);
|
||||
ilocal = domain->closest_image(xold[iold],ilocal);
|
||||
distsq = MathExtra::distsq3(x[ilocal],xold[iold]);
|
||||
maxdriftsq = MAX(distsq,maxdriftsq);
|
||||
jold = blist[m].jold;
|
||||
jlocal = atom->map(tagold[jold]);
|
||||
jlocal = domain->closest_image(xold[iold],jlocal);
|
||||
distsq = MathExtra::distsq3(x[jlocal],xold[jold]);
|
||||
maxdriftsq = MAX(distsq,maxdriftsq);
|
||||
}
|
||||
|
||||
// trigger neighbor list build
|
||||
|
||||
neighbor->build_one(list);
|
||||
@ -372,7 +372,6 @@ void FixHyperGlobal::build_bond_list(int natom)
|
||||
// identify bonds assigned to each owned atom
|
||||
// do not create a bond between two non-group atoms
|
||||
|
||||
double **x = atom->x;
|
||||
int *mask = atom->mask;
|
||||
|
||||
inum = list->inum;
|
||||
@ -415,10 +414,12 @@ void FixHyperGlobal::build_bond_list(int natom)
|
||||
}
|
||||
}
|
||||
|
||||
// store IDs and coords for owned+ghost atoms at time of bond creation
|
||||
// realloc xold and tagold as needed
|
||||
// store per-atom quantities for owned+ghost atoms at time of bond creation
|
||||
// nall_old = value of nall at time bonds are built
|
||||
|
||||
if (atom->nmax > maxold) {
|
||||
tagint *tag = atom->tag;
|
||||
|
||||
if (nall > maxold) {
|
||||
memory->destroy(xold);
|
||||
memory->destroy(tagold);
|
||||
memory->destroy(old2now);
|
||||
@ -428,16 +429,11 @@ void FixHyperGlobal::build_bond_list(int natom)
|
||||
memory->create(old2now,maxold,"hyper/global:old2now");
|
||||
}
|
||||
|
||||
tagint *tag = atom->tag;
|
||||
int nall = atom->nlocal + atom->nghost;
|
||||
nall_old = nall;
|
||||
memcpy(&xold[0][0],&x[0][0],3*nall*sizeof(double));
|
||||
for (i = 0; i < nall; i++) tagold[i] = tag[i];
|
||||
|
||||
for (i = 0; i < nall; i++) {
|
||||
xold[i][0] = x[i][0];
|
||||
xold[i][1] = x[i][1];
|
||||
xold[i][2] = x[i][2];
|
||||
tagold[i] = tag[i];
|
||||
}
|
||||
nlocal_old = nlocal;
|
||||
nall_old = nall;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -473,7 +469,7 @@ double FixHyperGlobal::compute_vector(int i)
|
||||
bcastflag = 0;
|
||||
}
|
||||
|
||||
// 11 vector outputs returned for i = 0-10
|
||||
// 12 vector outputs returned for i = 0-11
|
||||
|
||||
// i = 0 = boost factor on this step
|
||||
// i = 1 = max strain of any bond on this step (positive or negative)
|
||||
@ -481,13 +477,14 @@ double FixHyperGlobal::compute_vector(int i)
|
||||
// i = 3 = ID of atom J in max-strain bond on this step
|
||||
// i = 4 = ave bonds/atom on this step
|
||||
|
||||
// i = 5 = fraction of steps with no bias during this run
|
||||
// i = 6 = max drift of any atom during this run
|
||||
// i = 7 = max bond length during this run
|
||||
// i = 5 = fraction of steps where bond has no bias during this run
|
||||
// i = 6 = fraction of steps where bond has negative strain during this run
|
||||
// i = 7 = max drift distance of any atom during this run
|
||||
// i = 8 = max bond length during this run
|
||||
|
||||
// i = 8 = cummulative hyper time since fix created
|
||||
// i = 9 = cummulative # of event timesteps since fix created
|
||||
// i = 10 = cummulative # of atoms in events since fix created
|
||||
// i = 9 = cummulative hyper time since fix created
|
||||
// i = 10 = cummulative # of event timesteps since fix created
|
||||
// i = 11 = cummulative # of atoms in events since fix created
|
||||
|
||||
if (i == 0) return outvec[1];
|
||||
if (i == 1) return outvec[2];
|
||||
@ -509,20 +506,27 @@ double FixHyperGlobal::compute_vector(int i)
|
||||
}
|
||||
|
||||
if (i == 6) {
|
||||
if (update->ntimestep == update->firststep) return 0.0;
|
||||
int allnegstrain;
|
||||
MPI_Allreduce(&negstrain,&allnegstrain,1,MPI_INT,MPI_SUM,world);
|
||||
return 1.0*allnegstrain / (update->ntimestep - update->firststep);
|
||||
}
|
||||
|
||||
if (i == 7) {
|
||||
double alldriftsq;
|
||||
MPI_Allreduce(&maxdriftsq,&alldriftsq,1,MPI_DOUBLE,MPI_MAX,world);
|
||||
return sqrt(alldriftsq);
|
||||
}
|
||||
|
||||
if (i == 7) {
|
||||
if (i == 8) {
|
||||
double allbondlen;
|
||||
MPI_Allreduce(&maxbondlen,&allbondlen,1,MPI_DOUBLE,MPI_MAX,world);
|
||||
return allbondlen;
|
||||
}
|
||||
|
||||
if (i == 8) return t_hyper;
|
||||
if (i == 9) return (double) nevent;
|
||||
if (i == 10) return (double) nevent_atom;
|
||||
if (i == 9) return t_hyper;
|
||||
if (i == 10) return (double) nevent;
|
||||
if (i == 11) return (double) nevent_atom;
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
@ -534,13 +538,14 @@ double FixHyperGlobal::compute_vector(int i)
|
||||
|
||||
double FixHyperGlobal::query(int i)
|
||||
{
|
||||
if (i == 1) return compute_vector(8); // cummulative hyper time
|
||||
if (i == 2) return compute_vector(9); // nevent
|
||||
if (i == 3) return compute_vector(10); // nevent_atom
|
||||
if (i == 1) return compute_vector(9); // cummulative hyper time
|
||||
if (i == 2) return compute_vector(10); // nevent
|
||||
if (i == 3) return compute_vector(11); // nevent_atom
|
||||
if (i == 4) return compute_vector(4); // ave bonds/atom
|
||||
if (i == 5) return compute_vector(6); // maxdrift
|
||||
if (i == 6) return compute_vector(7); // maxbondlen
|
||||
if (i == 5) return compute_vector(7); // maxdrift
|
||||
if (i == 6) return compute_vector(8); // maxbondlen
|
||||
if (i == 7) return compute_vector(5); // fraction with zero bias
|
||||
if (i == 8) return compute_vector(6); // fraction with negative strain
|
||||
|
||||
error->all(FLERR,"Invalid query to fix hyper/global");
|
||||
|
||||
|
||||
@ -56,6 +56,7 @@ class FixHyperGlobal : public FixHyper {
|
||||
double maxbondlen; // max length of any bond
|
||||
double maxdriftsq; // max distance any atom drifts from original pos
|
||||
int nobias; // # of steps when bias = 0, b/c bond too long
|
||||
int negstrain; // # of steps when biased bond has negative strain
|
||||
|
||||
class NeighList *list;
|
||||
|
||||
@ -70,12 +71,13 @@ class FixHyperGlobal : public FixHyper {
|
||||
double r0; // relaxed bond length
|
||||
};
|
||||
|
||||
struct OneBond *blist; // list of owned bonds
|
||||
int nblocal; // # of owned bonds
|
||||
OneBond *blist; // list of owned bonds
|
||||
int nblocal; // # of owned bonds
|
||||
|
||||
// coords and IDs of owned+ghost atoms when bonds were formed
|
||||
// persists on a proc from one event until the next
|
||||
|
||||
int nlocal_old; // nlocal for old atoms
|
||||
int nall_old; // nlocal+nghost for old atoms
|
||||
int maxold; // allocated size of old atoms
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -21,6 +21,7 @@ FixStyle(hyper/local,FixHyperLocal)
|
||||
#define LMP_FIX_HYPER_LOCAL_H
|
||||
|
||||
#include "fix_hyper.h"
|
||||
#include "my_page.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
@ -43,6 +44,7 @@ class FixHyperLocal : public FixHyper {
|
||||
int pack_forward_comm(int, int *, double *, int, int *);
|
||||
void unpack_forward_comm(int, int, double *);
|
||||
int pack_reverse_comm(int, int, double *);
|
||||
int pack_reverse_comm_size(int, int);
|
||||
void unpack_reverse_comm(int, int *, double *);
|
||||
|
||||
double memory_usage();
|
||||
@ -54,54 +56,72 @@ class FixHyperLocal : public FixHyper {
|
||||
|
||||
private:
|
||||
int me;
|
||||
|
||||
// inputs and derived quantities
|
||||
|
||||
double cutbond,qfactor,vmax,tequil,dcut;
|
||||
double alpha_user; // timescale to apply boostostat (time units)
|
||||
double alpha; // unitless dt/alpha_user
|
||||
double boost_target; // target value of boost
|
||||
int checkbias,checkbias_every,checkbias_flag,checkbias_count;
|
||||
int checkghost,checkbias; // flags for optional stats
|
||||
|
||||
double cutbondsq,dcutsq;
|
||||
double beta,invqfactorsq;
|
||||
|
||||
// flags
|
||||
|
||||
int setupflag; // 1 during setup, 0 during run
|
||||
int firstflag; // set for first time bond_build takes place
|
||||
int nostrainyet; // 1 until maxstrain is first computed
|
||||
|
||||
int nbias_running,nobias_running;
|
||||
int nbondbuild;
|
||||
double time_bondbuild;
|
||||
bigint starttime;
|
||||
double sumbiascoeff; // sum of aveboost at every timestep
|
||||
bigint allbonds; // sum of bond count on this step
|
||||
double allbias; // sum of biascoeff on all bonds on this step
|
||||
|
||||
int nnewbond; // running tally of number of new bonds created
|
||||
int maxbondperatom; // max # of bonds any atom ever has
|
||||
int nostrainyet; // 1 until maxstrain is first compute
|
||||
bigint starttime; // timestep when this fix was invoked
|
||||
int commflag; // flag for communication mode
|
||||
|
||||
// stats
|
||||
|
||||
int nbondbuild; // # of rebuilds of bond list
|
||||
double time_bondbuild; // CPU time for bond builds
|
||||
|
||||
bigint allbonds; // current total # of bonds
|
||||
int nnewbond; // running tally of # of new bonds created
|
||||
int maxbondperatom; // max # of bonds any atom ever has
|
||||
int nevent; // # of events that trigger bond rebuild
|
||||
int nevent_atom; // # of atoms that experienced an event
|
||||
double cutbondsq,dcutsq;
|
||||
double beta,invqfactorsq;
|
||||
double mybias;
|
||||
|
||||
int nbias_running; // running count of biased bonds
|
||||
int nobias_running; // ditto for bonds with bias = 0, b/c too long
|
||||
int negstrain_running; // ditto for bonds with negative strain
|
||||
|
||||
double mybias; // sum of bias potentials for biased bonds
|
||||
double maxbondlen; // cummulative max length of any bond
|
||||
double maxdriftsq; // max distance any atom drifts from original pos
|
||||
double maxbiascoeff; // cummulative max bias coeff for any bond
|
||||
double maxdriftsq; // max distance any bond atom drifts from quenched x
|
||||
|
||||
double sumbiascoeff; // sum of all bond bias coeffs at each timestep
|
||||
double avebiascoeff; // cummulative sumbiascoeff/allbonds across steps
|
||||
double minbiascoeff; // cummulative min bias coeff for any bond
|
||||
double maxbiascoeff; // cummulative max bias coeff for any bond
|
||||
|
||||
double rmaxever,rmaxeverbig;
|
||||
int ghost_toofar;
|
||||
int ghost_toofar; // # of ghost atoms not found in Dcut neigh list
|
||||
|
||||
int checkbias_every,checkbias_flag,checkbias_count;
|
||||
|
||||
// 2 neighbor lists
|
||||
|
||||
class NeighList *listfull; // full neigh list up to Dcut distance
|
||||
class NeighList *listhalf; // half neigh list up to pair distance
|
||||
// both created only when bonds are rebuilt
|
||||
|
||||
// list of my owned bonds
|
||||
// list of my owned bonds and bias coeffs
|
||||
// persists on a proc from one event until the next
|
||||
|
||||
struct OneBond { // single IJ bond, atom I is owner
|
||||
int i,j; // current local indices of 2 bond atoms
|
||||
int iold,jold; // local indices when bonds were formed
|
||||
double r0; // relaxed bond length
|
||||
double biascoeff; // biasing coefficient = prefactor Cij
|
||||
};
|
||||
|
||||
struct OneBond *blist; // list of owned bonds
|
||||
OneBond *blist; // list of owned bonds
|
||||
double *biascoeff; // biasing coefficient Cij for each bond
|
||||
int nblocal; // # of owned bonds
|
||||
int maxbond; // allocated size of blist
|
||||
|
||||
@ -137,24 +157,24 @@ class FixHyperLocal : public FixHyper {
|
||||
tagint *biasflag; // atoms in biased bonds marked with bond partner
|
||||
// for owned and ghost atoms
|
||||
|
||||
// data struct used to persist biascoeffs when bond list is re-created
|
||||
|
||||
struct OneCoeff {
|
||||
double biascoeff;
|
||||
tagint jtag;
|
||||
};
|
||||
|
||||
struct OneCoeff **clist; // list of bond coeffs for each atom's bonds
|
||||
int *numcoeff; // # of coeffs per atom
|
||||
int maxcoeff; // allocate size of clist
|
||||
int maxcoeffperatom; // allocated # of columns in clist
|
||||
|
||||
// list of biased bonds this proc owns
|
||||
|
||||
int maxbias; // allocated size of bias list
|
||||
int nbias; // # of biased bonds I own
|
||||
int *bias; // index of biased bonds in my bond list
|
||||
|
||||
// data structs for persisting bias coeffs when bond list is reformed
|
||||
|
||||
struct OneCoeff {
|
||||
double biascoeff;
|
||||
tagint tag;
|
||||
};
|
||||
|
||||
MyPage<OneCoeff> *cpage; // pages of OneCoeff datums for clist
|
||||
OneCoeff **clist; // ptrs to vectors of bias coeffs for each atom
|
||||
int *numcoeff; // # of bias coeffs per atom (one per bond)
|
||||
int maxcoeff; // allocate sized of clist and numcoeff
|
||||
|
||||
// extra timers
|
||||
|
||||
//double timefirst,timesecond,timethird,timefourth;
|
||||
@ -163,7 +183,6 @@ class FixHyperLocal : public FixHyper {
|
||||
// private methods
|
||||
|
||||
void grow_bond();
|
||||
void grow_coeff();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -40,9 +40,7 @@ enum{NOHYPER,GLOBAL,LOCAL};
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Hyper::Hyper(LAMMPS *lmp) :
|
||||
Pointers(lmp), dumplist(NULL)
|
||||
{}
|
||||
Hyper::Hyper(LAMMPS *lmp) : Pointers(lmp), dumplist(NULL) {}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
perform hyperdynamics simulation
|
||||
@ -260,11 +258,12 @@ void Hyper::command(int narg, char **arg)
|
||||
double maxdrift = 0.0;
|
||||
double maxbondlen = 0.0;
|
||||
double fraczero = 1.0;
|
||||
double fracneg = 1.0;
|
||||
|
||||
double nnewbond,avenboost,aveboostcoeff,maxboostcoeff,minboostcoeff;
|
||||
double maxbondperatom,neighbondperbond,aveboostnow;
|
||||
double nnewbond,avenbias,avebiascoeff,minbiascoeff,maxbiascoeff;
|
||||
double maxbondperatom,neighbondperbond,avebiasnow;
|
||||
double tbondbuild,rmaxever,rmaxeverbig,allghost_toofar;
|
||||
double lostbond,lostbondcoeff,biasoverlap,nonmatchbiascoeff;
|
||||
double lostbond,lostbondcoeff,biasoverlap;
|
||||
|
||||
if (hyperenable) {
|
||||
t_hyper = fix_hyper->query(1);
|
||||
@ -274,115 +273,70 @@ void Hyper::command(int narg, char **arg)
|
||||
maxdrift = fix_hyper->query(5);
|
||||
maxbondlen = fix_hyper->query(6);
|
||||
fraczero = fix_hyper->query(7);
|
||||
fracneg = fix_hyper->query(8);
|
||||
|
||||
if (hyperstyle == LOCAL) {
|
||||
nnewbond = fix_hyper->query(8);
|
||||
maxbondperatom = fix_hyper->query(9);
|
||||
avenboost = fix_hyper->query(10);
|
||||
aveboostcoeff = fix_hyper->query(11);
|
||||
maxboostcoeff = fix_hyper->query(12);
|
||||
minboostcoeff = fix_hyper->query(13);
|
||||
neighbondperbond = fix_hyper->query(14);
|
||||
aveboostnow = fix_hyper->query(15);
|
||||
tbondbuild = fix_hyper->query(16);
|
||||
rmaxever = fix_hyper->query(17);
|
||||
rmaxeverbig = fix_hyper->query(18);
|
||||
allghost_toofar = fix_hyper->query(19);
|
||||
lostbond = fix_hyper->query(20);
|
||||
lostbondcoeff = fix_hyper->query(21);
|
||||
biasoverlap = fix_hyper->query(22);
|
||||
nonmatchbiascoeff = fix_hyper->query(23);
|
||||
nnewbond = fix_hyper->query(9);
|
||||
maxbondperatom = fix_hyper->query(10);
|
||||
avenbias = fix_hyper->query(11);
|
||||
avebiascoeff = fix_hyper->query(12);
|
||||
minbiascoeff = fix_hyper->query(13);
|
||||
maxbiascoeff = fix_hyper->query(14);
|
||||
neighbondperbond = fix_hyper->query(15);
|
||||
avebiasnow = fix_hyper->query(16);
|
||||
tbondbuild = fix_hyper->query(17);
|
||||
rmaxever = fix_hyper->query(18);
|
||||
rmaxeverbig = fix_hyper->query(19);
|
||||
allghost_toofar = fix_hyper->query(20);
|
||||
biasoverlap = fix_hyper->query(21);
|
||||
}
|
||||
}
|
||||
|
||||
if (me == 0) {
|
||||
if (screen) {
|
||||
fprintf(screen,"Cummulative quantities for fix hyper:\n");
|
||||
fprintf(screen," hyper time = %g\n",t_hyper);
|
||||
fprintf(screen," time boost factor = %g\n",t_hyper/(nsteps*update->dt));
|
||||
fprintf(screen," event timesteps = %d\n",nevent_running);
|
||||
fprintf(screen," # of atoms in events = %d\n",nevent_atoms_running);
|
||||
fprintf(screen,"Quantities for this hyper run:\n");
|
||||
fprintf(screen," event timesteps = %d\n",nevent);
|
||||
fprintf(screen," # of atoms in events = %d\n",nevent_atoms);
|
||||
fprintf(screen," max length of any bond = %g\n",maxbondlen);
|
||||
fprintf(screen," max drift distance of any atom = %g\n",maxdrift);
|
||||
fprintf(screen," fraction of steps & bonds with zero bias = %g\n",
|
||||
fraczero);
|
||||
fprintf(screen,"Current quantities:\n");
|
||||
fprintf(screen," ave bonds/atom = %g\n",avebonds);
|
||||
FILE *out;
|
||||
for (int iout = 0; iout < 2; iout++) {
|
||||
if (iout == 0) out = screen;
|
||||
if (iout == 1) out = logfile;
|
||||
if (!out) continue;
|
||||
fprintf(out,"Cummulative quantities for fix hyper:\n");
|
||||
fprintf(out," hyper time = %g\n",t_hyper);
|
||||
fprintf(out," time boost factor = %g\n",t_hyper/(nsteps*update->dt));
|
||||
fprintf(out," event timesteps = %d\n",nevent_running);
|
||||
fprintf(out," # of atoms in events = %d\n",nevent_atoms_running);
|
||||
fprintf(out,"Quantities for this hyper run:\n");
|
||||
fprintf(out," event timesteps = %d\n",nevent);
|
||||
fprintf(out," # of atoms in events = %d\n",nevent_atoms);
|
||||
fprintf(out," max length of any bond = %g\n",maxbondlen);
|
||||
fprintf(out," max drift distance of any atom = %g\n",maxdrift);
|
||||
fprintf(out," fraction of biased bonds with zero bias = %g\n",fraczero);
|
||||
fprintf(out," fraction of biased bonds with negative strain = %g\n",
|
||||
fracneg);
|
||||
fprintf(out,"Current quantities:\n");
|
||||
fprintf(out," ave bonds/atom = %g\n",avebonds);
|
||||
|
||||
if (hyperstyle == LOCAL) {
|
||||
fprintf(screen,"Cummulative quantities specific to fix hyper/local:\n");
|
||||
fprintf(screen," # of new bonds formed = %g\n",nnewbond);
|
||||
fprintf(screen," max bonds/atom = %g\n",maxbondperatom);
|
||||
fprintf(screen,"Quantities for this hyper run specific to "
|
||||
fprintf(out,"Cummulative quantities specific to fix hyper/local:\n");
|
||||
fprintf(out," # of new bonds formed = %g\n",nnewbond);
|
||||
fprintf(out," max bonds/atom = %g\n",maxbondperatom);
|
||||
fprintf(out,"Quantities for this hyper run specific to "
|
||||
"fix hyper/local:\n");
|
||||
fprintf(screen," ave boosted bonds/step = %g\n",avenboost);
|
||||
fprintf(screen," ave boost coeff of all bonds = %g\n",aveboostcoeff);
|
||||
fprintf(screen," max boost coeff of any bond = %g\n",maxboostcoeff);
|
||||
fprintf(screen," min boost coeff of any bond = %g\n",minboostcoeff);
|
||||
fprintf(screen," max dist from my box of any "
|
||||
fprintf(out," ave biased bonds/step = %g\n",avenbias);
|
||||
fprintf(out," ave bias coeff of all bonds = %g\n",avebiascoeff);
|
||||
fprintf(out," min bias coeff of any bond = %g\n",minbiascoeff);
|
||||
fprintf(out," max bias coeff of any bond = %g\n",maxbiascoeff);
|
||||
fprintf(out," max dist from my subbox of any "
|
||||
"non-maxstrain bond ghost atom = %g\n",rmaxever);
|
||||
fprintf(screen," max dist from my box of any bond ghost atom = %g\n",
|
||||
fprintf(out," max dist from my box of any bond ghost atom = %g\n",
|
||||
rmaxeverbig);
|
||||
fprintf(screen," count of bond ghost neighbors "
|
||||
fprintf(out," count of bond ghost neighbors "
|
||||
"not found on reneighbor steps = %g\n",allghost_toofar);
|
||||
fprintf(screen," lost bond partners = %g\n",lostbond);
|
||||
fprintf(screen," ave bias coeff for lost bond partners = %g\n",
|
||||
lostbondcoeff);
|
||||
fprintf(screen," bias overlaps = %g\n",biasoverlap);
|
||||
fprintf(screen," non-matching bias coeffs = %g\n",nonmatchbiascoeff);
|
||||
fprintf(screen," CPU time for bond builds = %g\n",tbondbuild);
|
||||
fprintf(screen,"Current quantities specific to fix hyper/local:\n");
|
||||
fprintf(screen," neighbor bonds/bond = %g\n",neighbondperbond);
|
||||
fprintf(screen," ave boost coeff for all bonds = %g\n",aveboostnow);
|
||||
fprintf(out," bias overlaps = %g\n",biasoverlap);
|
||||
fprintf(out," CPU time for bond builds = %g\n",tbondbuild);
|
||||
fprintf(out,"Current quantities specific to fix hyper/local:\n");
|
||||
fprintf(out," neighbor bonds/bond = %g\n",neighbondperbond);
|
||||
fprintf(out," ave boost coeff for all bonds = %g\n",avebiasnow);
|
||||
}
|
||||
fprintf(screen,"\n");
|
||||
}
|
||||
|
||||
if (logfile) {
|
||||
fprintf(logfile,"Cummulative quantities for fix hyper:\n");
|
||||
fprintf(logfile," hyper time = %g\n",t_hyper);
|
||||
fprintf(logfile," event timesteps = %d\n",nevent_running);
|
||||
fprintf(logfile," # of atoms in events = %d\n",nevent_atoms_running);
|
||||
fprintf(logfile,"Quantities for this hyper run:\n");
|
||||
fprintf(logfile," event timesteps = %d\n",nevent);
|
||||
fprintf(logfile," # of atoms in events = %d\n",nevent_atoms);
|
||||
fprintf(logfile," max length of any bond = %g\n",maxbondlen);
|
||||
fprintf(logfile," max drift distance of any atom = %g\n",maxdrift);
|
||||
fprintf(logfile," fraction of steps & bonds with zero bias = %g\n",
|
||||
fraczero);
|
||||
fprintf(logfile,"Current quantities:\n");
|
||||
fprintf(logfile," ave bonds/atom = %g\n",avebonds);
|
||||
|
||||
if (hyperstyle == LOCAL) {
|
||||
fprintf(logfile,"Cummulative quantities specific tofix hyper/local:\n");
|
||||
fprintf(logfile," # of new bonds formed = %g\n",nnewbond);
|
||||
fprintf(logfile," max bonds/atom = %g\n",maxbondperatom);
|
||||
fprintf(logfile,"Quantities for this hyper run specific to "
|
||||
"fix hyper/local:\n");
|
||||
fprintf(logfile," ave boosted bonds/step = %g\n",avenboost);
|
||||
fprintf(logfile," ave boost coeff of all bonds = %g\n",aveboostcoeff);
|
||||
fprintf(logfile," max boost coeff of any bond = %g\n",maxboostcoeff);
|
||||
fprintf(logfile," min boost coeff of any bond = %g\n",minboostcoeff);
|
||||
fprintf(logfile," max dist from my box of any "
|
||||
"non-maxstrain bond ghost atom = %g\n",rmaxever);
|
||||
fprintf(logfile," max dist from my box of any bond ghost atom = %g\n",
|
||||
rmaxeverbig);
|
||||
fprintf(logfile," count of ghost bond neighbors "
|
||||
"not found on reneighbor steps = %g\n",allghost_toofar);
|
||||
fprintf(logfile," lost bond partners = %g\n",lostbond);
|
||||
fprintf(logfile," ave bias coeff for lost bond partners = %g\n",
|
||||
lostbondcoeff);
|
||||
fprintf(logfile," bias overlaps = %g\n",biasoverlap);
|
||||
fprintf(logfile," non-matching bias coeffs = %g\n",nonmatchbiascoeff);
|
||||
fprintf(logfile," CPU time for bond builds = %g\n",tbondbuild);
|
||||
fprintf(logfile,"Current quantities specific to fix hyper/local:\n");
|
||||
fprintf(logfile," neighbor bonds/bond = %g\n",neighbondperbond);
|
||||
fprintf(logfile," ave boost coeff for all bonds = %g\n",aveboostnow);
|
||||
}
|
||||
fprintf(logfile,"\n");
|
||||
fprintf(out,"\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ using namespace FixConst;
|
||||
enum{X,V,F,COMPUTE,FIX,VARIABLE};
|
||||
enum{ONE,RUNNING};
|
||||
enum{SCALAR,VECTOR,WINDOW};
|
||||
enum{GLOBAL,PERATOM,LOCAL};
|
||||
enum{DEFAULT,GLOBAL,PERATOM,LOCAL};
|
||||
enum{IGNORE,END,EXTRA};
|
||||
|
||||
#define INVOKED_SCALAR 1
|
||||
@ -46,8 +46,10 @@ enum{IGNORE,END,EXTRA};
|
||||
|
||||
FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg),
|
||||
nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), fp(NULL), stats_list(NULL),
|
||||
bin(NULL), bin_total(NULL), bin_all(NULL), bin_list(NULL), coord(NULL), vector(NULL)
|
||||
nvalues(0), which(NULL), argindex(NULL), value2index(NULL),
|
||||
ids(NULL), fp(NULL), stats_list(NULL),
|
||||
bin(NULL), bin_total(NULL), bin_all(NULL), bin_list(NULL),
|
||||
coord(NULL), vector(NULL)
|
||||
{
|
||||
if (narg < 10) error->all(FLERR,"Illegal fix ave/histo command");
|
||||
|
||||
@ -188,9 +190,8 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
|
||||
memory->sfree(earg);
|
||||
}
|
||||
|
||||
// setup and error check
|
||||
// kind = inputs are all global, or all per-atom, or all local
|
||||
// for fix inputs, check that fix frequency is acceptable
|
||||
// check input args for kind consistency
|
||||
// all inputs must all be global, per-atom, or local
|
||||
|
||||
if (nevery <= 0 || nrepeat <= 0 || nfreq <= 0)
|
||||
error->all(FLERR,"Illegal fix ave/histo command");
|
||||
@ -201,40 +202,65 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (ave != RUNNING && overwrite)
|
||||
error->all(FLERR,"Illegal fix ave/histo command");
|
||||
|
||||
int kindflag;
|
||||
int kindglobal,kindperatom,kindlocal;
|
||||
|
||||
for (int i = 0; i < nvalues; i++) {
|
||||
if (which[i] == X || which[i] == V || which[i] == F) kindflag = PERATOM;
|
||||
else if (which[i] == COMPUTE) {
|
||||
kindglobal = kindperatom = kindlocal = 0;
|
||||
|
||||
if (which[i] == X || which[i] == V || which[i] == F) {
|
||||
kindperatom = 1;
|
||||
|
||||
} else if (which[i] == COMPUTE) {
|
||||
int c_id = modify->find_compute(ids[i]);
|
||||
if (c_id < 0) error->all(FLERR,"Fix ave/histo input is invalid compute");
|
||||
Compute *compute = modify->compute[c_id];
|
||||
// computes can produce multiple kinds of output
|
||||
if (compute->scalar_flag || compute->vector_flag || compute->array_flag)
|
||||
kindflag = GLOBAL;
|
||||
else if (compute->peratom_flag) kindflag = PERATOM;
|
||||
else if (compute->local_flag) kindflag = LOCAL;
|
||||
else error->all(FLERR,"Fix ave/histo input is invalid compute");
|
||||
kindglobal = 1;
|
||||
if (compute->peratom_flag) kindperatom = 1;
|
||||
if (compute->local_flag) kindlocal = 1;
|
||||
|
||||
} else if (which[i] == FIX) {
|
||||
int f_id = modify->find_fix(ids[i]);
|
||||
if (f_id < 0) error->all(FLERR,"Fix ave/histo input is invalid fix");
|
||||
Fix *fix = modify->fix[f_id];
|
||||
// fixes can produce multiple kinds of output
|
||||
if (fix->scalar_flag || fix->vector_flag || fix->array_flag)
|
||||
kindflag = GLOBAL;
|
||||
else if (fix->peratom_flag) kindflag = PERATOM;
|
||||
else if (fix->local_flag) kindflag = LOCAL;
|
||||
else error->all(FLERR,"Fix ave/histo input is invalid fix");
|
||||
kindglobal = 1;
|
||||
if (fix->peratom_flag) kindperatom = 1;
|
||||
if (fix->local_flag) kindlocal = 1;
|
||||
|
||||
} else if (which[i] == VARIABLE) {
|
||||
int ivariable = input->variable->find(ids[i]);
|
||||
if (ivariable < 0) error->all(FLERR,"Fix ave/histo input is invalid variable");
|
||||
if (input->variable->equalstyle(ivariable)) kindflag = GLOBAL;
|
||||
else if (input->variable->atomstyle(ivariable)) kindflag = PERATOM;
|
||||
else error->all(FLERR,"Fix ave/histo input is invalid variable");
|
||||
if (ivariable < 0)
|
||||
error->all(FLERR,"Fix ave/histo input is invalid variable");
|
||||
// variables only produce one kind of output
|
||||
if (input->variable->equalstyle(ivariable)) kindglobal = 1;
|
||||
else if (input->variable->atomstyle(ivariable)) kindperatom = 1;
|
||||
else error->all(FLERR,"Fix ave/histo input is invalid kind of variable");
|
||||
}
|
||||
|
||||
if (kind == DEFAULT) {
|
||||
if (kindglobal + kindperatom + kindlocal > 1)
|
||||
error->all(FLERR,"Fix ave/histo input kind is ambiguous");
|
||||
if (kindglobal) kind = GLOBAL;
|
||||
if (kindperatom) kind = PERATOM;
|
||||
if (kindlocal) kind = LOCAL;
|
||||
} else if (kind == GLOBAL) {
|
||||
if (!kindglobal)
|
||||
error->all(FLERR,"Fix ave/histo input kind is invalid");
|
||||
} else if (kind == PERATOM) {
|
||||
if (!kindperatom)
|
||||
error->all(FLERR,"Fix ave/histo input kind is invalid");
|
||||
} else if (kind == LOCAL) {
|
||||
if (!kindlocal)
|
||||
error->all(FLERR,"Fix ave/histo input kind is invalid");
|
||||
}
|
||||
if (i == 0) kind = kindflag;
|
||||
else if (kindflag != kind)
|
||||
error->all(FLERR,
|
||||
"Fix ave/histo inputs are not all global, peratom, or local");
|
||||
}
|
||||
|
||||
// more error checks
|
||||
// for fix inputs, check that fix frequency is acceptable
|
||||
|
||||
if (kind == PERATOM && mode == SCALAR)
|
||||
error->all(FLERR,
|
||||
"Fix ave/histo cannot input per-atom values in scalar mode");
|
||||
@ -919,6 +945,7 @@ void FixAveHisto::options(int iarg, int narg, char **arg)
|
||||
// option defaults
|
||||
|
||||
fp = NULL;
|
||||
kind = DEFAULT;
|
||||
ave = ONE;
|
||||
startstep = 0;
|
||||
mode = SCALAR;
|
||||
@ -942,6 +969,13 @@ void FixAveHisto::options(int iarg, int narg, char **arg)
|
||||
}
|
||||
}
|
||||
iarg += 2;
|
||||
} else if (strcmp(arg[iarg],"kind") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
|
||||
if (strcmp(arg[iarg+1],"global") == 0) kind = GLOBAL;
|
||||
else if (strcmp(arg[iarg+1],"peratom") == 0) kind = PERATOM;
|
||||
else if (strcmp(arg[iarg+1],"local") == 0) kind = LOCAL;
|
||||
else error->all(FLERR,"Illegal fix ave/histo command");
|
||||
iarg += 2;
|
||||
} else if (strcmp(arg[iarg],"ave") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
|
||||
if (strcmp(arg[iarg+1],"one") == 0) ave = ONE;
|
||||
|
||||
@ -380,9 +380,8 @@ void Thermo::compute(int flag)
|
||||
loc += sprintf(&line[loc],format[ifield],dvalue);
|
||||
else if (vtype[ifield] == INT)
|
||||
loc += sprintf(&line[loc],format[ifield],ivalue);
|
||||
else if (vtype[ifield] == BIGINT) {
|
||||
else if (vtype[ifield] == BIGINT)
|
||||
loc += sprintf(&line[loc],format[ifield],bivalue);
|
||||
}
|
||||
}
|
||||
|
||||
// print line to screen and logfile
|
||||
|
||||
Reference in New Issue
Block a user