Skip to content

Commit bcace4d

Browse files
committed
keep applying comments
1 parent 1632169 commit bcace4d

File tree

9 files changed

+107
-14
lines changed

9 files changed

+107
-14
lines changed

docs/sphinx/source/tutorial1/tutorial.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,14 @@ The equal-style ``variables`` are expressions evaluated
694694
during the run and return a number. Here, they are defined to count
695695
the number of atoms of a specific group within the ``cyl_in`` region.
696696

697+
.. admonition:: Note
698+
:class: non-title-info
699+
700+
The ``n1_in`` and ``n2_in`` defined above are
701+
equal-style variables, which evaluate a numerical expression using the
702+
``count()`` function. Other common LAMMPS variable types include
703+
atom-style, index, and loop.
704+
697705
In addition to counting the atoms in each region, we will also extract
698706
the coordination number of type 2 atoms around type 1 atoms. The
699707
coordination number measures the number of type 2 atoms near
@@ -823,7 +831,7 @@ expected during mixing. This can be observed using the entry
823831

824832
.. container:: figurelegend
825833

826-
Figure: a) Evolution of the numbers :math:`N_\text{1, in}$` and :math:`N_\text{2, in}` of atoms
834+
Figure: a) Evolution of the numbers :math:`N_\text{1, in}` and :math:`N_\text{2, in}` of atoms
827835
of types 1 and 2, respectively, within the ``cyl_in`` region as functions
828836
of time :math:`t`. b) Evolution of the coordination number :math:`C_{1-2}`
829837
(compute ``sumcoor12``) between atoms of types 1 and 2.

docs/sphinx/source/tutorial2/tutorial.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ corresponding to the following: :math:`x < x_\text{min}` (``rbot``, for region
162162
bottom), :math:`x_\text{min} > x > x_\text{max}` (``rmid``, for region middle),
163163
and :math:`x > x_\text{max}` (``rtop``, for region top).
164164

165+
.. admonition:: Note
166+
:class: non-title-info
167+
168+
So far, variables have been referenced dynamically during the run using
169+
the ``v_`` prefix, which evaluates the variable as it evolves over time.
170+
Here, a dollar sign ($) is used to reference the variable at the time the script is read.
171+
165172
Finally, let us define 3 groups of atoms corresponding to the atoms
166173
in each of the 3 regions by adding to **unbreakable.lmp**
167174
just before the ``run 0`` command:

docs/sphinx/source/tutorial4/tutorial.rst

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ images of the system, you will notice that the atoms and molecules are moving to
371371
System equilibration
372372
--------------------
373373

374-
Let us equilibrate further the entire system by letting both fluid and piston
374+
Let us equilibrate further the entire system by letting both fluid and wall
375375
relax at ambient temperature. Here, the commands are written within the same
376376
**equilibrate.lmp** file, right after the ``reset_timestep`` command.
377377

@@ -400,6 +400,14 @@ for the trajectory visualization:
400400
The ``undump`` command is used to cancel the previous ``dump`` command.
401401
Then, a new ``dump`` command with a larger dumping period is used.
402402

403+
.. admonition:: Note
404+
:class: non-title-info
405+
406+
Just like the ``undump`` command can cancel an active ``dump``, other
407+
objects defined in a LAMMPS input script can be cancelled when no longer needed.
408+
For example, you can use ``unfix`` to remove a previously defined ``fix``, and
409+
``uncompute`` to delete a ``compute``.
410+
403411
To monitor the system equilibration, let us print the distance between
404412
the two walls. Add the following lines to **equilibrate.lmp**:
405413

@@ -527,7 +535,10 @@ The ``setforce`` commands cancel the forces on ``walltop`` and
527535
``wallbot``. As a result, the atoms in these two groups will not
528536
experience any forces from the rest of the system. Consequently, in the absence of
529537
external forces, these atoms will conserve the initial velocities imposed by the
530-
two ``velocity`` commands.
538+
two ``velocity`` commands. As seen previously, although the
539+
forces on these atoms are set to zero, the ``fix setforce`` still stores the
540+
forces acting on the group before cancellation, which can later be extracted
541+
for analysis (see below).
531542

532543
Finally, let us generate images of the systems and print the values of the
533544
forces exerted by the fluid on the walls, as given by ``f_mysf1[1]``
@@ -544,8 +555,9 @@ and ``f_mysf2[1]``. Add these lines to **shearing.lmp**:
544555
thermo_style custom step temp etotal f_mysf1[1] f_mysf2[1]
545556
546557
Let us also extract the density and velocity profiles using
547-
the ``chunk/atom`` and ``ave/chunk`` commands. These commands are
548-
used to divide the system into bins and return the desired quantities, here the velocity
558+
the ``chunk/atom`` and ``ave/chunk`` commands. These
559+
commands discretize the simulation domain into spatial bins and compute and output
560+
average properties of the atoms belonging to each bin, here the velocity
549561
along :math:`x` (``vx``) within the bins. Add the following lines to **shearing.lmp**:
550562

551563
.. code-block:: lammps

docs/sphinx/source/tutorial5/tutorial.rst

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ and a **.data** file is imported by the ``read_data`` command.
3030
.. include:: ../shared/needhelp.rst
3131

3232
The initial topology given by |silica_data_5|
33-
is a small amorphous silica structure. This structure was created using a force field called
34-
Vashishta :cite:`vashishta1990interaction`. If you open the **silica.data**
33+
is a small amorphous silica structure. This structure was generated in a prior
34+
simulation using the Vashishta force field :cite:`vashishta1990interaction`.
35+
If you open the **silica.data**
3536
file, you will find in the ``Atoms`` section that all silicon atoms have a
3637
charge of :math:`q = 1.1\,\text{e}`, and all oxygen atoms have a charge of :math:`q = -0.55\,\text{e}`.
3738

@@ -66,6 +67,15 @@ low and the high cutoffs, respectively, and :math:`1.0 \text{e} -6` is the toler
6667
i.e., the precision to which the atomic charges are equilibrated during the
6768
charge equilibration process.
6869

70+
.. admonition:: Note
71+
:class: non-title-info
72+
73+
The ``pair_style reaxff`` command optionally accepts a control file,
74+
which defines control variables such as
75+
global parameters of the ReaxFF potential, as well as performance and output settings.
76+
If no control file is provided, as in this tutorial, LAMMPS uses its default values,
77+
which correspond to those in Adri van Duin's original stand-alone ReaxFF code :cite:`van2001reaxff`.
78+
6979
The ``maxiter`` sets an upper limit to the number of attempts to
7080
equilibrate the charge.
7181

@@ -121,6 +131,13 @@ We can generate histograms of the charges for each atom type using
121131
fix myhis1 grpSi ave/histo 10 500 5000 -1.5 2.5 1000 v_vq file relax-Si.histo mode vector
122132
fix myhis2 grpO ave/histo 10 500 5000 -1.5 2.5 1000 v_vq file relax-O.histo mode vector
123133
134+
The ``fix ave/histo`` command samples values
135+
over a group of atoms and builds a histogram over a specified range divided into
136+
bins. In this tutorial, it is used to monitor the charge distributions
137+
of silicon and oxygen atoms. The parameters ``10 500 5000`` specify how often
138+
the histogram is updated and averaged, ``-1.5 2.5`` set the value range,
139+
``1000`` is the number of bins, and ``v\_vq`` is the variable being histogrammed.
140+
124141
We can also use the ``fix reaxff/species`` to evaluate what species are
125142
present within the simulation. It will be useful later when the system is deformed,
126143
and bonds are broken:
@@ -143,6 +160,13 @@ density of the system:
143160
144161
write_data relax.data
145162
163+
.. admonition:: Note
164+
:class: non-title-info
165+
166+
With the `aniso` keyword, the three dimensions of the simulation
167+
box can change independently. This is particularly relevant for solids and other
168+
systems where anisotropic stresses may develop.
169+
146170
Run the **relax.lmp** file using LAMMPS. As seen from **relax.species**,
147171
only one species is detected, called ``O384Si192``, representing the entire system.
148172

@@ -246,7 +270,7 @@ Nosé-Hoover thermostat without a barostat:
246270
timestep 0.5
247271
248272
Here, no barostat is used because the change in the box volume will be imposed
249-
by the ``fix deform``.
273+
by the ``fix deform``, see below.
250274

251275
Let us run for 5000 steps without deformation, then apply the ``fix deform``
252276
to progressively elongate the box along the :math:`x`-axis during 25000 steps. Add
@@ -262,6 +286,10 @@ the following line to **deform.lmp**:
262286
263287
write_data deform.data
264288
289+
The ``fix deform`` command applies a continuous deformation
290+
by elongating the simulation box along the x-axis at a constant engineering
291+
shear strain rate, specified by ``erate``, of :math:`5 \times 10^{-5}~\text{fs}^{-1}`.
292+
265293
Run the **deform.lmp** file using LAMMPS. During the deformation, the charge
266294
values progressively evolve until the structure eventually breaks down. After the
267295
structure breaks down, the charges equilibrate near new average values that differ

docs/sphinx/source/tutorial6/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ grand canonical Monte Carlo simulations to compute the adsorption of water
1515
molecules in cracked silica material. This tutorial
1616
illustrates the use of the grand canonical ensemble in molecular simulation, an
1717
open ensemble where the number of atoms or molecules in the simulation box can vary.
18-
By employing the grand canonical ensemble, we will set the chemical
19-
potential of water within a nanoporous :math:`\text{SiO}_2` structure.
18+
By employing the grand canonical ensemble, we simulate water in a nanoporous
19+
:math:`\text{SiO}_2` structure at a specified chemical potential.
2020

docs/sphinx/source/tutorial6/tutorial.rst

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ generally suitable for a solid phase.
122122

123123
Run the simulation using LAMMPS. From the ``Charts`` window, the temperature
124124
evolution can be observed, showing that it closely follows the desired annealing procedure.
125-
The evolution of the box dimensions over time confirms that the box deformed during the
125+
The evolution of the box dimensions over time confirms that the box is deforming during the
126126
last stage of the simulation. After the simulation completes, the final LAMMPS topology
127127
file called **generate.data** will be located next to **generate.lmp**.
128128

@@ -184,12 +184,20 @@ the **cracking.lmp** file:
184184
185185
write_data cracking.data
186186
187-
The ``fix nvt`` command is employed to control the temperature of the system.
187+
The ``fix nvt`` command integrates the Nosé-Hoover equations
188+
of motion and is employed to control the temperature of the system.
188189
As observed from the generated images, the atoms
189190
progressively adjust to the changing box dimensions. At some point,
190191
bonds begin to break, leading to the appearance of
191192
dislocations.
192193

194+
.. admonition:: Note
195+
:class: non-title-info
196+
197+
Although the Nosé-Hoover equations were originally formulated to sample the
198+
NVT ensemble, using the ``fix nvt`` command does not guarantee that
199+
a simulation actually samples the NVT ensemble.
200+
193201
.. figure:: figures/cracked-dark.png
194202
:class: only-dark
195203
:alt: Amorphous cracked silica block
@@ -418,9 +426,15 @@ Carlo steps. Add the following lines into **gcmc.lmp**:
418426
variable tfac equal 5.0/3.0
419427
fix fgcmc H2O gcmc 100 100 0 0 65899 300 -0.5 0.1 mol h2omol tfac_insert ${tfac} shake shak full_energy pressure 100
420428
429+
The ``fix gcmc`` command performs grand canonical Monte Carlo
430+
moves to insert, delete, or swap molecules. Here, 100 attempts are made every
431+
100 steps. The ``mol h2omol`` keyword specifies the
432+
molecule type being inserted/deleted, while ``shake shak`` enforces rigid
433+
molecular constraints during these moves. With the ``pressure 100`` keyword,
434+
a fictitious reservoir with a pressure of 100 atmospheres is used.
421435
The ``tfac_insert`` option ensures the correct estimate for the temperature
422436
of the inserted water molecules by taking into account the internal degrees of
423-
freedom. Here, 100 insertion and deletion attemps are made every 100 steps.
437+
freedom.
424438

425439
.. admonition:: Note
426440
:class: non-title-info
@@ -439,6 +453,9 @@ Finally, let us print some information and run for 25 ps:
439453
440454
run 25000
441455
456+
The ``f_`` keywords extract the Monte Carlo move statistics output by the
457+
``fix gcmc`` command.
458+
442459
.. admonition:: Note
443460
:class: non-title-info
444461

docs/sphinx/source/tutorial7/tutorial.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ following lines to **free-sampling.lmp**:
8484
mass * 39.95
8585
pair_coeff * * ${epsilon} ${sigma}
8686
87+
.. admonition:: Note
88+
:class: non-title-info
89+
90+
In the ``pair_coeff`` command, the first two asterisks
91+
``* *`` indicate that the parameters apply to all atom types in the simulation.
92+
8793
The variables :math:`U_0`, :math:`\delta`, and :math:`x_0`, defined in the previous subsection, are
8894
used here to create the repulsive potential, restricting the atoms from exploring
8995
the center of the box:
@@ -215,6 +221,10 @@ Add the following line to **free-sampling.lmp**:
215221
216222
run 2000000
217223
224+
Here, the ``chunk/atom`` command discretizes the simulation
225+
domain into spatial bins of size 2~\AA{} along the :math:`x` direction,
226+
and the ``ave/chunk`` command computes and outputs the number density of
227+
atoms within each bin to the file **free-sampling.dat**.}
218228
The step count is reset to 0 using ``reset_timestep`` to synchronize it
219229
with the output times of ``fix density/number``. Run the simulation using
220230
LAMMPS.

docs/sphinx/source/tutorial8/introduction.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ protocol is used to simulate the polymerization of styrene monomers, and the
1616
polymerization reaction is tracked over time :cite:`gissinger2017polymer,
1717
gissinger2020reacter, gissinger2024molecular`. In contrast to AIREBO
1818
:ref:`carbon-nanotube-label` and ReaxFF :ref:`reactive-silicon-dioxide-label`,
19-
the REACTER protocol relies on the use of a *classical* force field.
19+
the REACTER protocol relies on the use of a *classical* force field
20+
that does not inherently model bond formation or breaking, but instead couples
21+
with an external algorithm to simulate polymerization reactions.

docs/sphinx/source/tutorial8/tutorial.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ following content corresponding to **mixing.lmp**:
2424
The ``class2`` styles compute a 6/9 Lennard-Jones potential :cite:`sun1998compass`.
2525
The ``class2`` bond, angle, dihedral, and improper styles are used as
2626
well, see the documentation for a description of their respective potentials.
27+
The ``tail yes`` option adds long-range van der Waals tail corrections to the
28+
energy and pressure.
2729
The ``mix sixthpower`` imposes the following mixing rule for the calculation
2830
of the cross coefficients:
2931

@@ -279,6 +281,13 @@ based on the atom map **M-M.rxnmap**. Implementation details about each reactio
279281
such as the reaction distance cutoffs and the frequency with which to search for
280282
reaction sties, are also specified in this command.
281283

284+
.. admonition:: Note
285+
:class: non-title-info
286+
287+
The ``fix nve/limit`` command Newton's equations of motion
288+
while limiting the maximum displacement of atoms per timestep. This is
289+
useful for preventing atoms from moving too far due to large forces.
290+
282291
.. figure:: figures/REACT-composite-dm.png
283292
:class: only-dark
284293
:alt: Evolution of reacting species

0 commit comments

Comments
 (0)