Merge pull request #1853 from akohlmey/collected-small-changes
Collected small changes and bugfixes for the next patch release
This commit is contained in:
@ -489,6 +489,9 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
|
||||
Only systems with bonds that can be changed can be used. Atom\_style
|
||||
template does not qualify.
|
||||
|
||||
*Bond/react: Invalid template atom ID in map file*
|
||||
Atom IDs in molecule templates range from 1 to the number of atoms in the template.
|
||||
|
||||
*Bond/react: Rmax cutoff is longer than pairwise cutoff*
|
||||
This is not allowed because bond creation is done using the pairwise
|
||||
neighbor list.
|
||||
|
||||
@ -115,8 +115,8 @@ Files in Ubuntu on Windows
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When you launch "Bash on Ubuntu on Windows" you will start out in your Linux
|
||||
user home directory /home/\ **username**\ . You can access your Windows user directory
|
||||
using the /mnt/c/Users/\ **username** folder.
|
||||
user home directory /home/[username]\ . You can access your Windows user directory
|
||||
using the /mnt/c/Users/[username] folder.
|
||||
|
||||
Download LAMMPS
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
@ -81,12 +81,12 @@ and output the statistics in various ways:
|
||||
|
||||
compute 1 all property/local aatom1 aatom2 aatom3 atype
|
||||
compute 2 all angle/local eng theta v_cos v_cossq set theta t
|
||||
dump 1 all local 100 tmp.dump c_1**\*** c_2**\***
|
||||
dump 1 all local 100 tmp.dump c_1[*] c_2[*]
|
||||
|
||||
compute 3 all reduce ave c_2**\***
|
||||
thermo_style custom step temp press c_3**\***
|
||||
compute 3 all reduce ave c_2[*]
|
||||
thermo_style custom step temp press c_3[*]
|
||||
|
||||
fix 10 all ave/histo 10 10 100 -1 1 20 c_2\ **3** mode vector file tmp.histo
|
||||
fix 10 all ave/histo 10 10 100 -1 1 20 c_2[3] mode vector file tmp.histo
|
||||
|
||||
The :doc:`dump local <dump>` command will output the energy, angle,
|
||||
cosine(angle), cosine\^2(angle) for every angle in the system. The
|
||||
|
||||
@ -134,12 +134,12 @@ output the statistics in various ways:
|
||||
|
||||
compute 1 all property/local batom1 batom2 btype
|
||||
compute 2 all bond/local engpot dist v_dsq set dist d
|
||||
dump 1 all local 100 tmp.dump c_1**\*** c_2**\***
|
||||
dump 1 all local 100 tmp.dump c_1[*] c_2[*]
|
||||
|
||||
compute 3 all reduce ave c_2**\***
|
||||
thermo_style custom step temp press c_3**\***
|
||||
compute 3 all reduce ave c_2[*]
|
||||
thermo_style custom step temp press c_3[*]
|
||||
|
||||
fix 10 all ave/histo 10 10 100 0 6 20 c_2\ **3** mode vector file tmp.histo
|
||||
fix 10 all ave/histo 10 10 100 0 6 20 c_2[3] mode vector file tmp.histo
|
||||
|
||||
The :doc:`dump local <dump>` command will output the energy, distance,
|
||||
distance\^2 for every bond in the system. The
|
||||
|
||||
@ -32,7 +32,7 @@ Examples
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
compute 1 all chunk/spread/atom mychunk c_com**\*** c_gyration
|
||||
compute 1 all chunk/spread/atom mychunk c_com[*] c_gyration
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
@ -109,7 +109,7 @@ with 3 columns:
|
||||
.. parsed-literal::
|
||||
|
||||
compute com all com/chunk mychunk
|
||||
compute 10 all chunk/spread/atom mychunk c_com[\*]
|
||||
compute 10 all chunk/spread/atom mychunk c_com[*]
|
||||
compute 10 all chunk/spread/atom mychunk c_com[1] c_com[2] c_com[3]
|
||||
|
||||
|
||||
@ -125,8 +125,8 @@ to the bench/in.chain script.
|
||||
|
||||
compute cmol all chunk/atom molecule
|
||||
compute com all com/chunk cmol
|
||||
compute comchunk all chunk/spread/atom cmol c_com**\***
|
||||
dump 1 all custom 50 tmp.dump id mol type x y z c_comchunk**\***
|
||||
compute comchunk all chunk/spread/atom cmol c_com[*]
|
||||
dump 1 all custom 50 tmp.dump id mol type x y z c_comchunk[*]
|
||||
dump_modify 1 sort id
|
||||
|
||||
The same per-chunk data for each atom could be used to define per-atom
|
||||
|
||||
@ -79,12 +79,12 @@ the system and output the statistics in various ways:
|
||||
|
||||
compute 1 all property/local datom1 datom2 datom3 datom4 dtype
|
||||
compute 2 all dihedral/local phi v_cos v_cossq set phi p
|
||||
dump 1 all local 100 tmp.dump c_1**\*** c_2**\***
|
||||
dump 1 all local 100 tmp.dump c_1[*] c_2[*]
|
||||
|
||||
compute 3 all reduce ave c_2**\***
|
||||
thermo_style custom step temp press c_3**\***
|
||||
compute 3 all reduce ave c_2[*]
|
||||
thermo_style custom step temp press c_3[*]
|
||||
|
||||
fix 10 all ave/histo 10 10 100 -1 1 20 c_2\ **2** mode vector file tmp.histo
|
||||
fix 10 all ave/histo 10 10 100 -1 1 20 c_2[2] mode vector file tmp.histo
|
||||
|
||||
The :doc:`dump local <dump>` command will output the angle,
|
||||
cosine(angle), cosine\^2(angle) for every dihedral in the system. The
|
||||
|
||||
@ -94,10 +94,10 @@ something like the following commands:
|
||||
write_dump all custom tmp.dump id type x y z # see comment below
|
||||
|
||||
variable Dhop equal 0.6
|
||||
variable check atom "c_dsp\ **4** > v_Dhop"
|
||||
variable check atom "c_dsp[4] > v_Dhop"
|
||||
compute dsp all displace/atom refresh check
|
||||
dump 1 all custom 100 tmp.dump id type x y z
|
||||
dump_modify 1 append yes thresh c_dsp\ **4** > $\ *Dhop* &
|
||||
dump_modify 1 append yes thresh c_dsp[4] > ${Dhop} &
|
||||
refresh c_dsp delay 100
|
||||
|
||||
The :doc:`dump\_modify thresh <dump_modify>` command will only output
|
||||
|
||||
@ -440,7 +440,7 @@ By default, these header lines are as follows:
|
||||
In the first line, ID and name are replaced with the fix-ID and group
|
||||
name. The second line describes the two values that are printed at
|
||||
the first of each section of output. In the third line the values are
|
||||
replaced with the appropriate value names, e.g. fx or c\_myCompute\ **2**\ .
|
||||
replaced with the appropriate value names, e.g. fx or c\_myCompute[2].
|
||||
|
||||
The words in parenthesis only appear with corresponding columns if the
|
||||
chunk style specified for the :doc:`compute chunk/atom <compute_chunk_atom>` command supports them. The OrigID
|
||||
|
||||
@ -1,204 +0,0 @@
|
||||
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
||||
|
||||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Commands_all.html)
|
||||
|
||||
:line
|
||||
|
||||
Using LAMMPS with Bash on Windows :h3
|
||||
[written by Richard Berger]
|
||||
|
||||
:line
|
||||
|
||||
Starting with Windows 10 you can install Linux tools directly in Windows. This
|
||||
allows you to compile LAMMPS following the same procedure as on a real Ubuntu
|
||||
Linux installation. Software can be easily installed using the package manager
|
||||
via apt-get and all files are accessible in both the Windows Explorer and your
|
||||
Linux shell (bash). This avoids switching to a different operating system or
|
||||
installing a virtual machine. Everything runs on Windows.
|
||||
|
||||
Installing Bash on Windows :h4
|
||||
|
||||
Prerequisites :h5
|
||||
|
||||
Windows 10 (64bit only)
|
||||
Latest updates installed :ul
|
||||
|
||||
Enable developer mode :h5
|
||||
You enable this feature by first opening Windows Settings and enabling
|
||||
Developer mode. Go to the Windows settings and search for "developer". This
|
||||
will allow you to install software which comes from outside of the Windows
|
||||
Store. You might be prompted to reboot your compute. Please do so.
|
||||
|
||||
:image(JPG/bow_tutorial_01_small.png,JPG/bow_tutorial_01.png)
|
||||
:image(JPG/bow_tutorial_02_small.png,JPG/bow_tutorial_02.png)
|
||||
:image(JPG/bow_tutorial_03_small.png,JPG/bow_tutorial_03.png)
|
||||
|
||||
Install Windows Subsystem for Linux :h5
|
||||
|
||||
Next you must ensure that the Window Subsystem for Linux is installed. Again,
|
||||
search for "enable windows features" in the Settings dialog. This opens a
|
||||
dialog with a list of features you can install. Add a checkmark to Windows
|
||||
Subsystem for Linux (Beta) and press OK.
|
||||
|
||||
:image(JPG/bow_tutorial_04_small.png,JPG/bow_tutorial_04.png)
|
||||
:image(JPG/bow_tutorial_05.png,JPG/bow_tutorial_05.png)
|
||||
|
||||
Install Bash for Windows :h5
|
||||
|
||||
After installation completes, type "bash" in the Windows Start menu search.
|
||||
Select the first found option. This will launch a command-line window which
|
||||
will prompt you about installing Ubuntu on Windows. Confirm with "y" and press
|
||||
enter. This will then download Ubuntu for Windows.
|
||||
|
||||
:image(JPG/bow_tutorial_06.png)
|
||||
:image(JPG/bow_tutorial_07.png)
|
||||
|
||||
During installation, you will be asked for a new password. This will be used
|
||||
for installing new software and running commands with sudo.
|
||||
|
||||
:image(JPG/bow_tutorial_08.png)
|
||||
|
||||
Type exit to close the command-line window.
|
||||
|
||||
Go to the Start menu and type "bash" again. This time you will see a "Bash on
|
||||
Ubuntu on Windows" Icon. Start this program.
|
||||
|
||||
:image(JPG/bow_tutorial_09.png)
|
||||
|
||||
Congratulations, you have installed [Bash on Ubuntu on Windows].
|
||||
|
||||
:image(JPG/bow_tutorial_10.png)
|
||||
|
||||
:line
|
||||
|
||||
Compiling LAMMPS in Bash on Windows :h4
|
||||
|
||||
The installation of LAMMPS in this environment is identical to working inside
|
||||
of a real Ubuntu Linux installation. At the time writing, it uses Ubuntu 16.04.
|
||||
|
||||
Installing prerequisite packages :h5
|
||||
|
||||
First upgrade all existing packages using
|
||||
|
||||
sudo apt update
|
||||
sudo apt upgrade -y :pre
|
||||
|
||||
Next install the following packages, which include compilers and libraries
|
||||
needed for various LAMMPS features:
|
||||
|
||||
sudo apt install -y build-essential ccache gfortran openmpi-bin libopenmpi-dev libfftw3-dev libjpeg-dev libpng12-dev python-dev python-virtualenv libblas-dev liblapack-dev libhdf5-serial-dev hdf5-tools :pre
|
||||
|
||||
Files in Ubuntu on Windows :h5
|
||||
|
||||
When you launch "Bash on Ubuntu on Windows" you will start out in your Linux
|
||||
user home directory /home/[username]. You can access your Windows user directory
|
||||
using the /mnt/c/Users/[username] folder.
|
||||
|
||||
|
||||
Download LAMMPS :h5
|
||||
|
||||
Obtain a copy of the LAMMPS code and go into it using "cd"
|
||||
|
||||
Option 1: Downloading LAMMPS tarball using wget :h6
|
||||
|
||||
wget http://lammps.sandia.gov/tars/lammps-stable.tar.gz
|
||||
tar xvzf lammps-stable.tar.gz
|
||||
cd lammps-31Mar17 :pre
|
||||
|
||||
Option 2: Obtaining LAMMPS code from GitHub :h6
|
||||
|
||||
git clone https://github.com/lammps/lammps.git
|
||||
cd lammps :pre
|
||||
|
||||
Compiling LAMMPS :h5
|
||||
|
||||
At this point you can compile LAMMPS like on Ubuntu Linux.
|
||||
|
||||
Compiling serial version :h6
|
||||
|
||||
cd src/
|
||||
make -j 4 serial :pre
|
||||
|
||||
This will create an executable called lmp_serial in the src/ directory
|
||||
|
||||
Compiling MPI version :h6
|
||||
|
||||
cd src/
|
||||
make -j 4 mpi :pre
|
||||
|
||||
This will create an executable called lmp_mpi in the src/ directory
|
||||
|
||||
:line
|
||||
|
||||
Finally, please note the absolute path of your src folder. You can get this using
|
||||
|
||||
pwd :pre
|
||||
|
||||
or
|
||||
|
||||
echo $PWD :pre
|
||||
|
||||
To run any examples you need the location of the executable. For now, let us
|
||||
save this location in a temporary variable
|
||||
|
||||
LAMMPS_DIR=$PWD :pre
|
||||
|
||||
:line
|
||||
|
||||
Running an example script :h5
|
||||
|
||||
Once compiled you can execute some of the LAMMPS examples. Switch into the
|
||||
examples/melt folder
|
||||
|
||||
cd ../examples/melt :pre
|
||||
|
||||
The full path of the serial executable is $LAMMPS_DIR/lmp_serial, while the mpi
|
||||
version is $LAMMPS_DIR/lmp_mpi. You can run the melt example with either
|
||||
version as follows:
|
||||
|
||||
$LAMMPS_DIR/lmp_serial -in in.melt :pre
|
||||
|
||||
or
|
||||
|
||||
mpirun -np 4 $LAMMPS_DIR/lmp_mpi -in in.melt :pre
|
||||
|
||||
Note the use of our variable $LAMMPS_DIR, which expands into the full path of
|
||||
the LAMMPS src folder we saved earlier.
|
||||
|
||||
Adding your executable directory to your PATH :h6
|
||||
|
||||
You can avoid having to type the full path of your LAMMPS binary by adding its
|
||||
parent folder to the PATH environment variable as follows:
|
||||
|
||||
export PATH=$LAMMPS_DIR:$PATH :pre
|
||||
|
||||
Input scripts can then be run like this:
|
||||
|
||||
lmp_serial -in in.melt :pre
|
||||
|
||||
or
|
||||
|
||||
mpirun -np 4 lmp_mpi -in in.melt :pre
|
||||
|
||||
However, this PATH variable will not persist if you close your bash window.
|
||||
To persist this setting edit the $HOME/.bashrc file using your favorite editor
|
||||
and add this line
|
||||
|
||||
export PATH=/full/path/to/your/lammps/src:$PATH :pre
|
||||
|
||||
[Example:]
|
||||
|
||||
For an executable lmp_serial with a full path
|
||||
|
||||
/home/richard/lammps/src/lmp_serial :pre
|
||||
|
||||
the PATH variable should be
|
||||
|
||||
export PATH=/home/richard/lammps/src:$PATH :pre
|
||||
|
||||
NOTE: This should give you a jump start when trying to run LAMMPS on Windows.
|
||||
To become effective in this environment I encourage you to look into Linux
|
||||
tutorials explaining Bash and Basic Unix commands (e.g., "Linux
|
||||
Journey"_https://linuxjourney.com)
|
||||
@ -1,135 +0,0 @@
|
||||
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
||||
|
||||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Commands_all.html)
|
||||
|
||||
:line
|
||||
|
||||
compute angle/local command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
compute ID group-ID angle/local value1 value2 ... keyword args ... :pre
|
||||
|
||||
ID, group-ID are documented in "compute"_compute.html command :ulb,l
|
||||
angle/local = style name of this compute command :l
|
||||
one or more values may be appended :l
|
||||
value = {theta} or {eng} or {v_name} :l
|
||||
{theta} = tabulate angles
|
||||
{eng} = tabulate angle energies
|
||||
{v_name} = equal-style variable with name (see below) :pre
|
||||
zero or more keyword/args pairs may be appended :l
|
||||
keyword = {set} :l
|
||||
{set} args = theta name
|
||||
theta = only currently allowed arg
|
||||
name = name of variable to set with theta :pre
|
||||
:ule
|
||||
|
||||
[Examples:]
|
||||
|
||||
compute 1 all angle/local theta
|
||||
compute 1 all angle/local eng theta
|
||||
compute 1 all angle/local theta v_cos set theta t :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Define a computation that calculates properties of individual angle
|
||||
interactions. The number of datums generated, aggregated across all
|
||||
processors, equals the number of angles in the system, modified by the
|
||||
group parameter as explained below.
|
||||
|
||||
The value {theta} is the angle for the 3 atoms in the interaction.
|
||||
|
||||
The value {eng} is the interaction energy for the angle.
|
||||
|
||||
The value {v_name} can be used together with the {set} keyword to
|
||||
compute a user-specified function of the angle theta. The {name}
|
||||
specified for the {v_name} value is the name of an "equal-style
|
||||
variable"_variable.html which should evaluate a formula based on a
|
||||
variable which will store the angle theta. This other variable must
|
||||
be an "internal-style variable"_variable.html defined in the input
|
||||
script; its initial numeric value can be anything. It must be an
|
||||
internal-style variable, because this command resets its value
|
||||
directly. The {set} keyword is used to identify the name of this
|
||||
other variable associated with theta.
|
||||
|
||||
Note that the value of theta for each angle which stored in the
|
||||
internal variable is in radians, not degrees.
|
||||
|
||||
As an example, these commands can be added to the bench/in.rhodo
|
||||
script to compute the cosine and cosine^2 of every angle in the system
|
||||
and output the statistics in various ways:
|
||||
|
||||
variable t internal 0.0
|
||||
variable cos equal cos(v_t)
|
||||
variable cossq equal cos(v_t)*cos(v_t) :pre
|
||||
|
||||
compute 1 all property/local aatom1 aatom2 aatom3 atype
|
||||
compute 2 all angle/local eng theta v_cos v_cossq set theta t
|
||||
dump 1 all local 100 tmp.dump c_1[*] c_2[*] :pre
|
||||
|
||||
compute 3 all reduce ave c_2[*]
|
||||
thermo_style custom step temp press c_3[*] :pre
|
||||
|
||||
fix 10 all ave/histo 10 10 100 -1 1 20 c_2[3] mode vector file tmp.histo :pre
|
||||
|
||||
The "dump local"_dump.html command will output the energy, angle,
|
||||
cosine(angle), cosine^2(angle) for every angle in the system. The
|
||||
"thermo_style"_thermo_style.html command will print the average of
|
||||
those quantities via the "compute reduce"_compute_reduce.html command
|
||||
with thermo output. And the "fix ave/histo"_fix_ave_histo.html
|
||||
command will histogram the cosine(angle) values and write them to a
|
||||
file.
|
||||
|
||||
:line
|
||||
|
||||
The local data stored by this command is generated by looping over all
|
||||
the atoms owned on a processor and their angles. An angle will only
|
||||
be included if all 3 atoms in the angle are in the specified compute
|
||||
group. Any angles that have been broken (see the
|
||||
"angle_style"_angle_style.html command) by setting their angle type to
|
||||
0 are not included. Angles that have been turned off (see the "fix
|
||||
shake"_fix_shake.html or "delete_bonds"_delete_bonds.html commands) by
|
||||
setting their angle type negative are written into the file, but their
|
||||
energy will be 0.0.
|
||||
|
||||
Note that as atoms migrate from processor to processor, there will be
|
||||
no consistent ordering of the entries within the local vector or array
|
||||
from one timestep to the next. The only consistency that is
|
||||
guaranteed is that the ordering on a particular timestep will be the
|
||||
same for local vectors or arrays generated by other compute commands.
|
||||
For example, angle output from the "compute
|
||||
property/local"_compute_property_local.html command can be combined
|
||||
with data from this command and output by the "dump local"_dump.html
|
||||
command in a consistent way.
|
||||
|
||||
Here is an example of how to do this:
|
||||
|
||||
compute 1 all property/local atype aatom1 aatom2 aatom3
|
||||
compute 2 all angle/local theta eng
|
||||
dump 1 all local 1000 tmp.dump index c_1\[1\] c_1\[2\] c_1\[3\] c_1\[4\] c_2\[1\] c_2\[2\] :pre
|
||||
|
||||
[Output info:]
|
||||
|
||||
This compute calculates a local vector or local array depending on the
|
||||
number of values. The length of the vector or number of rows in the
|
||||
array is the number of angles. If a single value is specified, a
|
||||
local vector is produced. If two or more values are specified, a
|
||||
local array is produced where the number of columns = the number of
|
||||
values. The vector or array can be accessed by any command that uses
|
||||
local values from a compute as input. See the "Howto
|
||||
output"_Howto_output.html doc page for an overview of LAMMPS output
|
||||
options.
|
||||
|
||||
The output for {theta} will be in degrees. The output for {eng} will
|
||||
be in energy "units"_units.html.
|
||||
|
||||
[Restrictions:] none
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"dump local"_dump.html, "compute
|
||||
property/local"_compute_property_local.html
|
||||
|
||||
[Default:] none
|
||||
@ -1,187 +0,0 @@
|
||||
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
||||
|
||||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Commands_all.html)
|
||||
|
||||
:line
|
||||
|
||||
compute bond/local command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
compute ID group-ID bond/local value1 value2 ... keyword args ... :pre
|
||||
|
||||
ID, group-ID are documented in "compute"_compute.html command :ulb,l
|
||||
bond/local = style name of this compute command :l
|
||||
one or more values may be appended :l
|
||||
value = {dist} or {engpot} or {force} or {fx} or {fy} or {fz} or {engvib} or {engrot} or {engtrans} or {omega} or {velvib} or {v_name} :l
|
||||
{dist} = bond distance
|
||||
{engpot} = bond potential energy
|
||||
{force} = bond force :pre
|
||||
{fx},{fy},{fz} = components of bond force
|
||||
{engvib} = bond kinetic energy of vibration
|
||||
{engrot} = bond kinetic energy of rotation
|
||||
{engtrans} = bond kinetic energy of translation
|
||||
{omega} = magnitude of bond angular velocity
|
||||
{velvib} = vibrational velocity along the bond length
|
||||
{v_name} = equal-style variable with name (see below) :pre
|
||||
zero or more keyword/args pairs may be appended :l
|
||||
keyword = {set} :l
|
||||
{set} args = dist name
|
||||
dist = only currently allowed arg
|
||||
name = name of variable to set with distance (dist) :pre
|
||||
:ule
|
||||
|
||||
:ule
|
||||
|
||||
[Examples:]
|
||||
|
||||
compute 1 all bond/local engpot
|
||||
compute 1 all bond/local dist engpot force :pre
|
||||
compute 1 all bond/local dist fx fy fz :pre
|
||||
compute 1 all angle/local dist v_distsq set dist d :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Define a computation that calculates properties of individual bond
|
||||
interactions. The number of datums generated, aggregated across all
|
||||
processors, equals the number of bonds in the system, modified by the
|
||||
group parameter as explained below.
|
||||
|
||||
All these properties are computed for the pair of atoms in a bond,
|
||||
whether the 2 atoms represent a simple diatomic molecule, or are part
|
||||
of some larger molecule.
|
||||
|
||||
The value {dist} is the current length of the bond.
|
||||
|
||||
The value {engpot} is the potential energy for the bond,
|
||||
based on the current separation of the pair of atoms in the bond.
|
||||
|
||||
The value {force} is the magnitude of the force acting between the
|
||||
pair of atoms in the bond.
|
||||
|
||||
The values {fx}, {fy}, and {fz} are the xyz components of
|
||||
{force} between the pair of atoms in the bond.
|
||||
|
||||
The remaining properties are all computed for motion of the two atoms
|
||||
relative to the center of mass (COM) velocity of the 2 atoms in the
|
||||
bond.
|
||||
|
||||
The value {engvib} is the vibrational kinetic energy of the two atoms
|
||||
in the bond, which is simply 1/2 m1 v1^2 + 1/2 m2 v2^2, where v1 and
|
||||
v2 are the magnitude of the velocity of the 2 atoms along the bond
|
||||
direction, after the COM velocity has been subtracted from each.
|
||||
|
||||
The value {engrot} is the rotational kinetic energy of the two atoms
|
||||
in the bond, which is simply 1/2 m1 v1^2 + 1/2 m2 v2^2, where v1 and
|
||||
v2 are the magnitude of the velocity of the 2 atoms perpendicular to
|
||||
the bond direction, after the COM velocity has been subtracted from
|
||||
each.
|
||||
|
||||
The value {engtrans} is the translational kinetic energy associated
|
||||
with the motion of the COM of the system itself, namely 1/2 (m1+m2)
|
||||
Vcm^2 where Vcm = magnitude of the velocity of the COM.
|
||||
|
||||
Note that these 3 kinetic energy terms are simply a partitioning of
|
||||
the summed kinetic energy of the 2 atoms themselves. I.e. total KE =
|
||||
1/2 m1 v1^2 + 1/2 m2 v2^2 = engvib + engrot + engtrans, where v1,v2
|
||||
are the magnitude of the velocities of the 2 atoms, without any
|
||||
adjustment for the COM velocity.
|
||||
|
||||
The value {omega} is the magnitude of the angular velocity of the
|
||||
two atoms around their COM position.
|
||||
|
||||
The value {velvib} is the magnitude of the relative velocity of the
|
||||
two atoms in the bond towards each other. A negative value means the
|
||||
2 atoms are moving toward each other; a positive value means they are
|
||||
moving apart.
|
||||
|
||||
The value {v_name} can be used together with the {set} keyword to
|
||||
compute a user-specified function of the bond distance. The {name}
|
||||
specified for the {v_name} value is the name of an "equal-style
|
||||
variable"_variable.html which should evaluate a formula based on a
|
||||
variable which will store the bond distance. This other variable must
|
||||
be an "internal-style variable"_variable.html defined in the input
|
||||
script; its initial numeric value can be anything. It must be an
|
||||
internal-style variable, because this command resets its value
|
||||
directly. The {set} keyword is used to identify the name of this
|
||||
other variable associated with theta.
|
||||
|
||||
As an example, these commands can be added to the bench/in.rhodo
|
||||
script to compute the distance^2 of every bond in the system and
|
||||
output the statistics in various ways:
|
||||
|
||||
variable d internal 0.0
|
||||
variable dsq equal v_d*v_d :pre
|
||||
|
||||
compute 1 all property/local batom1 batom2 btype
|
||||
compute 2 all bond/local engpot dist v_dsq set dist d
|
||||
dump 1 all local 100 tmp.dump c_1[*] c_2[*] :pre
|
||||
|
||||
compute 3 all reduce ave c_2[*]
|
||||
thermo_style custom step temp press c_3[*] :pre
|
||||
|
||||
fix 10 all ave/histo 10 10 100 0 6 20 c_2[3] mode vector file tmp.histo :pre
|
||||
|
||||
The "dump local"_dump.html command will output the energy, distance,
|
||||
distance^2 for every bond in the system. The
|
||||
"thermo_style"_thermo_style.html command will print the average of
|
||||
those quantities via the "compute reduce"_compute_reduce.html command
|
||||
with thermo output. And the "fix ave/histo"_fix_ave_histo.html
|
||||
command will histogram the distance^2 values and write them to a file.
|
||||
|
||||
:line
|
||||
|
||||
The local data stored by this command is generated by looping over all
|
||||
the atoms owned on a processor and their bonds. A bond will only be
|
||||
included if both atoms in the bond are in the specified compute group.
|
||||
Any bonds that have been broken (see the "bond_style"_bond_style.html
|
||||
command) by setting their bond type to 0 are not included. Bonds that
|
||||
have been turned off (see the "fix shake"_fix_shake.html or
|
||||
"delete_bonds"_delete_bonds.html commands) by setting their bond type
|
||||
negative are written into the file, but their energy will be 0.0.
|
||||
|
||||
Note that as atoms migrate from processor to processor, there will be
|
||||
no consistent ordering of the entries within the local vector or array
|
||||
from one timestep to the next. The only consistency that is
|
||||
guaranteed is that the ordering on a particular timestep will be the
|
||||
same for local vectors or arrays generated by other compute commands.
|
||||
For example, bond output from the "compute
|
||||
property/local"_compute_property_local.html command can be combined
|
||||
with data from this command and output by the "dump local"_dump.html
|
||||
command in a consistent way.
|
||||
|
||||
Here is an example of how to do this:
|
||||
|
||||
compute 1 all property/local btype batom1 batom2
|
||||
compute 2 all bond/local dist engpot
|
||||
dump 1 all local 1000 tmp.dump index c_1\[*\] c_2\[*\] :pre
|
||||
|
||||
[Output info:]
|
||||
|
||||
This compute calculates a local vector or local array depending on the
|
||||
number of values. The length of the vector or number of rows in the
|
||||
array is the number of bonds. If a single value is specified, a local
|
||||
vector is produced. If two or more values are specified, a local
|
||||
array is produced where the number of columns = the number of values.
|
||||
The vector or array can be accessed by any command that uses local
|
||||
values from a compute as input. See the "Howto
|
||||
output"_Howto_output.html doc page for an overview of LAMMPS output
|
||||
options.
|
||||
|
||||
The output for {dist} will be in distance "units"_units.html. The
|
||||
output for {velvib} will be in velocity "units"_units.html. The output
|
||||
for {omega} will be in velocity/distance "units"_units.html. The
|
||||
output for {engtrans}, {engvib}, {engrot}, and {engpot} will be in
|
||||
energy "units"_units.html. The output for {force} will be in force
|
||||
"units"_units.html.
|
||||
|
||||
[Restrictions:] none
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"dump local"_dump.html, "compute
|
||||
property/local"_compute_property_local.html
|
||||
|
||||
[Default:] none
|
||||
@ -1,203 +0,0 @@
|
||||
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
||||
|
||||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Commands_all.html)
|
||||
|
||||
:line
|
||||
|
||||
compute chunk/spread/atom command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
compute ID group-ID chunk/spread/atom chunkID input1 input2 ... :pre
|
||||
|
||||
ID, group-ID are documented in "compute"_compute.html command :ulb,l
|
||||
chunk/spread/atom = style name of this compute command :l
|
||||
chunkID = ID of "compute chunk/atom"_compute_chunk_atom.html command :l
|
||||
one or more inputs can be listed :l
|
||||
input = c_ID, c_ID\[N\], f_ID, f_ID\[N\] :l
|
||||
c_ID = global vector calculated by a compute with ID
|
||||
c_ID\[I\] = Ith column of global array calculated by a compute with ID, I can include wildcard (see below)
|
||||
f_ID = global vector calculated by a fix with ID
|
||||
f_ID\[I\] = Ith column of global array calculated by a fix with ID, I can include wildcard (see below) :pre
|
||||
:ule
|
||||
|
||||
[Examples:]
|
||||
|
||||
compute 1 all chunk/spread/atom mychunk c_com[*] c_gyration :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Define a calculation that "spreads" one or more per-chunk values to
|
||||
each atom in the chunk. This can be useful in several scenarios:
|
||||
|
||||
For creating a "dump file"_dump.html where each atom lists info about
|
||||
the chunk it is in, e.g. for post-processing purposes. :ulb,l
|
||||
|
||||
To access chunk value in "atom-style variables"_variable.html that
|
||||
need info about the chunk each atom is in. :l
|
||||
|
||||
To use the "fix ave/chunk"_fix_ave_chunk.html command to spatially
|
||||
average per-chunk values calculated by a per-chunk compute. :l,ule
|
||||
|
||||
Examples are given below.
|
||||
|
||||
In LAMMPS, chunks are collections of atoms defined by a "compute
|
||||
chunk/atom"_compute_chunk_atom.html command, which assigns each atom
|
||||
to a single chunk (or no chunk). The ID for this command is specified
|
||||
as chunkID. For example, a single chunk could be the atoms in a
|
||||
molecule or atoms in a spatial bin. See the "compute
|
||||
chunk/atom"_compute_chunk_atom.html and "Howto chunk"_Howto_chunk.html
|
||||
doc pages for details of how chunks can be defined and examples of how
|
||||
they can be used to measure properties of a system.
|
||||
|
||||
For inputs that are computes, they must be a compute that calculates
|
||||
per-chunk values. These are computes whose style names end in
|
||||
"/chunk".
|
||||
|
||||
For inputs that are fixes, they should be a fix that calculates
|
||||
per-chunk values. For example, "fix ave/chunk"_fix_ave_chunk.html or
|
||||
"fix ave/time"_fix_ave_time.html (assuming it is time-averaging
|
||||
per-chunk data).
|
||||
|
||||
For each atom, this compute accesses its chunk ID from the specified
|
||||
{chunkID} compute, then accesses the per-chunk value in each input.
|
||||
Those values are copied to this compute to become the output for that
|
||||
atom.
|
||||
|
||||
The values generated by this compute will be 0.0 for atoms not in the
|
||||
specified compute group {group-ID}. They will also be 0.0 if the atom
|
||||
is not in a chunk, as assigned by the {chunkID} compute. They will
|
||||
also be 0.0 if the current chunk ID for the atom is out-of-bounds with
|
||||
respect to the number of chunks stored by a particular input compute
|
||||
or fix.
|
||||
|
||||
NOTE: LAMMPS does not check that a compute or fix which calculates
|
||||
per-chunk values uses the same definition of chunks as this compute.
|
||||
It's up to you to be consistent. Likewise, for a fix input, LAMMPS
|
||||
does not check that it is per-chunk data. It only checks that the fix
|
||||
produces a global vector or array.
|
||||
|
||||
:line
|
||||
|
||||
Each listed input is operated on independently.
|
||||
|
||||
If a bracketed index I is used, it can be specified using a wildcard
|
||||
asterisk with the index to effectively specify multiple values. This
|
||||
takes the form "*" or "*n" or "n*" or "m*n". If N = the number of
|
||||
columns in the array, then an asterisk with no numeric values means
|
||||
all indices from 1 to N. A leading asterisk means all indices from 1
|
||||
to n (inclusive). A trailing asterisk means all indices from n to N
|
||||
(inclusive). A middle asterisk means all indices from m to n
|
||||
(inclusive).
|
||||
|
||||
Using a wildcard is the same as if the individual columns of the array
|
||||
had been listed one by one. E.g. these 2 compute chunk/spread/atom
|
||||
commands are equivalent, since the "compute
|
||||
com/chunk"_compute_com_chunk.html command creates a per-atom array
|
||||
with 3 columns:
|
||||
|
||||
compute com all com/chunk mychunk
|
||||
compute 10 all chunk/spread/atom mychunk c_com\[*\]
|
||||
compute 10 all chunk/spread/atom mychunk c_com\[1\] c_com\[2\] c_com\[3\] :pre
|
||||
|
||||
:line
|
||||
|
||||
Here is an example of writing a dump file the with the center-of-mass
|
||||
(COM) for the chunk each atom is in. The commands below can be added
|
||||
to the bench/in.chain script.
|
||||
|
||||
compute cmol all chunk/atom molecule
|
||||
compute com all com/chunk cmol
|
||||
compute comchunk all chunk/spread/atom cmol c_com[*]
|
||||
dump 1 all custom 50 tmp.dump id mol type x y z c_comchunk[*]
|
||||
dump_modify 1 sort id :pre
|
||||
|
||||
The same per-chunk data for each atom could be used to define per-atom
|
||||
forces for the "fix addforce"_fix_addforce.html command. In this
|
||||
example the forces act to pull atoms of an extended polymer chain
|
||||
towards its COM in an attractive manner.
|
||||
|
||||
compute prop all property/atom xu yu zu
|
||||
variable k equal 0.1
|
||||
variable fx atom v_k*(c_comchunk\[1\]-c_prop\[1\])
|
||||
variable fy atom v_k*(c_comchunk\[2\]-c_prop\[2\])
|
||||
variable fz atom v_k*(c_comchunk\[3\]-c_prop\[3\])
|
||||
fix 3 all addforce v_fx v_fy v_fz :pre
|
||||
|
||||
Note that "compute property/atom"_compute_property_atom.html is used
|
||||
to generate unwrapped coordinates for use in the per-atom force
|
||||
calculation, so that the effect of periodic boundaries is accounted
|
||||
for properly.
|
||||
|
||||
Over time this applied force could shrink each polymer chain's radius
|
||||
of gyration in a polymer mixture simulation. Here is output from the
|
||||
bench/in.chain script. Thermo output is shown for 1000 steps, where
|
||||
the last column is the average radius of gyration over all 320 chains
|
||||
in the 32000 atom system:
|
||||
|
||||
compute gyr all gyration/chunk cmol
|
||||
variable ave equal ave(c_gyr)
|
||||
thermo_style custom step etotal press v_ave :pre
|
||||
|
||||
0 22.394765 4.6721833 5.128278
|
||||
100 22.445002 4.8166709 5.0348372
|
||||
200 22.500128 4.8790392 4.9364875
|
||||
300 22.534686 4.9183766 4.8590693
|
||||
400 22.557196 4.9492211 4.7937849
|
||||
500 22.571017 4.9161853 4.7412008
|
||||
600 22.573944 5.0229708 4.6931243
|
||||
700 22.581804 5.0541301 4.6440647
|
||||
800 22.584683 4.9691734 4.6000016
|
||||
900 22.59128 5.0247538 4.5611513
|
||||
1000 22.586832 4.94697 4.5238362 :pre
|
||||
|
||||
:line
|
||||
|
||||
Here is an example for using one set of chunks, defined for molecules,
|
||||
to compute the dipole moment vector for each chunk. E.g. for water
|
||||
molecules. Then spreading those values to each atom in each chunk.
|
||||
Then defining a second set of chunks based on spatial bins. And
|
||||
finally, using the "fix ave/chunk"_fix_ave_chunk.html command to
|
||||
calculate an average dipole moment vector per spatial bin.
|
||||
|
||||
compute cmol all chunk/atom molecule
|
||||
compute dipole all dipole/chunk cmol
|
||||
compute spread all chunk/spread/atom cmol c_dipole\[1\] c_dipole\[2\] c_dipole\[3\]
|
||||
compute cspatial all chunk/atom bin/1d z lower 0.1 units reduced
|
||||
fix ave all ave/chunk 100 10 1000 cspatial c_spread\[*\] :pre
|
||||
|
||||
Note that the "fix ave/chunk"_fix_ave_chunk.html command requires
|
||||
per-atom values as input. That is why the compute chunk/spread/atom
|
||||
command is used to assign per-chunk values to each atom in the chunk.
|
||||
If a molecule straddles bin boundaries, each of its atoms contributes
|
||||
in a weighted manner to the average dipole moment of the spatial bin
|
||||
it is in.
|
||||
|
||||
:line
|
||||
|
||||
[Output info:]
|
||||
|
||||
This compute calculates a per-atom vector or array, which can be
|
||||
accessed by any command that uses per-atom values from a compute as
|
||||
input. See the "Howto output"_Howto_output.html doc page for an
|
||||
overview of LAMMPS output options.
|
||||
|
||||
The output is a per-atom vector if a single input value is specified,
|
||||
otherwise a per-atom array is output. The number of columns in the
|
||||
array is the number of inputs provided. The per-atom values for the
|
||||
vector or each column of the array will be in whatever
|
||||
"units"_units.html the corresponding input value is in.
|
||||
|
||||
The vector or array values are "intensive".
|
||||
|
||||
[Restrictions:] none
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"compute chunk/atom"_compute_chunk_atom.html, "fix
|
||||
ave/chunk"_fix_ave_chunk.html, "compute
|
||||
reduce/chunk"_compute_reduce_chunk.html
|
||||
|
||||
[Default:] none
|
||||
@ -1,126 +0,0 @@
|
||||
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
||||
|
||||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Commands_all.html)
|
||||
|
||||
:line
|
||||
|
||||
compute dihedral/local command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
compute ID group-ID dihedral/local value1 value2 ... keyword args ... :pre
|
||||
|
||||
ID, group-ID are documented in "compute"_compute.html command :ulb,l
|
||||
dihedral/local = style name of this compute command :l
|
||||
one or more values may be appended :l
|
||||
value = {phi} or {v_name} :l
|
||||
{phi} = tabulate dihedral angles
|
||||
{v_name} = equal-style variable with name (see below) :pre
|
||||
zero or more keyword/args pairs may be appended :l
|
||||
keyword = {set} :l
|
||||
{set} args = phi name
|
||||
phi = only currently allowed arg
|
||||
name = name of variable to set with phi :pre
|
||||
:ule
|
||||
|
||||
[Examples:]
|
||||
|
||||
compute 1 all dihedral/local phi :pre
|
||||
compute 1 all dihedral/local phi v_cos set phi p :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Define a computation that calculates properties of individual dihedral
|
||||
interactions. The number of datums generated, aggregated across all
|
||||
processors, equals the number of dihedral angles in the system, modified
|
||||
by the group parameter as explained below.
|
||||
|
||||
The value {phi} is the dihedral angle, as defined in the diagram on
|
||||
the "dihedral_style"_dihedral_style.html doc page.
|
||||
|
||||
The value {v_name} can be used together with the {set} keyword to
|
||||
compute a user-specified function of the dihedral angle phi. The
|
||||
{name} specified for the {v_name} value is the name of an "equal-style
|
||||
variable"_variable.html which should evaluate a formula based on a
|
||||
variable which will store the angle phi. This other variable must
|
||||
be an "internal-style variable"_variable.html defined in the input
|
||||
script; its initial numeric value can be anything. It must be an
|
||||
internal-style variable, because this command resets its value
|
||||
directly. The {set} keyword is used to identify the name of this
|
||||
other variable associated with phi.
|
||||
|
||||
Note that the value of phi for each angle which stored in the internal
|
||||
variable is in radians, not degrees.
|
||||
|
||||
As an example, these commands can be added to the bench/in.rhodo
|
||||
script to compute the cosine and cosine^2 of every dihedral angle in
|
||||
the system and output the statistics in various ways:
|
||||
|
||||
variable p internal 0.0
|
||||
variable cos equal cos(v_p)
|
||||
variable cossq equal cos(v_p)*cos(v_p) :pre
|
||||
|
||||
compute 1 all property/local datom1 datom2 datom3 datom4 dtype
|
||||
compute 2 all dihedral/local phi v_cos v_cossq set phi p
|
||||
dump 1 all local 100 tmp.dump c_1[*] c_2[*] :pre
|
||||
|
||||
compute 3 all reduce ave c_2[*]
|
||||
thermo_style custom step temp press c_3[*] :pre
|
||||
|
||||
fix 10 all ave/histo 10 10 100 -1 1 20 c_2[2] mode vector file tmp.histo :pre
|
||||
|
||||
The "dump local"_dump.html command will output the angle,
|
||||
cosine(angle), cosine^2(angle) for every dihedral in the system. The
|
||||
"thermo_style"_thermo_style.html command will print the average of
|
||||
those quantities via the "compute reduce"_compute_reduce.html command
|
||||
with thermo output. And the "fix ave/histo"_fix_ave_histo.html
|
||||
command will histogram the cosine(angle) values and write them to a
|
||||
file.
|
||||
|
||||
:line
|
||||
|
||||
The local data stored by this command is generated by looping over all
|
||||
the atoms owned on a processor and their dihedrals. A dihedral will
|
||||
only be included if all 4 atoms in the dihedral are in the specified
|
||||
compute group.
|
||||
|
||||
Note that as atoms migrate from processor to processor, there will be
|
||||
no consistent ordering of the entries within the local vector or array
|
||||
from one timestep to the next. The only consistency that is
|
||||
guaranteed is that the ordering on a particular timestep will be the
|
||||
same for local vectors or arrays generated by other compute commands.
|
||||
For example, dihedral output from the "compute
|
||||
property/local"_compute_property_local.html command can be combined
|
||||
with data from this command and output by the "dump local"_dump.html
|
||||
command in a consistent way.
|
||||
|
||||
Here is an example of how to do this:
|
||||
|
||||
compute 1 all property/local dtype datom1 datom2 datom3 datom4
|
||||
compute 2 all dihedral/local phi
|
||||
dump 1 all local 1000 tmp.dump index c_1\[1\] c_1\[2\] c_1\[3\] c_1\[4\] c_1\[5\] c_2\[1\] :pre
|
||||
|
||||
[Output info:]
|
||||
|
||||
This compute calculates a local vector or local array depending on the
|
||||
number of values. The length of the vector or number of rows in the
|
||||
array is the number of dihedrals. If a single value is specified, a
|
||||
local vector is produced. If two or more values are specified, a
|
||||
local array is produced where the number of columns = the number of
|
||||
values. The vector or array can be accessed by any command that uses
|
||||
local values from a compute as input. See the "Howto
|
||||
output"_Howto_output.html doc page for an overview of LAMMPS output
|
||||
options.
|
||||
|
||||
The output for {phi} will be in degrees.
|
||||
|
||||
[Restrictions:] none
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"dump local"_dump.html, "compute
|
||||
property/local"_compute_property_local.html
|
||||
|
||||
[Default:] none
|
||||
@ -1,137 +0,0 @@
|
||||
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
||||
|
||||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Commands_all.html)
|
||||
|
||||
:line
|
||||
|
||||
compute displace/atom command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
compute ID group-ID displace/atom :pre
|
||||
|
||||
ID, group-ID are documented in "compute"_compute.html command :ulb,l
|
||||
displace/atom = style name of this compute command :l
|
||||
zero or more keyword/arg pairs may be appended :l
|
||||
keyword = {refresh} :l
|
||||
{replace} arg = name of per-atom variable :pre
|
||||
|
||||
:ule
|
||||
|
||||
[Examples:]
|
||||
|
||||
compute 1 all displace/atom
|
||||
compute 1 all displace/atom refresh myVar :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Define a computation that calculates the current displacement of each
|
||||
atom in the group from its original (reference) coordinates, including
|
||||
all effects due to atoms passing through periodic boundaries.
|
||||
|
||||
A vector of four quantities per atom is calculated by this compute.
|
||||
The first 3 elements of the vector are the dx,dy,dz displacements.
|
||||
The 4th component is the total displacement, i.e. sqrt(dx*dx + dy*dy +
|
||||
dz*dz).
|
||||
|
||||
The displacement of an atom is from its original position at the time
|
||||
the compute command was issued. The value of the displacement will be
|
||||
0.0 for atoms not in the specified compute group.
|
||||
|
||||
NOTE: Initial coordinates are stored in "unwrapped" form, by using the
|
||||
image flags associated with each atom. See the "dump
|
||||
custom"_dump.html command for a discussion of "unwrapped" coordinates.
|
||||
See the Atoms section of the "read_data"_read_data.html command for a
|
||||
discussion of image flags and how they are set for each atom. You can
|
||||
reset the image flags (e.g. to 0) before invoking this compute by
|
||||
using the "set image"_set.html command.
|
||||
|
||||
NOTE: If you want the quantities calculated by this compute to be
|
||||
continuous when running from a "restart file"_read_restart.html, then
|
||||
you should use the same ID for this compute, as in the original run.
|
||||
This is so that the fix this compute creates to store per-atom
|
||||
quantities will also have the same ID, and thus be initialized
|
||||
correctly with time=0 atom coordinates from the restart file.
|
||||
|
||||
:line
|
||||
|
||||
The {refresh} option can be used in conjunction with the "dump_modify
|
||||
refresh" command to generate incremental dump files.
|
||||
|
||||
The definition and motivation of an incremental dump file is as
|
||||
follows. Instead of outputting all atoms at each snapshot (with some
|
||||
associated values), you may only wish to output the subset of atoms
|
||||
with a value that has changed in some way compared to the value the
|
||||
last time that atom was output. In some scenarios this can result in
|
||||
a dramatically smaller dump file. If desired, by post-processing the
|
||||
sequence of snapshots, the values for all atoms at all timesteps can
|
||||
be inferred.
|
||||
|
||||
A concrete example using this compute, is a simulation of atom
|
||||
diffusion in a solid, represented as atoms on a lattice. Diffusive
|
||||
hops are rare. Imagine that when a hop occurs an atom moves more than
|
||||
a distance {Dhop}. For any snapshot we only want to output atoms that
|
||||
have hopped since the last snapshot. This can be accomplished with
|
||||
something like the following commands:
|
||||
|
||||
write_dump all custom tmp.dump id type x y z # see comment below :pre
|
||||
|
||||
variable Dhop equal 0.6
|
||||
variable check atom "c_dsp[4] > v_Dhop"
|
||||
compute dsp all displace/atom refresh check
|
||||
dump 1 all custom 100 tmp.dump id type x y z
|
||||
dump_modify 1 append yes thresh c_dsp[4] > ${Dhop} &
|
||||
refresh c_dsp delay 100 :pre
|
||||
|
||||
The "dump_modify thresh"_dump_modify.html command will only output
|
||||
atoms that have displaced more than 0.6 Angstroms on each snapshot
|
||||
(assuming metal units). The dump_modify {refresh} option triggers a
|
||||
call to this compute at the end of every dump.
|
||||
|
||||
The {refresh} argument for this compute is the ID of an "atom-style
|
||||
variable"_variable.html which calculates a Boolean value (0 or 1)
|
||||
based on the same criterion used by dump_modify thresh. This compute
|
||||
evaluates the atom-style variable. For each atom that returns 1
|
||||
(true), the original (reference) coordinates of the atom (stored by
|
||||
this compute) are updated.
|
||||
|
||||
The effect of these commands is that a particular atom will only be
|
||||
output in the dump file on the snapshot after it makes a diffusive
|
||||
hop. It will not be output again until it makes another hop.
|
||||
|
||||
Note that in the first snapshot of a subsequent run, no atoms will be
|
||||
typically be output. That is because the initial displacement for all
|
||||
atoms is 0.0. If an initial dump snapshot is desired, containing the
|
||||
initial reference positions of all atoms, one way to do this is
|
||||
illustrated above. An initial write_dump command can be used before
|
||||
the first run. It will contain the positions of all the atoms,
|
||||
Options in the "dump_modify"_dump_modify.html command above will
|
||||
append new output to that same file and delay the output until a later
|
||||
timestep. The {delay} setting avoids a second time = 0 snapshot which
|
||||
would be empty.
|
||||
|
||||
:line
|
||||
|
||||
[Output info:]
|
||||
|
||||
This compute calculates a per-atom array with 4 columns, which can be
|
||||
accessed by indices 1-4 by any command that uses per-atom values from
|
||||
a compute as input. See the "Howto output"_Howto_output.html doc page
|
||||
for an overview of LAMMPS output options.
|
||||
|
||||
The per-atom array values will be in distance "units"_units.html.
|
||||
|
||||
This compute supports the {refresh} option as explained above, for use
|
||||
in conjunction with "dump_modify refresh"_dump_modify.html to generate
|
||||
incremental dump files.
|
||||
|
||||
[Restrictions:] none
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"compute msd"_compute_msd.html, "dump custom"_dump.html, "fix
|
||||
store/state"_fix_store_state.html
|
||||
|
||||
[Default:] none
|
||||
@ -1,492 +0,0 @@
|
||||
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
||||
|
||||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Commands_all.html)
|
||||
|
||||
:line
|
||||
|
||||
fix ave/chunk command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
fix ID group-ID ave/chunk Nevery Nrepeat Nfreq chunkID value1 value2 ... keyword args ... :pre
|
||||
|
||||
ID, group-ID are documented in "fix"_fix.html command :ulb,l
|
||||
ave/chunk = style name of this fix command :l
|
||||
Nevery = use input values every this many timesteps :l
|
||||
Nrepeat = # of times to use input values for calculating averages :l
|
||||
Nfreq = calculate averages every this many timesteps :l
|
||||
chunkID = ID of "compute chunk/atom"_compute_chunk_atom.html command :l
|
||||
one or more input values can be listed :l
|
||||
value = vx, vy, vz, fx, fy, fz, density/mass, density/number, temp, c_ID, c_ID\[I\], f_ID, f_ID\[I\], v_name :l
|
||||
vx,vy,vz,fx,fy,fz = atom attribute (velocity, force component)
|
||||
density/number, density/mass = number or mass density
|
||||
temp = temperature
|
||||
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, I can include wildcard (see below)
|
||||
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, I can include wildcard (see below)
|
||||
v_name = per-atom vector calculated by an atom-style variable with name :pre
|
||||
|
||||
zero or more keyword/arg pairs may be appended :l
|
||||
keyword = {norm} or {ave} or {bias} or {adof} or {cdof} or {file} or {overwrite} or {title1} or {title2} or {title3} :l
|
||||
{norm} arg = {all} or {sample} or {none} = how output on {Nfreq} steps is normalized
|
||||
all = output is sum of atoms across all {Nrepeat} samples, divided by atom count
|
||||
sample = output is sum of {Nrepeat} sample averages, divided by {Nrepeat}
|
||||
none = output is sum of {Nrepeat} sample sums, divided by {Nrepeat}
|
||||
{ave} args = {one} or {running} or {window M}
|
||||
one = output new average value every Nfreq steps
|
||||
running = output cumulative average of all previous Nfreq steps
|
||||
window M = output average of M most recent Nfreq steps
|
||||
{bias} arg = bias-ID
|
||||
bias-ID = ID of a temperature compute that removes a velocity bias for temperature calculation
|
||||
{adof} value = dof_per_atom
|
||||
dof_per_atom = define this many degrees-of-freedom per atom for temperature calculation
|
||||
{cdof} value = dof_per_chunk
|
||||
dof_per_chunk = define this many degrees-of-freedom per chunk for temperature calculation
|
||||
{file} arg = filename
|
||||
filename = file to write results to
|
||||
{overwrite} arg = none = overwrite output file with only latest output
|
||||
{format} arg = string
|
||||
string = C-style format string
|
||||
{title1} arg = string
|
||||
string = text to print as 1st line of output file
|
||||
{title2} arg = string
|
||||
string = text to print as 2nd line of output file
|
||||
{title3} arg = string
|
||||
string = text to print as 3rd line of output file :pre
|
||||
:ule
|
||||
|
||||
[Examples:]
|
||||
|
||||
fix 1 all ave/chunk 10000 1 10000 binchunk c_myCentro title1 "My output values"
|
||||
fix 1 flow ave/chunk 100 10 1000 molchunk vx vz norm sample file vel.profile
|
||||
fix 1 flow ave/chunk 100 5 1000 binchunk density/mass ave running
|
||||
fix 1 flow ave/chunk 100 5 1000 binchunk density/mass ave running :pre
|
||||
|
||||
[NOTE:]
|
||||
|
||||
If you are trying to replace a deprecated fix ave/spatial command
|
||||
with the newer, more flexible fix ave/chunk and "compute
|
||||
chunk/atom"_compute_chunk_atom.html commands, you simply need to split
|
||||
the fix ave/spatial arguments across the two new commands. For
|
||||
example, this command:
|
||||
|
||||
fix 1 flow ave/spatial 100 10 1000 y 0.0 1.0 vx vz norm sample file vel.profile :pre
|
||||
|
||||
could be replaced by:
|
||||
|
||||
compute cc1 flow chunk/atom bin/1d y 0.0 1.0
|
||||
fix 1 flow ave/chunk 100 10 1000 cc1 vx vz norm sample file vel.profile :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
Use one or more per-atom vectors as inputs every few timesteps, sum
|
||||
the values over the atoms in each chunk at each timestep, then average
|
||||
the per-chunk values over longer timescales. The resulting chunk
|
||||
averages can be used by other "output commands"_Howto_output.html such
|
||||
as "thermo_style custom"_thermo_style.html, and can also be written to
|
||||
a file.
|
||||
|
||||
In LAMMPS, chunks are collections of atoms defined by a "compute
|
||||
chunk/atom"_compute_chunk_atom.html command, which assigns each atom
|
||||
to a single chunk (or no chunk). The ID for this command is specified
|
||||
as chunkID. For example, a single chunk could be the atoms in a
|
||||
molecule or atoms in a spatial bin. See the "compute
|
||||
chunk/atom"_compute_chunk_atom.html doc page and the "Howto
|
||||
chunk"_Howto_chunk.html doc page for details of how chunks can be
|
||||
defined and examples of how they can be used to measure properties of
|
||||
a system.
|
||||
|
||||
Note that only atoms in the specified group contribute to the summing
|
||||
and averaging calculations. The "compute
|
||||
chunk/atom"_compute_chunk_atom.html command defines its own group as
|
||||
well as an optional region. Atoms will have a chunk ID = 0, meaning
|
||||
they belong to no chunk, if they are not in that group or region.
|
||||
Thus you can specify the "all" group for this command if you simply
|
||||
want to use the chunk definitions provided by chunkID.
|
||||
|
||||
Each specified per-atom value can be an atom attribute (position,
|
||||
velocity, force component), a mass or number density, or the result of
|
||||
a "compute"_compute.html or "fix"_fix.html or the evaluation of an
|
||||
atom-style "variable"_variable.html. In the latter cases, the
|
||||
compute, fix, or variable must produce a per-atom quantity, not a
|
||||
global quantity. Note that the "compute
|
||||
property/atom"_compute_property_atom.html command provides access to
|
||||
any attribute defined and stored by atoms. If you wish to
|
||||
time-average global quantities from a compute, fix, or variable, then
|
||||
see the "fix ave/time"_fix_ave_time.html command.
|
||||
|
||||
The per-atom values of each input vector are summed and averaged
|
||||
independently of the per-atom values in other input vectors.
|
||||
|
||||
"Computes"_compute.html that produce per-atom quantities are those
|
||||
which have the word {atom} in their style name. See the doc pages for
|
||||
individual "fixes"_fix.html to determine which ones produce per-atom
|
||||
quantities. "Variables"_variable.html of style {atom} are the only
|
||||
ones that can be used with this fix since all other styles of variable
|
||||
produce global quantities.
|
||||
|
||||
Note that for values from a compute or fix, the bracketed index I can
|
||||
be specified using a wildcard asterisk with the index to effectively
|
||||
specify multiple values. This takes the form "*" or "*n" or "n*" or
|
||||
"m*n". If N = the size of the vector (for {mode} = scalar) or the
|
||||
number of columns in the array (for {mode} = vector), then an asterisk
|
||||
with no numeric values means all indices from 1 to N. A leading
|
||||
asterisk means all indices from 1 to n (inclusive). A trailing
|
||||
asterisk means all indices from n to N (inclusive). A middle asterisk
|
||||
means all indices from m to n (inclusive).
|
||||
|
||||
Using a wildcard is the same as if the individual columns of the array
|
||||
had been listed one by one. E.g. these 2 fix ave/chunk commands are
|
||||
equivalent, since the "compute
|
||||
property/atom"_compute_property_atom.html command creates, in this
|
||||
case, a per-atom array with 3 columns:
|
||||
|
||||
compute myAng all property/atom angmomx angmomy angmomz
|
||||
fix 1 all ave/chunk 100 1 100 cc1 c_myAng\[*\] file tmp.angmom
|
||||
fix 2 all ave/chunk 100 1 100 cc1 c_myAng\[1\] c_myAng\[2\] c_myAng\[3\] file tmp.angmom :pre
|
||||
|
||||
NOTE: This fix works by creating an array of size {Nchunk} by Nvalues
|
||||
on each processor. {Nchunk} is the number of chunks which is defined
|
||||
by the "compute chunk/atom"_compute_chunk_atom.html command.
|
||||
Nvalues is the number of input values specified. Each processor loops
|
||||
over its atoms, tallying its values to the appropriate chunk. Then
|
||||
the entire array is summed across all processors. This means that
|
||||
using a large number of chunks will incur an overhead in memory and
|
||||
computational cost (summing across processors), so be careful to
|
||||
define a reasonable number of chunks.
|
||||
|
||||
:line
|
||||
|
||||
The {Nevery}, {Nrepeat}, and {Nfreq} arguments specify on what
|
||||
timesteps the input values will be accessed and contribute to the
|
||||
average. The final averaged quantities are generated on timesteps
|
||||
that are a multiples of {Nfreq}. The average is over {Nrepeat}
|
||||
quantities, computed in the preceding portion of the simulation every
|
||||
{Nevery} timesteps. {Nfreq} must be a multiple of {Nevery} and
|
||||
{Nevery} must be non-zero even if {Nrepeat} is 1. Also, the timesteps
|
||||
contributing to the average value cannot overlap, i.e. Nrepeat*Nevery
|
||||
can not exceed Nfreq.
|
||||
|
||||
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
|
||||
on timestep 100. Similarly for timesteps 190,192,194,196,198,200 on
|
||||
timestep 200, etc. If Nrepeat=1 and Nfreq = 100, then no time
|
||||
averaging is done; values are simply generated on timesteps
|
||||
100,200,etc.
|
||||
|
||||
Each input value can also be averaged over the atoms in each chunk.
|
||||
The way the averaging is done across the {Nrepeat} timesteps to
|
||||
produce output on the {Nfreq} timesteps, and across multiple {Nfreq}
|
||||
outputs, is determined by the {norm} and {ave} keyword settings, as
|
||||
discussed below.
|
||||
|
||||
NOTE: To perform per-chunk averaging within a {Nfreq} time window, the
|
||||
number of chunks {Nchunk} defined by the "compute
|
||||
chunk/atom"_compute_chunk_atom.html command must remain constant. If
|
||||
the {ave} keyword is set to {running} or {window} then {Nchunk} must
|
||||
remain constant for the duration of the simulation. This fix forces
|
||||
the chunk/atom compute specified by chunkID to hold {Nchunk} constant
|
||||
for the appropriate time windows, by not allowing it to re-calculate
|
||||
{Nchunk}, which can also affect how it assigns chunk IDs to atoms.
|
||||
This is particularly important to understand if the chunks defined by
|
||||
the "compute chunk/atom"_compute_chunk_atom.html command are spatial
|
||||
bins. If its {units} keyword is set to {box} or {lattice}, then the
|
||||
number of bins {Nchunk} and size of each bin will be fixed over the
|
||||
{Nfreq} time window, which can affect which atoms are discarded if the
|
||||
simulation box size changes. If its {units} keyword is set to
|
||||
{reduced}, then the number of bins {Nchunk} will still be fixed, but
|
||||
the size of each bin can vary at each timestep if the simulation box
|
||||
size changes, e.g. for an NPT simulation.
|
||||
|
||||
:line
|
||||
|
||||
The atom attribute values (vx,vy,vz,fx,fy,fz) are self-explanatory.
|
||||
As noted above, any other atom attributes can be used as input values
|
||||
to this fix by using the "compute
|
||||
property/atom"_compute_property_atom.html command and then specifying
|
||||
an input value from that compute.
|
||||
|
||||
The {density/number} value means the number density is computed for
|
||||
each chunk, i.e. number/volume. The {density/mass} value means the
|
||||
mass density is computed for each chunk, i.e. total-mass/volume. The
|
||||
output values are in units of 1/volume or density (mass/volume). See
|
||||
the "units"_units.html command doc page for the definition of density
|
||||
for each choice of units, e.g. gram/cm^3. If the chunks defined by
|
||||
the "compute chunk/atom"_compute_chunk_atom.html command are spatial
|
||||
bins, the volume is the bin volume. Otherwise it is the volume of the
|
||||
entire simulation box.
|
||||
|
||||
The {temp} value means the temperature is computed for each chunk, by
|
||||
the formula KE = DOF/2 k T, where KE = total kinetic energy of the
|
||||
chunk of atoms (sum of 1/2 m v^2), DOF = the total number of degrees
|
||||
of freedom for all atoms in the chunk, k = Boltzmann constant, and T =
|
||||
temperature.
|
||||
|
||||
The DOF is calculated as N*adof + cdof, where N = number of atoms in
|
||||
the chunk, adof = degrees of freedom per atom, and cdof = degrees of
|
||||
freedom per chunk. By default adof = 2 or 3 = dimensionality of
|
||||
system, as set via the "dimension"_dimension.html command, and cdof =
|
||||
0.0. This gives the usual formula for temperature.
|
||||
|
||||
Note that currently this temperature only includes translational
|
||||
degrees of freedom for each atom. No rotational degrees of freedom
|
||||
are included for finite-size particles. Also no degrees of freedom
|
||||
are subtracted for any velocity bias or constraints that are applied,
|
||||
such as "compute temp/partial"_compute_temp_partial.html, or "fix
|
||||
shake"_fix_shake.html or "fix rigid"_fix_rigid.html. This is because
|
||||
those degrees of freedom (e.g. a constrained bond) could apply to sets
|
||||
of atoms that are both included and excluded from a specific chunk,
|
||||
and hence the concept is somewhat ill-defined. In some cases, you can
|
||||
use the {adof} and {cdof} keywords to adjust the calculated degrees of
|
||||
freedom appropriately, as explained below.
|
||||
|
||||
Also note that a bias can be subtracted from atom velocities before
|
||||
they are used in the above formula for KE, by using the {bias}
|
||||
keyword. This allows, for example, a thermal temperature to be
|
||||
computed after removal of a flow velocity profile.
|
||||
|
||||
Note that the per-chunk temperature calculated by this fix and the
|
||||
"compute temp/chunk"_compute_temp_chunk.html command can be different.
|
||||
The compute calculates the temperature for each chunk for a single
|
||||
snapshot. This fix can do that but can also time average those values
|
||||
over many snapshots, or it can compute a temperature as if the atoms
|
||||
in the chunk on different timesteps were collected together as one set
|
||||
of atoms to calculate their temperature. The compute allows the
|
||||
center-of-mass velocity of each chunk to be subtracted before
|
||||
calculating the temperature; this fix does not.
|
||||
|
||||
If a value begins with "c_", a compute ID must follow which has been
|
||||
previously defined in the input script. If no bracketed integer is
|
||||
appended, the per-atom vector calculated by the compute is used. If a
|
||||
bracketed integer 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 "add them to LAMMPS"_Modify.html.
|
||||
See the discussion above for how I can be specified with a wildcard
|
||||
asterisk to effectively specify multiple values.
|
||||
|
||||
If a value begins with "f_", a fix ID must follow which has been
|
||||
previously defined in the input script. If no bracketed integer is
|
||||
appended, the per-atom vector calculated by the fix is used. If a
|
||||
bracketed integer 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
|
||||
{Nevery}, else an error results. Users can also write code for their
|
||||
own fix styles and "add them to LAMMPS"_Modify.html. See the
|
||||
discussion above for how I can be specified with a wildcard asterisk
|
||||
to effectively specify multiple values.
|
||||
|
||||
If a value begins with "v_", a variable name must follow which has
|
||||
been previously defined in the input script. Variables of style
|
||||
{atom} can reference thermodynamic keywords and various per-atom
|
||||
attributes, or invoke other computes, fixes, or variables when they
|
||||
are evaluated, so this is a very general means of generating per-atom
|
||||
quantities to average within chunks.
|
||||
|
||||
:line
|
||||
|
||||
Additional optional keywords also affect the operation of this fix
|
||||
and its outputs.
|
||||
|
||||
The {norm} keyword affects how averaging is done for the per-chunk
|
||||
values that are output every {Nfreq} timesteps.
|
||||
|
||||
It the {norm} setting is {all}, which is the default, a chunk value is
|
||||
summed over all atoms in all {Nrepeat} samples, as is the count of
|
||||
atoms in the chunk. The averaged output value for the chunk on the
|
||||
{Nfreq} timesteps is Total-sum / Total-count. In other words it is an
|
||||
average over atoms across the entire {Nfreq} timescale. For the
|
||||
{density/number} and {density/mass} values, the volume (bin volume or
|
||||
system volume) used in the final normalization will be the volume at
|
||||
the final {Nfreq} timestep.
|
||||
|
||||
If the {norm} setting is {sample}, the chunk value is summed over
|
||||
atoms for each sample, as is the count, and an "average sample value"
|
||||
is computed for each sample, i.e. Sample-sum / Sample-count. The
|
||||
output value for the chunk on the {Nfreq} timesteps is the average of
|
||||
the {Nrepeat} "average sample values", i.e. the sum of {Nrepeat}
|
||||
"average sample values" divided by {Nrepeat}. In other words it is an
|
||||
average of an average. For the {density/number} and {density/mass}
|
||||
values, the volume (bin volume or system volume) used in the
|
||||
per-sample normalization will be the current volume at each sampling
|
||||
step.
|
||||
|
||||
If the {norm} setting is {none}, a similar computation as for the
|
||||
{sample} setting is done, except the individual "average sample
|
||||
values" are "summed sample values". A summed sample value is simply
|
||||
the chunk value summed over atoms in the sample, without dividing by
|
||||
the number of atoms in the sample. The output value for the chunk on
|
||||
the {Nfreq} timesteps is the average of the {Nrepeat} "summed sample
|
||||
values", i.e. the sum of {Nrepeat} "summed sample values" divided by
|
||||
{Nrepeat}. For the {density/number} and {density/mass} values, the
|
||||
volume (bin volume or system volume) used in the per-sample sum
|
||||
normalization will be the current volume at each sampling step.
|
||||
|
||||
The {ave} keyword determines how the per-chunk values produced every
|
||||
{Nfreq} steps are averaged with values produced on previous steps that
|
||||
were multiples of {Nfreq}, before they are accessed by another output
|
||||
command or written to a file.
|
||||
|
||||
If the {ave} setting is {one}, which is the default, then the chunk
|
||||
values produced on timesteps that are multiples of {Nfreq} are
|
||||
independent of each other; they are output as-is without further
|
||||
averaging.
|
||||
|
||||
If the {ave} setting is {running}, then the chunk values produced on
|
||||
timesteps that are multiples of {Nfreq} are summed and averaged in a
|
||||
cumulative sense before being output. Each output chunk value is thus
|
||||
the average of the chunk value produced on that timestep with all
|
||||
preceding values for the same chunk. This running average begins when
|
||||
the fix is defined; it can only be restarted by deleting the fix via
|
||||
the "unfix"_unfix.html command, or re-defining the fix by
|
||||
re-specifying it.
|
||||
|
||||
If the {ave} setting is {window}, then the chunk values produced on
|
||||
timesteps that are multiples of {Nfreq} are summed and averaged within
|
||||
a moving "window" of time, so that the last M values for the same
|
||||
chunk are used to produce the output. E.g. if M = 3 and Nfreq = 1000,
|
||||
then the output on step 10000 will be the average of the individual
|
||||
chunk values on steps 8000,9000,10000. Outputs on early steps will
|
||||
average over less than M values if they are not available.
|
||||
|
||||
The {bias} keyword specifies the ID of a temperature compute that
|
||||
removes a "bias" velocity from each atom, specified as {bias-ID}. It
|
||||
is only used when the {temp} value is calculated, to compute the
|
||||
thermal temperature of each chunk after the translational kinetic
|
||||
energy components have been altered in a prescribed way, e.g. to
|
||||
remove a flow velocity profile. See the doc pages for individual
|
||||
computes that calculate a temperature to see which ones implement a
|
||||
bias.
|
||||
|
||||
The {adof} and {cdof} keywords define the values used in the degree of
|
||||
freedom (DOF) formula described above for temperature calculation
|
||||
for each chunk. They are only used when the {temp} value is
|
||||
calculated. They can be used to calculate a more appropriate
|
||||
temperature for some kinds of chunks. Here are 3 examples:
|
||||
|
||||
If spatially binned chunks contain some number of water molecules and
|
||||
"fix shake"_fix_shake.html is used to make each molecule rigid, then
|
||||
you could calculate a temperature with 6 degrees of freedom (DOF) (3
|
||||
translational, 3 rotational) per molecule by setting {adof} to 2.0.
|
||||
|
||||
If "compute temp/partial"_compute_temp_partial.html is used with the
|
||||
{bias} keyword to only allow the x component of velocity to contribute
|
||||
to the temperature, then {adof} = 1.0 would be appropriate.
|
||||
|
||||
If each chunk consists of a large molecule, with some number of its
|
||||
bonds constrained by "fix shake"_fix_shake.html or the entire molecule
|
||||
by "fix rigid/small"_fix_rigid.html, {adof} = 0.0 and {cdof} could be
|
||||
set to the remaining degrees of freedom for the entire molecule
|
||||
(entire chunk in this case), e.g. 6 for 3d, or 3 for 2d, for a rigid
|
||||
molecule.
|
||||
|
||||
The {file} keyword allows a filename to be specified. Every {Nfreq}
|
||||
timesteps, a section of chunk info will be written to a text file in
|
||||
the following format. A line with the timestep and number of chunks
|
||||
is written. Then one line per chunk is written, containing the chunk
|
||||
ID (1-Nchunk), an optional original ID value, optional coordinate
|
||||
values for chunks that represent spatial bins, the number of atoms in
|
||||
the chunk, and one or more calculated values. More explanation of the
|
||||
optional values is given below. The number of values in each line
|
||||
corresponds to the number of values specified in the fix ave/chunk
|
||||
command. The number of atoms and the value(s) are summed or average
|
||||
quantities, as explained above.
|
||||
|
||||
The {overwrite} keyword will continuously overwrite the output file
|
||||
with the latest output, so that it only contains one timestep worth of
|
||||
output. This option can only be used with the {ave running} setting.
|
||||
|
||||
The {format} keyword sets the numeric format of each value when it is
|
||||
printed to a file via the {file} keyword. Note that all values are
|
||||
floating point quantities. The default format is %g. You can specify
|
||||
a higher precision if desired, e.g. %20.16g.
|
||||
|
||||
The {title1} and {title2} and {title3} keywords allow specification of
|
||||
the strings that will be printed as the first 3 lines of the output
|
||||
file, assuming the {file} keyword was used. LAMMPS uses default
|
||||
values for each of these, so they do not need to be specified.
|
||||
|
||||
By default, these header lines are as follows:
|
||||
|
||||
# Chunk-averaged data for fix ID and group name
|
||||
# Timestep Number-of-chunks
|
||||
# Chunk (OrigID) (Coord1) (Coord2) (Coord3) Ncount value1 value2 ... :pre
|
||||
|
||||
In the first line, ID and name are replaced with the fix-ID and group
|
||||
name. The second line describes the two values that are printed at
|
||||
the first of each section of output. In the third line the values are
|
||||
replaced with the appropriate value names, e.g. fx or c_myCompute[2].
|
||||
|
||||
The words in parenthesis only appear with corresponding columns if the
|
||||
chunk style specified for the "compute
|
||||
chunk/atom"_compute_chunk_atom.html command supports them. The OrigID
|
||||
column is only used if the {compress} keyword was set to {yes} for the
|
||||
"compute chunk/atom"_compute_chunk_atom.html command. This means that
|
||||
the original chunk IDs (e.g. molecule IDs) will have been compressed
|
||||
to remove chunk IDs with no atoms assigned to them. Thus a compressed
|
||||
chunk ID of 3 may correspond to an original chunk ID or molecule ID of
|
||||
415. The OrigID column will list 415 for the 3rd chunk.
|
||||
|
||||
The CoordN columns only appear if a {binning} style was used in the
|
||||
"compute chunk/atom"_compute_chunk_atom.html command. For {bin/1d},
|
||||
{bin/2d}, and {bin/3d} styles the column values are the center point
|
||||
of the bin in the corresponding dimension. Just Coord1 is used for
|
||||
{bin/1d}, Coord2 is added for {bin/2d}, Coord3 is added for {bin/3d}.
|
||||
For {bin/sphere}, just Coord1 is used, and it is the radial
|
||||
coordinate. For {bin/cylinder}, Coord1 and Coord2 are used. Coord1
|
||||
is the radial coordinate (away from the cylinder axis), and coord2 is
|
||||
the coordinate along the cylinder axis.
|
||||
|
||||
Note that if the value of the {units} keyword used in the "compute
|
||||
chunk/atom command"_compute_chunk_atom.html is {box} or {lattice}, the
|
||||
coordinate values will be in distance "units"_units.html. If the
|
||||
value of the {units} keyword is {reduced}, the coordinate values will
|
||||
be in unitless reduced units (0-1). This is not true for the Coord1 value
|
||||
of style {bin/sphere} or {bin/cylinder} which both represent radial
|
||||
dimensions. Those values are always in distance "units"_units.html.
|
||||
|
||||
:line
|
||||
|
||||
[Restart, fix_modify, output, run start/stop, minimize info:]
|
||||
|
||||
No information about this fix is written to "binary restart
|
||||
files"_restart.html. None of the "fix_modify"_fix_modify.html options
|
||||
are relevant to this fix.
|
||||
|
||||
This fix computes a global array of values which can be accessed by
|
||||
various "output commands"_Howto_output.html. The values can only be
|
||||
accessed on timesteps that are multiples of {Nfreq} since that is when
|
||||
averaging is performed. The global array has # of rows = the number
|
||||
of chunks {Nchunk} as calculated by the specified "compute
|
||||
chunk/atom"_compute_chunk_atom.html command. The # of columns =
|
||||
M+1+Nvalues, where M = 1 to 4, depending on whether the optional
|
||||
columns for OrigID and CoordN are used, as explained above. Following
|
||||
the optional columns, the next column contains the count of atoms in
|
||||
the chunk, and the remaining columns are the Nvalue quantities. When
|
||||
the array is accessed with a row I that exceeds the current number of
|
||||
chunks, than a 0.0 is returned by the fix instead of an error, since
|
||||
the number of chunks can vary as a simulation runs depending on how
|
||||
that value is computed by the compute chunk/atom command.
|
||||
|
||||
The array values calculated by this fix are treated as "intensive",
|
||||
since they are typically already normalized by the count of atoms in
|
||||
each chunk.
|
||||
|
||||
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.
|
||||
|
||||
[Restrictions:] none
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"compute"_compute.html, "fix ave/atom"_fix_ave_atom.html, "fix
|
||||
ave/histo"_fix_ave_histo.html, "fix ave/time"_fix_ave_time.html,
|
||||
"variable"_variable.html, "fix ave/correlate"_fix_ave_correlate.html
|
||||
|
||||
[Default:]
|
||||
|
||||
The option defaults are norm = all, ave = one, bias = none, no file output, and
|
||||
title 1,2,3 = strings as described above.
|
||||
@ -178,6 +178,12 @@ void EwaldDisp::init()
|
||||
if (!function[1] && !function[2]) dispersionflag = 0;
|
||||
if (!function[3]) dipoleflag = 0;
|
||||
|
||||
// compute two charge force
|
||||
|
||||
two_charge();
|
||||
|
||||
// extract short-range Coulombic cutoff from pair style
|
||||
|
||||
pair_check();
|
||||
|
||||
// set accuracy (force units) from accuracy_relative or accuracy_absolute
|
||||
|
||||
@ -6,7 +6,7 @@ SHELL = /bin/sh
|
||||
# compiler/linker settings
|
||||
# specify flags and libraries needed for your compiler
|
||||
|
||||
KOKKOS_ABSOLUTE_PATH = /home/stefan/projects/lammps-mine/lib/kokkos
|
||||
KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd)
|
||||
export MPICH_CXX = $(KOKKOS_ABSOLUTE_PATH)/bin/nvcc_wrapper
|
||||
export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/bin/nvcc_wrapper
|
||||
CC = mpicxx
|
||||
@ -33,7 +33,7 @@ KOKKOS_ARCH = Kepler35
|
||||
# LAMMPS ifdef settings
|
||||
# see possible settings in Section 2.2 (step 4) of manual
|
||||
|
||||
LMP_INC = -DLAMMPS_GZIP -DLAMMPS_PNG -DLAMMPS_JPEG -DLAMMPS_FFMPEG
|
||||
LMP_INC = -DLAMMPS_GZIP
|
||||
|
||||
# MPI library
|
||||
# see discussion in Section 2.2 (step 5) of manual
|
||||
@ -55,9 +55,9 @@ MPI_LIB =
|
||||
# PATH = path for FFT library
|
||||
# LIB = name of FFT library
|
||||
|
||||
FFT_INC = -I/usr/include/
|
||||
FFT_PATH = -L/usr/lib/
|
||||
FFT_LIB = -lfftw3
|
||||
FFT_INC =
|
||||
FFT_PATH =
|
||||
FFT_LIB =
|
||||
|
||||
# JPEG and/or PNG library
|
||||
# see discussion in Section 2.2 (step 7) of manual
|
||||
@ -68,7 +68,7 @@ FFT_LIB = -lfftw3
|
||||
|
||||
JPG_INC =
|
||||
JPG_PATH =
|
||||
JPG_LIB = -ljpeg -lpng
|
||||
JPG_LIB =
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# build rules and dependencies
|
||||
|
||||
@ -2946,8 +2946,12 @@ void FixBondReact::read(int myrxn)
|
||||
bondflag = 1;
|
||||
readline(line);
|
||||
sscanf(line,"%d",&ibonding[myrxn]);
|
||||
if (ibonding[myrxn] > onemol->natoms)
|
||||
error->one(FLERR,"Bond/react: Invalid template atom ID in map file");
|
||||
readline(line);
|
||||
sscanf(line,"%d",&jbonding[myrxn]);
|
||||
if (jbonding[myrxn] > onemol->natoms)
|
||||
error->one(FLERR,"Bond/react: Invalid template atom ID in map file");
|
||||
} else if (strcmp(keyword,"EdgeIDs") == 0) {
|
||||
EdgeIDs(line, myrxn);
|
||||
} else if (strcmp(keyword,"Equivalences") == 0) {
|
||||
@ -2987,6 +2991,8 @@ void FixBondReact::EdgeIDs(char *line, int myrxn)
|
||||
for (int i = 0; i < nedge; i++) {
|
||||
readline(line);
|
||||
sscanf(line,"%d",&tmp);
|
||||
if (tmp > onemol->natoms)
|
||||
error->one(FLERR,"Bond/react: Invalid template atom ID in map file");
|
||||
edge[tmp-1][myrxn] = 1;
|
||||
}
|
||||
}
|
||||
@ -2998,6 +3004,8 @@ void FixBondReact::Equivalences(char *line, int myrxn)
|
||||
for (int i = 0; i < nequivalent; i++) {
|
||||
readline(line);
|
||||
sscanf(line,"%d %d",&tmp1,&tmp2);
|
||||
if (tmp1 > onemol->natoms || tmp2 > onemol->natoms)
|
||||
error->one(FLERR,"Bond/react: Invalid template atom ID in map file");
|
||||
//equivalences is-> clmn 1: post-reacted, clmn 2: pre-reacted
|
||||
equivalences[tmp2-1][0][myrxn] = tmp2;
|
||||
equivalences[tmp2-1][1][myrxn] = tmp1;
|
||||
@ -3017,6 +3025,8 @@ void FixBondReact::CustomEdges(char *line, int myrxn)
|
||||
for (int i = 0; i < ncustom; i++) {
|
||||
readline(line);
|
||||
sscanf(line,"%d %s",&tmp,edgemode);
|
||||
if (tmp > onemol->natoms)
|
||||
error->one(FLERR,"Bond/react: Invalid template atom ID in map file");
|
||||
if (strcmp(edgemode,"none") == 0)
|
||||
custom_edges[tmp-1][myrxn] = 0;
|
||||
else if (strcmp(edgemode,"charges") == 0)
|
||||
@ -3033,6 +3043,8 @@ void FixBondReact::DeleteAtoms(char *line, int myrxn)
|
||||
for (int i = 0; i < ndelete; i++) {
|
||||
readline(line);
|
||||
sscanf(line,"%d",&tmp);
|
||||
if (tmp > onemol->natoms)
|
||||
error->one(FLERR,"Bond/react: Invalid template atom ID in map file");
|
||||
delete_atoms[tmp-1][myrxn] = 1;
|
||||
}
|
||||
}
|
||||
@ -3043,6 +3055,8 @@ void FixBondReact::ChiralCenters(char *line, int myrxn)
|
||||
for (int i = 0; i < nchiral; i++) {
|
||||
readline(line);
|
||||
sscanf(line,"%d",&tmp);
|
||||
if (tmp > onemol->natoms)
|
||||
error->one(FLERR,"Bond/react: Invalid template atom ID in map file");
|
||||
chiral_atoms[tmp-1][0][myrxn] = 1;
|
||||
if (onemol->xflag == 0)
|
||||
error->one(FLERR,"Bond/react: Molecule template 'Coords' section required for chiralIDs keyword");
|
||||
@ -3080,6 +3094,8 @@ void FixBondReact::Constraints(char *line, int myrxn)
|
||||
if (strcmp(constraint_type,"distance") == 0) {
|
||||
constraints[nconstraints][1] = DISTANCE;
|
||||
sscanf(line,"%*s %lg %lg %lg %lg",&tmp[0],&tmp[1],&tmp[2],&tmp[3]);
|
||||
if (tmp[0] > onemol->natoms || tmp[1] > onemol->natoms)
|
||||
error->one(FLERR,"Bond/react: Invalid template atom ID in map file");
|
||||
constraints[nconstraints][2] = tmp[0];
|
||||
constraints[nconstraints][3] = tmp[1];
|
||||
constraints[nconstraints][4] = tmp[2]*tmp[2]; // using square of distance
|
||||
@ -3087,6 +3103,8 @@ void FixBondReact::Constraints(char *line, int myrxn)
|
||||
} else if (strcmp(constraint_type,"angle") == 0) {
|
||||
constraints[nconstraints][1] = ANGLE;
|
||||
sscanf(line,"%*s %lg %lg %lg %lg %lg",&tmp[0],&tmp[1],&tmp[2],&tmp[3],&tmp[4]);
|
||||
if (tmp[0] > onemol->natoms || tmp[1] > onemol->natoms || tmp[2] > onemol->natoms)
|
||||
error->one(FLERR,"Bond/react: Invalid template atom ID in map file");
|
||||
constraints[nconstraints][2] = tmp[0];
|
||||
constraints[nconstraints][3] = tmp[1];
|
||||
constraints[nconstraints][4] = tmp[2];
|
||||
|
||||
@ -232,6 +232,10 @@ E: Bond/react: Unknown section in map file
|
||||
|
||||
Please ensure reaction map files are properly formatted.
|
||||
|
||||
E: Bond/react: Invalid template atom ID in map file
|
||||
|
||||
Atom IDs in molecule templates range from 1 to the number of atoms in the template.
|
||||
|
||||
E or W: Bond/react: Atom affected by reaction %s too close to template edge
|
||||
|
||||
This means an atom which changes type or connectivity during the
|
||||
|
||||
@ -233,10 +233,6 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
else size_peratom_cols = nvalues;
|
||||
|
||||
nmax = maxvector = 0;
|
||||
indices = NULL;
|
||||
varatom = NULL;
|
||||
vecglobal = NULL;
|
||||
|
||||
vector_atom = NULL;
|
||||
array_atom = NULL;
|
||||
}
|
||||
@ -320,6 +316,10 @@ void ComputeGlobalAtom::compute_peratom()
|
||||
nmax = atom->nmax;
|
||||
memory->destroy(indices);
|
||||
memory->create(indices,nmax,"global/atom:indices");
|
||||
if (whichref == VARIABLE) {
|
||||
memory->destroy(varatom);
|
||||
memory->create(varatom,nmax,"global/atom:varatom");
|
||||
}
|
||||
if (nvalues == 1) {
|
||||
memory->destroy(vector_atom);
|
||||
memory->create(vector_atom,nmax,"global/atom:vector_atom");
|
||||
@ -377,12 +377,6 @@ void ComputeGlobalAtom::compute_peratom()
|
||||
}
|
||||
|
||||
} else if (whichref == VARIABLE) {
|
||||
if (atom->nmax > nmax) {
|
||||
nmax = atom->nmax;
|
||||
memory->destroy(varatom);
|
||||
memory->create(varatom,nmax,"global/atom:varatom");
|
||||
}
|
||||
|
||||
input->variable->compute_atom(ref2index,igroup,varatom,1,0);
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit)
|
||||
|
||||
@ -1466,10 +1466,12 @@ double *Image::color2rgb(const char *color, int index)
|
||||
return userrgb[-index-1];
|
||||
}
|
||||
|
||||
if (color) {
|
||||
for (int i = 0; i < ncolors; i++)
|
||||
if (strcmp(color,username[i]) == 0) return userrgb[i];
|
||||
for (int i = 0; i < NCOLORS; i++)
|
||||
if (strcmp(color,name[i]) == 0) return rgb[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user