Skip to content

Commit cc9ffb6

Browse files
committed
fixed tutorials 1 2 and 7
1 parent 93b1ece commit cc9ffb6

File tree

3 files changed

+40
-26
lines changed

3 files changed

+40
-26
lines changed

docs/sphinx/source/tutorial1/tutorial.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ file in a text editor of your choice, and copy the following into it:
3131
the LAMMPS--GUI Editor window.
3232

3333
Everything that appears after a hash symbol (#) is a comment
34-
and ignored by LAMMPS.
35-
.. LAMMPS-GUI will color such comments in red.
36-
These five categories are not required in every input script an do not
34+
and ignored by LAMMPS. These five categories are not required in every input script an do not
3735
necessarily need to be in that exact order. For instance, the ``Settings``
3836
and the ``Visualization`` categories could be inverted, or
3937
the ``Visualization`` category could be omitted. However, note that

docs/sphinx/source/tutorial2/tutorial.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,6 @@ that starts at :math:`2 \, \text{Å}` from the CNT edges:
208208
The ``delete_atoms`` command randomly deletes :math:`2\,\%` of the atoms from
209209
the ``rdel`` group, here about 10 atoms.
210210

211-
ADD FIGURE -- The unbreakable CNT before the removal of atoms (top),
212-
after the removal of 10 atoms from the *rmid*
213-
region (middle), and after deformation (bottom).
214-
215211
The molecular dynamics
216212
----------------------
217213

@@ -242,7 +238,7 @@ The ``fix nve`` commands are applied to the atoms of ``cnt_top`` and
242238
``cnt_bot``, respectively, and will ensure that the positions of the atoms
243239
from these groups are recalculated at every step. The ``fix nvt`` does the
244240
same for the ``cnt_mid`` group, while also applying a Nosé-Hoover thermostat
245-
with desired temperature of 300\,K :cite:`nose1984unified, hoover1985canonical`.
241+
with desired temperature of 300 K :cite:`nose1984unified, hoover1985canonical`.
246242
To restrain the motion of the atoms at the edges, let us add the following
247243
commands to **unbreakable.lmp**:
248244

@@ -312,11 +308,21 @@ command in **unbreakable.lmp** with the following lines:
312308
With the ``thermo_modify`` command, we specify to LAMMPS that the
313309
temperature :math:`T_\mathrm{mid}` of the middle group, ``cnt_mid``,
314310
must be outputted, instead of the temperature of the entire system.
315-
This choice is motivated by the presence of frozen parts with an effective temperature of :math:`0 \text{K}`,
311+
This choice is motivated by the presence of frozen parts with an effective temperature of :math:`0~\text{K}`,
316312
which makes the average temperature of the entire system less relevant.
317313
The ``thermo_modify`` command also imposes the use of the YAML format that can easily be read by
318314
Python (see below).
319315

316+
.. figure:: figures/colored-edge-def-dark.png
317+
:class: only-dark
318+
:alt: Evolution of the CNT energy
319+
320+
.. figure:: figures/colored-edge-def-light.png
321+
:class: only-light
322+
:alt: Evolution of the CNT energy
323+
324+
The unbreakable CNT before (top) and after deformation (bottom).
325+
320326
Let us impose a constant velocity deformation on the CNT
321327
by combining the ``velocity set`` command with previously defined
322328
``fix setforce``. Add the following lines in the **unbreakable.lmp**

docs/sphinx/source/tutorial7/tutorial.rst

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ favorable area to explore.
3030
Basic LAMMPS parameters
3131
-----------------------
3232

33-
Create a folder if needed and
34-
place the initial input file, **free-energy.lmp**, into it. Then, open the
35-
file in a text editor of your choice, and copy the following into it:
33+
To begin this tutorial, if you are using LAMMPS--GUI, select ``Start Tutorial 7``
34+
from the ``Tutorials`` menu and follow the instructions. Alternatively, if you are
35+
not using LAMMPS--GUI, create a new folder and add a file named
36+
**free-energy.lmp**. Open the file in a text editor and paste in the following
37+
content:
3638

3739
.. code-block:: lammps
3840
@@ -48,12 +50,6 @@ file in a text editor of your choice, and copy the following into it:
4850
pair_modify shift yes
4951
boundary p p p
5052
51-
.. admonition:: If you are using LAMMPS-GUI
52-
:class: gui
53-
54-
To begin this tutorial, select ``Start Tutorial 7`` from the
55-
``Tutorials`` menu of LAMMPS--GUI and follow the instructions.
56-
5753
Here, we begin by defining variables for the Lennard-Jones interaction
5854
:math:`\sigma` and :math:`\epsilon` and for the repulsive potential
5955
:math:`U`, which are :math:`U_0`, :math:`\delta`, and
@@ -152,10 +148,18 @@ referred to as ``mymes``, using the ``n_center`` variable:
152148
thermo_style custom step temp etotal v_n_center
153149
thermo 10000
154150
155-
dump viz all image 50000 myimage-*.ppm type type shiny 0.1 box yes 0.01 view 180 90 zoom 6 size 1600 500 fsaa yes
156-
dump_modify viz backcolor white acolor 1 cyan adiam 1 3 boxcolor black
151+
For visualization, use one of the following options: the ``dump image`` command to
152+
create .ppm images of the system, or the ``dump atom`` command to write a
153+
VMD-compatible trajectory to a file:
154+
155+
.. code-block:: lammps
156+
157+
# Option 1
158+
dump viz1 all image 50000 myimage-*.ppm type type shiny 0.1 box yes 0.01 view 180 90 zoom 6 size 1600 500 fsaa yes
159+
dump_modify viz1 backcolor white acolor 1 cyan adiam 1 3 boxcolor black
157160
158-
A ``dump image`` command was also added for system visualization.
161+
# Option 2
162+
dump viz2 all atom 50000 free-energy.lammpstrj
159163
160164
Finally, let us perform an equilibration of 50000 steps,
161165
using a timestep of :math:`2\,\text{fs}`, corresponding to a total duration of :math:`100\,\text{ps}`:
@@ -213,6 +217,8 @@ LAMMPS.
213217
:class: only-light
214218
:alt: Density from umbrella sampling simulations
215219

220+
.. container:: figurelegend
221+
216222
Figure: Snapshot of the system simulated during the free sampling step of the tutorial.
217223
The atoms density is the lowest in the central part of the box, ``mymes``. Here,
218224
:math:`U_0 = 0.36~\text{kcal/mol}`, :math:`\delta = 1.0~\text{Å}`, and :math:`x_0 = 10~\text{Å}`.
@@ -279,8 +285,9 @@ unbiased free energy profile.
279285
LAMMPS input script
280286
-------------------
281287

282-
Open the file named **umbrella-sampling.lmp**, which should
283-
contain the following lines:
288+
If you are using LAMMPS--GUI, open the file named **free-energy.lmp**.
289+
Alternatively, if you are not using LAMMPS--GUI, create a new input file
290+
and paste in the following content:
284291

285292
.. code-block:: lammps
286293
@@ -341,9 +348,12 @@ umbrella sampling run:
341348
342349
thermo 5000
343350
344-
dump viz all image 50000 myimage-*.ppm type type shiny 0.1 box yes 0.01 view 180 90 zoom 6 size 1600 500 fsaa yes
345-
dump_modify viz backcolor white acolor 1 cyan &
346-
acolor 2 red adiam 1 3 adiam 2 3 boxcolor black
351+
# Option 1
352+
dump viz1 all image 50000 myimage-*.ppm type type shiny 0.1 box yes 0.01 view 180 90 zoom 6 size 1600 500 fsaa yes
353+
dump_modify viz1 backcolor white acolor 1 cyan acolor 2 red adiam 1 3 adiam 2 3 boxcolor black
354+
355+
# Option 2
356+
dump viz2 all atom 50000 free-energy.lammpstrj
347357
348358
timestep 2.0
349359
run 50000

0 commit comments

Comments
 (0)