Skip to content

Commit b458611

Browse files
committed
added figures into tutorials
1 parent 1329e16 commit b458611

15 files changed

+258
-5019
lines changed

docs/sphinx/source/converter/main.rst

-4,886
This file was deleted.

docs/sphinx/source/converter/tex-to-rst.py

-40
This file was deleted.
Loading
Loading
Loading
Loading

docs/sphinx/source/tutorial2/figures/breakable.ipynb

+8-8
Large diffs are not rendered by default.

docs/sphinx/source/tutorial2/figures/unbreakable.ipynb

+28-12
Large diffs are not rendered by default.

docs/sphinx/source/tutorial2/tutorial.rst

+30-12
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,20 @@ shows a non-linear increase with :math:`t` once the deformation starts, which is
340340
from the typical dependency of bond energy with bond distance,
341341
:math:`U_\text{b} = k_\text{b} \left( r - r_0 \right)^2`.
342342

343-
INCLUDE FIGURE CNT-unbreakable-length-energy -- a) Evolution
344-
of the length :math:`L_\text{cnt}` of the CNT with time.
345-
The CNT starts deforming at :math:`t = 5\,\text{ps}`, and :math:`L_\text{cnt-0}` is the
346-
CNT initial length.
347-
b) Evolution of the total energy :math:`E` of the system with time :math:`t`.
348-
Here, the potential is OPLS-AA, and the CNT is unbreakable.
343+
.. figure:: figures/CNT-unbreakable-length-energy-dm.png
344+
:class: only-dark
345+
:alt: Evolution of the CNT energy
346+
347+
.. figure:: figures/CNT-unbreakable-length-energy.png
348+
:class: only-light
349+
:alt: Evolution of the CNT energy
350+
351+
.. container:: figurelegend
352+
353+
a) Evolution of the length :math:`L_\text{cnt}` of the CNT with time.
354+
The CNT starts deforming at :math:`t = 5\,\text{ps}`, and :math:`L_\text{cnt-0}` is the
355+
CNT initial length. b) Evolution of the total energy :math:`E` of the system with time :math:`t`.
356+
Here, the potential is OPLS-AA, and the CNT is unbreakable.
349357

350358
Importing YAML log file into Python
351359
-----------------------------------
@@ -522,12 +530,22 @@ curve reveals a linear (elastic) regime where
522530

523531
<a href="../../../../../.dependencies/lammpstutorials-inputs/tutorial2/unbreakable-yaml-reader.py" target="_blank">unbreakable-yaml-reader.py</a>
524532

525-
ADD FIGURE CNT-breakable-stress-energy -- a) Evolution of the total energy :math:`E` of the CNT with time :math:`t`.
526-
b) Stress applied on the CNT during deformation, :math:`F_\text{cnt}/A_\text{cnt}`,
527-
where :math:`F_\text{cnt}` is the force and :math:`A_\text{cnt}` the CNT surface area,
528-
as a function of the strain, :math:`\Delta L_\text{cnt} = (L_\text{cnt}-L_\text{cnt-0}/L_\text{cnt-0})`, where
529-
:math:`L_\text{cnt}` is the CNT length and :math:`L_\text{cnt-0}` the CNT initial length.
530-
Here, the potential is AIREBO, and the CNT is breakable.
533+
.. figure:: figures/CNT-breakable-stress-energy-dm.png
534+
:class: only-dark
535+
:alt: Evolution of the CNT energy
536+
537+
.. figure:: figures/CNT-breakable-stress-energy.png
538+
:class: only-light
539+
:alt: Evolution of the CNT energy
540+
541+
.. container:: figurelegend
542+
543+
a) Evolution of the total energy :math:`E` of the CNT with time :math:`t`. b) Stress applied on the CNT
544+
during deformation, :math:`F_\text{cnt}/A_\text{cnt}`,
545+
where :math:`F_\text{cnt}` is the force and :math:`A_\text{cnt}` the CNT surface area,
546+
as a function of the strain, :math:`\Delta L_\text{cnt} = (L_\text{cnt}-L_\text{cnt-0}/L_\text{cnt-0})`, where
547+
:math:`L_\text{cnt}` is the CNT length and :math:`L_\text{cnt-0}` the CNT initial length.
548+
Here, the potential is AIREBO, and the CNT is breakable.
531549

532550
Tip: bonds representation with AIREBO
533551
-------------------------------------

docs/sphinx/source/tutorial3/tutorial.rst

+28-11
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ distances, etc). Thus add to **water.lmp** the line:
6161

6262
This tutorial uses type labels :cite:`typelabel_paper` to map each
6363
numeric atom type to a string (see the **parameters.inc** file):
64-
\lmpcmdnote{labelmap atom 1 OE 2 C 3 HC 4 H 5 CPos 6 OAlc 7 OW 8 HW}
64+
``labelmap atom 1 OE 2 C 3 HC 4 H 5 CPos 6 OAlc 7 OW 8 HW``
6565
Therefore, the oxygen and hydrogen atoms of water (respectively types
66-
7 and 8) can be referred to as `OW' and `HW', respectively. Similar
66+
7 and 8) can be referred to as ``OW`` and ``HW``, respectively. Similar
6767
maps are used for the bond types, angle types, and dihedral types.
6868

6969
Let us create water molecules. To do so, let us import a molecule template called
@@ -96,9 +96,19 @@ next to **water.lmp**. This template contains the necessary
9696
structural information of a water molecule, such as the number of atoms,
9797
or the IDs of the atoms that are connected by bonds and angles.
9898

99-
INSERT-FIGURE PEG-density a) Temperature, :math:`T`, of the water reservoir from :ref:`all-atom-label`
100-
as a function of the time, :math:`t`. The horizontal dashed line is the target temperature of 300\,K.
101-
b) Evolution of the system density, :math:`\rho`, with :math:`t`
99+
.. figure:: figures/PEG-density-dm.png
100+
:class: only-dark
101+
:alt: Evolution of the water reservoir density
102+
103+
.. figure:: figures/PEG-density.png
104+
:class: only-light
105+
:alt: Evolution of the water reservoir density
106+
107+
.. container:: figurelegend
108+
109+
a) Temperature, :math:`T`, of the water reservoir as a function of the
110+
time, :math:`t`. The horizontal dashed line is the target temperature
111+
of :math:`300 \text{K}`. b) Evolution of the system density, :math:`\rho`, with :math:`t`
102112

103113
Then, let us organize the atoms of types OW and HW of the water
104114
molecules in a group named ``H2O`` and perform a small energy
@@ -130,7 +140,6 @@ The ``fix npt`` allows us to impose both a temperature of :math:`300\,\text{K}`
130140
(with a damping constant of :math:`1000\,\text{fs}`). With the ``iso`` keyword,
131141
the three dimensions of the box will be re-scaled simultaneously.
132142

133-
134143
INSERT FIGURE PEG-water The water reservoir from \hyperref[all-atom-label]{Tutorial 3}
135144
after equilibration. Oxygen atoms are in red, and hydrogen atoms are in white.
136145

@@ -361,11 +370,19 @@ the following lines to **pull.lmp**:
361370
fix mynvt all nvt temp 300 300 100
362371
fix myrct PEG recenter 0 0 0 shift all
363372
364-
Add figure PEG-distance - a) Evolution of
365-
the radius of gyration :math:`R_\text{gyr}` of the PEG molecule
366-
from \hyperref[all-atom-label]{Tutorial 3}, with the force
367-
applied starting at :math:`t = 15\,\text{ps}`. b) Histograms of the dihedral angles of type 1
368-
in the absence (orange) and in the presence (blue) of the applied force.
373+
.. figure:: figures/PEG-distance-dm.png
374+
:class: only-dark
375+
:alt: Evolution of the polymer radius of gyration
376+
377+
.. figure:: figures/PEG-distance.png
378+
:class: only-light
379+
:alt: Evolution of the polymer radius of gyration
380+
381+
.. container:: figurelegend
382+
383+
a) Evolution of the radius of gyration :math:`R_\text{gyr}` of the PEG molecule,
384+
with the force applied starting at :math:`t = 15\,\text{ps}`. b) Histograms of
385+
the dihedral angles of type 1 in the absence (orange) and in the presence (blue) of the applied force.
369386

370387
To investigate the stretching of the PEG molecule, let us compute its radius of
371388
gyration :cite:`fixmanRadiusGyrationPolymer1962a` and the angles of its dihedral

docs/sphinx/source/tutorial4/tutorial.rst

+23-3
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,19 @@ the end of the simulation (Fig.~\ref{fig:NANOSHEAR-equilibration}).
400400
temperature :cite:`mills1955remeasurement`, one finds that the equilibration
401401
should be on the order of one nanosecond.
402402

403-
ADD figure NANOSHEAR-equilibration a) Pressure, :math:`p`, of the nanosheared electrolyte system as a function of the
404-
time, :math:`t`. b) Distance between the walls, :math:`\Delta z`, as a function of :math:`t`.
403+
.. figure:: figures/NANOSHEAR-equilibration-dm.png
404+
:class: only-dark
405+
:alt: Evolution of the pressure and distance for the elecrolyte
406+
407+
.. figure:: figures/NANOSHEAR-equilibration.png
408+
:class: only-light
409+
:alt: Evolution of the pressure and distance for the elecrolyte
410+
411+
.. container:: figurelegend
412+
413+
a) Pressure, :math:`p`, of the nanosheared electrolyte system as a function
414+
of the time, :math:`t`. b) Distance between the walls, :math:`\Delta z`, as a
415+
function of :math:`t`.
405416

406417
Imposed shearing
407418
----------------
@@ -468,8 +479,17 @@ experience any forces from the rest of the system. Consequently, in the absence
468479
external forces, these atoms will conserve the initial velocities imposed by the
469480
two ``velocity`` commands.
470481

471-
Add figure NANOSHEAR-profiles Velocity profiles for water (blue) and walls (orange) along the :math:`z`-axis.
482+
.. figure:: figures/NANOSHEAR-profiles-dm.png
483+
:class: only-dark
484+
:alt: Velocity profiles for the elecrolyte
485+
486+
.. figure:: figures/NANOSHEAR-profiles.png
487+
:class: only-light
488+
:alt: Velocity profiles for the elecrolyte
489+
490+
.. container:: figurelegend
472491

492+
Velocity profiles for water (blue) and walls (orange) along the :math:`z`-axis.
473493

474494
Finally, let us generate images of the systems and print the values of the
475495
forces exerted by the fluid on the walls, as given by ``f_mysf1[1]``

docs/sphinx/source/tutorial5/tutorial.rst

+40-12
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,38 @@ such as dangling oxygen groups (Fig.~\ref{fig:SIO-slice}).
130130
Finally, the generated **.histo** files can be used to
131131
plot the probability distributions, :math:`P(q)` (see Fig.~\ref{fig:SIO-distribution}\,a).
132132

133-
FIGURE SIO-charge a) Average charge per atom of the silicon, :math:`q_\text{Si}`, atoms as
134-
a function of time, :math:`t`, during equilibration of the :math:`\text{SiO}_2` system.
135-
b) Volume of the system, :math:`V`, as a function of :math:`t`.
133+
.. figure:: figures/SIO-charge-dm.png
134+
:class: only-dark
135+
:alt: Average charge per atom of the silicon
136+
137+
.. figure:: figures/SIO-charge.png
138+
:class: only-light
139+
:alt: Average charge per atom of the silicon
140+
141+
.. container:: figurelegend
142+
143+
a) Average charge per atom of the silicon, :math:`q_\text{Si}`, atoms as
144+
a function of time, :math:`t`, during equilibration of the :math:`\text{SiO}_2`
145+
system. b) Volume of the system, :math:`V`, as a function of :math:`t`.
136146

137147
FIGURE SIO-slice A slice of the amorphous silica, where atoms are colored by their charges.
138148
Dangling oxygen groups appear in greenish, bulk Si atoms with a charge of about
139149
:math:`1.8~\text{e}` appear in red/orange, and bulk O atoms with a charge of about
140150
:math:`-0.9~\text{e}` appear in blue.
141151

142-
FIGURE SIO-distribution a) Probability distributions of charge of silicon (positive, blue) and oxygen
143-
(negative, orange) atoms during the equilibration of the :math:`\text{SiO}_2` system
144-
from \hyperref[reactive-silicon-dioxide-label]{Tutorial 5}. b) Same probability distributions
145-
as in panel (a) after the deformation.
152+
.. figure:: figures/SIO-distribution-dm.png
153+
:class: only-dark
154+
:alt: Average charge per atom of the silicon
155+
156+
.. figure:: figures/SIO-distribution.png
157+
:class: only-light
158+
:alt: Average charge per atom of the silicon
159+
160+
.. container:: figurelegend
161+
162+
a) Probability distributions of charge of silicon (positive, blue) and oxygen
163+
(negative, orange) atoms during the equilibration of the :math:`\text{SiO}_2`
164+
system. b) Same probability distributions as in panel (a) after the deformation.
146165

147166
Deform the structure
148167
--------------------
@@ -192,12 +211,21 @@ Nosé-Hoover thermostat without a barostat:
192211
Here, no barostat is used because the change in the box volume will be imposed
193212
by the ``fix deform``.
194213

195-
ADD FIGURE SIO-deformed-charge a) Average charge per atom of the silicon, :math:`q_\text{Si}`, atoms as
196-
a function of time, :math:`t`, during deformation of the :math:`\text{SiO}_2` system.
197-
The break down of the
198-
silica structure occurs near :math:`t = 11`\,ps. b) Temperature, :math:`T`, of the
199-
system as a function of :math:`t`.
214+
.. figure:: figures/SIO-deformed-charge-dm.png
215+
:class: only-dark
216+
:alt: Evolution of the pressure and distance for the elecrolyte
217+
218+
.. figure:: figures/SIO-deformed-charge.png
219+
:class: only-light
220+
:alt: Evolution of the pressure and distance for the elecrolyte
221+
222+
.. container:: figurelegend
200223

224+
a) Average charge per atom of the silicon, :math:`q_\text{Si}`, atoms as
225+
a function of time, :math:`t`, during deformation of the :math:`\text{SiO}_2` system.
226+
The break down of the
227+
silica structure occurs near :math:`t = 11`\,ps. b) Temperature, :math:`T`, of the
228+
system as a function of :math:`t`.
201229

202230
Let us run for 5000 steps without deformation, then apply the ``fix deform``
203231
to progressively elongate the box along the :math:`x`-axis during 25000 steps. Add

docs/sphinx/source/tutorial6/tutorial.rst

+24-5
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,19 @@ Here, an anisotropic barostat is used.
104104
Anisotropic barostats adjust the dimensions independently, which is
105105
generally suitable for a solid phase.
106106

107-
FIGURE GCMC-dimension a) Temperature, :math:`T`, as a function of time, :math:`t`, during the annealing
108-
of the silica system.
109-
b) System density, :math:`\rho`, during the annealing process. The vertical dashed lines
110-
mark the transition between the different phases of the simulation.
107+
.. figure:: figures/GCMC-dimension-dm.png
108+
:class: only-dark
109+
:alt: Temperature and density of the silicon
110+
111+
.. figure:: figures/GCMC-dimension.png
112+
:class: only-light
113+
:alt: Temperature and density of the silicon
114+
115+
.. container:: figurelegend
116+
117+
a) Temperature, :math:`T`, as a function of time, :math:`t`, during the annealing
118+
of the silica system. b) System density, :math:`\rho`, during the annealing process. The vertical dashed lines
119+
mark the transition between the different phases of the simulation.
111120

112121
Run the simulation using LAMMPS. From the ``Charts`` window, the temperature
113122
evolution can be observed, showing that it closely follows the desired annealing procedure (Fig.~\ref{fig:GCMC-dimension}\,a).
@@ -384,7 +393,17 @@ Finally, let us print some information and run for 25 ps:
384393
385394
run 25000
386395
387-
ADD FIGURE GCMC-number Number of water molecules, :math:`N_\text{H2O}`, as a function of time, :math:`t`.
396+
.. figure:: figures/GCMC-number-dm.png
397+
:class: only-dark
398+
:alt: Number of water molecules from GCMC somulations
399+
400+
.. figure:: figures/GCMC-number.png
401+
:class: only-light
402+
:alt: Number of water molecules from GCMC somulations
403+
404+
.. container:: figurelegend
405+
406+
Number of water molecules, :math:`N_\text{H2O}`, as a function of time, :math:`t`.
388407

389408
Running this simulation using LAMMPS, one can see that the number of molecules is increasing
390409
progressively. When using the pressure argument, LAMMPS ignores the value of the

0 commit comments

Comments
 (0)