Skip to content

Commit d9dc859

Browse files
committed
added figure to tutorial 1
1 parent a8fcda8 commit d9dc859

File tree

9 files changed

+376
-22
lines changed

9 files changed

+376
-22
lines changed

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
[submodule "dependencies/.github"]
22
path = dependencies/.github
33
url = git@github.com:lammpstutorials/.github.git
4+
[submodule "dependencies/lammpstutorials-inputs"]
5+
path = dependencies/lammpstutorials-inputs
6+
url = git@github.com:lammpstutorials/lammpstutorials-inputs.git
7+
branch = restructure
8+
[submodule "dependencies/pyplot-perso"]
9+
path = dependencies/pyplot-perso
10+
url = git@github.com:simongravelle/pyplot-perso.git
11+
branch = LAMMPS-livecom
12+
Submodule lammpstutorials-inputs added at fafbf74

dependencies/pyplot-perso

Submodule pyplot-perso added at 0cedb1c

docs/sphinx/source/shared/cite.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
If you find these tutorials useful, you can
2-
cite *A Set of Tutorials for the LAMMPS Simulation Package* by Simon Gravelle,
3-
Jacob R. Gissinger, and Axel Kohlmeyer (2025) :cite:`gravelle2025tutorials`. You
4-
can access the full paper on |gravelle2025tutorials_arXiv|.
1+
.. admonition:: Cite
2+
:class: non-title-info
3+
4+
If you find these tutorials useful, you can
5+
cite *A Set of Tutorials for the LAMMPS Simulation Package* by Simon Gravelle,
6+
Jacob R. Gissinger, and Axel Kohlmeyer (2025) :cite:`gravelle2025tutorials`. You
7+
can access the full paper on |gravelle2025tutorials_arXiv|.
58

69
.. |gravelle2025tutorials_arXiv| raw:: html
710

82.6 KB
Loading
82.6 KB
Loading

docs/sphinx/source/tutorial1/figures/improved.md.ipynb

Lines changed: 162 additions & 0 deletions
Large diffs are not rendered by default.

docs/sphinx/source/tutorial1/figures/initial.ipynb

Lines changed: 166 additions & 0 deletions
Large diffs are not rendered by default.

docs/sphinx/source/tutorial1/tutorial.rst

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ boundaries, different options can be assigned to each dimension, making
7777
configurations like *boundary p p fm* valid for systems such as
7878
slab geometries.
7979

80-
.. admonition:: Test
80+
.. admonition:: Note
8181
:class: non-title-info
8282

8383
Strictly speaking, none of the four commands specified in the
@@ -95,8 +95,6 @@ should prompt your web browser to open the corresponding URL for the
9595
online manual. A screenshot of this context menu is shown in
9696
Fig. INCLUDE FIGURE
9797

98-
**************************************
99-
10098
The next step is to create the simulation box and populate it with
10199
atoms. Modify the *System definition* category of
102100
*initial.lmp* as shown below:
@@ -183,7 +181,7 @@ of type 2, :math:`\epsilon_{22} = 0.5`, and :math:`\sigma_{22} = 3.0`.
183181
:math:`\sigma_{12} = \sqrt{1.0 \times 3.0} = 1.732`.
184182

185183
Single-point energy
186-
^^^^^^^^^^^^^^^^^^^
184+
-------------------
187185

188186
The system is now fully parameterized, and the input is ready to compute
189187
forces. Let us complete the two remaining categories,
@@ -215,21 +213,21 @@ as specified by the thermodynamic data request. Since no actual simulation
215213
steps were performed, the *Charts* window will be empty.
216214

217215
Snapshot Image
218-
^^^^^^^^^^^^^^
216+
--------------
219217

220218
At this point, you can create a snapshot image of the current system
221219
using the *Image Viewer* window, which can be accessed by
222220
clicking the *Create Image* button in the *Run* menu. The
223221
image viewer works by instructing LAMMPS to render an image of the
224-
current system using its internal rendering library via the *dump
225-
image* command. The resulting image is then displayed, with various
222+
current system using its internal rendering library via the *dump image*
223+
command. The resulting image is then displayed, with various
226224
buttons available to adjust the view and rendering style. The image
227225
shown in Fig. INSERT FIGURE was created this way. This will always
228226
capture the current state of the system. Save the image for future
229227
comparisons.
230228

231229
Energy minimization
232-
^^^^^^^^^^^^^^^^^^^
230+
-------------------
233231

234232
Now, replace the *run 0 post no* command line with the
235233
following *minimize* command:
@@ -243,7 +241,7 @@ This tells LAMMPS to perform an energy minimization of the system.
243241
Specifically, LAMMPS will compute the forces on all atoms and then update their
244242
positions according to a selected algorithm, aiming to reduce
245243
the potential energy. By default, LAMMPS uses the conjugate gradient (CG)
246-
algorithm~:cite:`hestenes1952methods`. The simulation will stop as soon
244+
algorithm :cite:`hestenes1952methods`. The simulation will stop as soon
247245
as the minimizer algorithm cannot find a way to lower the potential
248246
energy. Note that, except for trivial systems, minimization algorithms will find a
249247
local minimum rather than the global minimum.
@@ -277,7 +275,7 @@ that the atoms are *clumping together* as they move toward positions
277275
of lower potential energy.
278276

279277
Molecular dynamics
280-
^^^^^^^^^^^^^^^^^^
278+
------------------
281279

282280
After energy minimization, any overlapping atoms are displaced, and
283281
the system is ready for a molecular dynamics simulation. To continue
@@ -366,22 +364,36 @@ change it to perform statistically independent simulations. In the
366364
presence of a thermostat, the MD simulation will be performed in the
367365
canonical or NVT ensemble.
368366

369-
INSERT FIGURE
370-
371367
Run the simulation again using LAMMPS--GUI. From the information
372368
printed in the *Output* window, one can see that the temperature
373369
starts from 0 but rapidly reaches the requested value and
374370
stabilizes itself near :math:`T=1` temperature units. One can also observe that
375371
the potential energy, :math:`U`, rapidly decreases during energy
376-
minimization (see also Fig. fig:evolution-energy INSERT FIGURE). After
372+
minimization (see the figure below). After
377373
the molecular dynamics simulation starts, :math:`U` increases until
378374
it reaches a plateau value of about -0.25. The kinetic energy,
379375
:math:`K`, is equal to zero during energy minimization and then
380376
increases rapidly during molecular dynamics until it reaches
381-
a plateau value of about 1.5 (Fig. fig:evolution-energy INSERT FIGURE).
377+
a plateau value of about 1.5.
378+
379+
.. figure:: figures/LJ-energy-dm.png
380+
:class: only-dark
381+
:alt: Evolution of the Lennard-Jones fluid energy
382+
383+
.. figure:: figures/LJ-energy.png
384+
:class: only-light
385+
:alt: Evolution of the Lennard-Jones fluid energy
386+
387+
.. container:: figurelegend
388+
389+
(a) Potential energy, :math:`U`, of the binary mixture as a function of the
390+
step during energy minimization.
391+
(b) Potential energy, :math:`U`, as a function of time, :math:`t`, during molecular dynamics in
392+
the NVT ensemble. (c) Kinetic energy, :math:`K`, during energy minimization.
393+
(d) Kinetic energy, :math:`K`, during molecular dynamics.
382394

383395
Trajectory visualization
384-
^^^^^^^^^^^^^^^^^^^^^^^^
396+
------------------------
385397

386398
So far, the simulation has been mostly monitored through the analysis of
387399
thermodynamic information. To better follow the evolution of the system
@@ -423,14 +435,14 @@ options of the *dump image* command. For instance, the value for the
423435
the *view* and *zoom* keywords adjust the camera (and so on).
424436

425437
Improving the script
426-
--------------------
438+
====================
427439

428440
Let us improve the input script and perform more advanced operations,
429441
such as specifying initial positions for the atoms and restarting the
430442
simulation from a previously saved configuration.
431443

432444
Control the initial atom positions
433-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
445+
----------------------------------
434446

435447
Open the *improved.min.lmp*, which was downloaded during the
436448
tutorial setup. This file contains the *Part A* of the
@@ -529,7 +541,7 @@ stored internally in LAMMPS.
529541
copy of the data file that works regardless of your LAMMPS version and platform.
530542

531543
Restarting from a saved configuration
532-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
544+
-------------------------------------
533545

534546
To continue a simulation from the saved configuration, open the
535547
*improved.md.lmp* file, which was downloaded during the tutorial setup.

0 commit comments

Comments
 (0)