Skip to content

Commit f6a4997

Browse files
committed
ensured consistency of tutorial 2
1 parent fef22eb commit f6a4997

File tree

3 files changed

+46
-20
lines changed

3 files changed

+46
-20
lines changed

docs/sphinx/source/tutorial1/tutorial.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,8 @@ in a ``thermo_style custom`` command (see below).
760760
LAMMPS ``compute`` commands can produce
761761
a wide variety of data and one can identify the category from the
762762
name of the compute style: global data (no suffix), local data
763-
(/local suffix), per-atom data (/atom suffix), per-chunk data
764-
(/chunk suffix), per-gridpoint data (/grid suffix). In the example
763+
(local suffix), per-atom data (atom suffix), per-chunk data
764+
(chunk suffix), per-gridpoint data (grid suffix). In the example
765765
above, the ``compute coord/atom`` produces per-atom data, which
766766
is used as input for ``compute reduce`` which returns global
767767
data. For global data three kinds of data exists: scalars (single

docs/sphinx/source/tutorial2/introduction.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ by imposing a constant velocity on the edge atoms. To illustrate the
1616
difference between conventional and reactive force fields, this tutorial
1717
is divided into two parts: in the first part, a conventional molecular
1818
force field (called OPLS-AA :cite:`jorgensenDevelopmentTestingOPLS1996`)
19-
is used and the form of the bonded potential ensure that the bonds between the
20-
atoms of the CNT are unbreakable. In
21-
the second part, a reactive force field (called AIREBO :cite:`stuart2000reactive`)
19+
is used and the functional form of the bonded potential ensures that the
20+
bonds between the atoms of the CNT are unbreakable. In
21+
the second part, a reactive, many-body, force field (called AIREBO :cite:`stuart2000reactive`)
2222
is used, which allows chemical bonds to break under large strain.

docs/sphinx/source/tutorial2/tutorial.rst

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ With most conventional molecular force fields, the chemical bonds between
55
atoms are defined at the start of the simulation and remain fixed, regardless
66
of the forces applied to the atoms. In this tutorial, these bonds are
77
explicitly specified in the **.data** file, which is read using the ``read_data`` command (see below).
8-
Bonds are typically modeled as springs
9-
with equilibrium distances :math:`r_0` and force constants :math:`k_\text{b}`:
10-
:math:`U_\text{b} = k_\text{b} \left( r - r_0 \right)^2`. Additionally, angular and
11-
dihedral constraints are often imposed to preserve the molecular structure
12-
by maintaining the relative orientations of neighboring atoms.
8+
Bonds are typically modeled as springs following Hooke's law
9+
with equilibrium distances :math:`r_0`, force constants :math:`k_\text{b}`,
10+
and bond potential energy :math:`U_\text{b} = k_\text{b} \left( r - r_0 \right)^2`.
11+
Additionally, angular and dihedral constraints are often imposed to preserve the
12+
molecular structure by maintaining the relative orientations of neighboring atoms.
1313

1414
The LAMMPS input
1515
----------------
@@ -79,6 +79,15 @@ as well as the identity of the atoms that are linked by ``bonds``, ``angles``,
7979
``dihedrals``, and ``impropers`` interactions. It was created using VMD and TopoTools
8080
:cite:`kohlmeyer2017topotools`.
8181

82+
.. admonition:: Note
83+
:class: non-title-info
84+
85+
Bonds, angles, dihedrals, and impropers in LAMMPS are assigned types and IDs, just like atoms.
86+
The ID uniquely identifies each interaction instance, while the type determines which parameters
87+
(from the ``bond_coeff``, ``angle_coeff``, etc. commands) are applied.
88+
In this tutorial, these types and IDs are specified in the ``.data`` file and
89+
read by the ``read_data`` command.
90+
8291
.. |unbreakable_data| raw:: html
8392

8493
<a href="https://raw.githubusercontent.com/lammpstutorials/lammpstutorials-inputs/refs/heads/main/tutorial2/unbreakable.data" target="_blank">unbreakable.data</a>
@@ -228,9 +237,9 @@ by adding the following commands to **unbreakable.lmp**:
228237
229238
Re-setting the atom IDs is necessary before using the ``velocity`` command
230239
when atoms were deleted, which is done here with the ``reset_atoms`` command.
231-
The ``velocity`` command gives initial velocities to the atoms of the middle
232-
group ``cnt_mid``, ensuring an initial temperature of :math:`T = 300\,\text{K}`
233-
for these atoms.
240+
The ``velocity`` command assigns random initial velocities to the atoms of the middle
241+
group ``cnt_mid`` from a uniform distribution, ensuring an initial temperature
242+
of :math:`T = 300\,\text{K}` for these atoms.
234243

235244
Let us specify the thermalization and the dynamics of the system. Add the following
236245
lines into **unbreakable.lmp**:
@@ -250,11 +259,10 @@ with desired temperature of 300 K :cite:`nose1984unified, hoover1985canonical`.
250259
.. admonition:: Note
251260
:class: non-title-info
252261

253-
The Nosé-Hoover thermostat only controls the temperature of
254-
the atoms belonging to the specified ``cnt_mid`` group. Atoms outside
255-
this group are not affected by the thermostat.
262+
The Nosé-Hoover thermostat only controls the temperature of the atoms
263+
belonging to the specified ``cnt_mid`` group. Atoms outside this group are not affected.
256264

257-
To restrain the motion of the atoms at the edges, let us add the following
265+
To immobilize the motion of the atoms at the edges, let us add the following
258266
commands to **unbreakable.lmp**:
259267

260268
.. code-block:: lammps
@@ -279,11 +287,12 @@ they would if no other command was applied to them).
279287
.. admonition:: Note
280288
:class: non-title-info
281289

282-
The ``velocity set`` command imposes the velocity of a group of atoms at the start of a run but does
283-
not enforce the velocity during the entire simulation. When ``velocity set`` is used in combination with
290+
The ``velocity set`` command adjusts the velocities of a
291+
group of atoms immediately but has no effect *during*
292+
the simulation. When ``velocity set`` is used in combination with
284293
``setforce 0 0 0``, as is the case here, the atoms won't feel any force during the entire simulation.
285294
According to the Newton equation, no force means no acceleration, meaning that the initial velocity
286-
will persist during the entire simulation, thus producing a constant velocity motion.
295+
will persist during the entire simulation, thus producing a constant velocity motion or no motion at all.
287296

288297
Outputs
289298
-------
@@ -462,6 +471,23 @@ and must be placed next to **breakable.lmp**.
462471

463472
<a href="https://raw.githubusercontent.com/lammpstutorials/lammpstutorials-inputs/refs/heads/main/tutorial2/CH.airebo" target="_blank">CH.airebo</a>
464473

474+
.. admonition:: Note
475+
:class: non-title-info
476+
477+
The AIREBO force field is a many-body
478+
potential, where interactions are not only between pairs of atoms,
479+
but also triples and quadruples representing angle and dihedral
480+
interactions. This means that there are different rules for the
481+
``pair_coeff`` command: there must be only one command that
482+
covers all permutations of atom types by using two '*' wildcards.
483+
After the potential file follows a list of elements. These element
484+
names are used to look up the parameter sets in the potential file.
485+
There must be a list with as many elements as atom types following
486+
the filename. In our system, there is only one atom type (1), which is
487+
mapped to the element 'C' in the ``pair_coeff`` command.
488+
Which elements are supported is determined by the contents of the
489+
potential file.
490+
465491
.. admonition:: Note
466492
:class: non-title-info
467493

0 commit comments

Comments
 (0)