@@ -17,7 +17,7 @@ file **initial.lmp** in it, and open the file in the LAMMPS--GUI Editor window:
17
17
# 1) Initialization
18
18
# 2) System definition
19
19
# 3) Settings
20
- # 4) Visualization
20
+ # 4) Monitoring
21
21
# 5) Run
22
22
23
23
.. admonition :: If you are not using LAMMPS-GUI
@@ -31,8 +31,8 @@ file **initial.lmp** in it, and open the file in the LAMMPS--GUI Editor window:
31
31
Everything that appears after a hash symbol (#) is a comment
32
32
and ignored by LAMMPS. These five categories are not required in every input script an do not
33
33
necessarily need to be in that exact order. For instance, the ``Settings ``
34
- and the ``Visualization `` categories could be inverted, or
35
- the ``Visualization `` category could be omitted. However, note that
34
+ and the ``Monitoring `` categories could be inverted, or
35
+ the ``Monitoring `` category could be omitted. However, note that
36
36
LAMMPS reads input files from top to bottom and processes each command
37
37
*immediately *. Therefore, the ``Initialization `` and
38
38
``System definition `` categories must appear at the top of the
@@ -61,6 +61,15 @@ so that the ``Initialization`` section appears as follows:
61
61
atom_style atomic
62
62
boundary p p p
63
63
64
+ .. admonition :: Note
65
+ :class: non-title-info
66
+
67
+ Strictly speaking, none of the four commands specified in the
68
+ ``Initialization `` section are mandatory, as they correspond to the
69
+ default settings for their respective global properties. However,
70
+ explicitly specifying these defaults is considered good practice to
71
+ avoid confusion when sharing input files with other LAMMPS users.
72
+
64
73
The first line, ``units lj ``, specifies the use of *reduced *
65
74
units, where all quantities are dimensionless. This unit system is a
66
75
popular choice for simulations that explore general statistical
@@ -86,19 +95,20 @@ slab geometries.
86
95
.. admonition :: Note
87
96
:class: non-title-info
88
97
89
- Strictly speaking, none of the four commands specified in the
90
- ``Initialization `` section are mandatory, as they correspond to the
91
- default settings for their respective global properties. However,
92
- explicitly specifying these defaults is considered good practice to
93
- avoid confusion when sharing input files with other LAMMPS users.
98
+ Each LAMMPS command is accompanied by extensive online |lammpsdocs |
99
+ that details the different options for that command.
100
+ From the LAMMPS--GUI editor buffer, you can access the documentation by
101
+ right-clicking on a line containing a command (e.g., ``units lj ``)
102
+ and selecting ``View Documentation for `units' ``. This action
103
+ should prompt your web browser to open the corresponding URL for the
104
+ online manual.
94
105
95
- Each LAMMPS command is accompanied by extensive online |lammpsdocs |
96
- that details the different options for that command.
97
- From the LAMMPS--GUI editor buffer, you can access the documentation by
98
- right-clicking on a line containing a command (e.g., ``units lj ``)
99
- and selecting ``View Documentation for `units' ``. This action
100
- should prompt your web browser to open the corresponding URL for the
101
- online manual.
106
+ .. admonition :: Note
107
+ :class: non-title-info
108
+
109
+ Most LAMMPS commands have default settings that are applied if no value
110
+ is explicitly specified. The defaults for each command are listed at the
111
+ bottom of its documentation page.
102
112
103
113
.. |lammpsdocs | raw :: html
104
114
@@ -121,6 +131,9 @@ The first line, ``region simbox (...)``, defines a region named
121
131
from -20 to 20 units along all three spatial dimensions. The second
122
132
line, ``create_box 2 simbox ``, initializes a simulation box based
123
133
on the region ``simbox `` and reserves space for two types of atoms.
134
+ In LAMMPS, an atom *type * represents a group of atoms that
135
+ interact using the same set of force field parameters (here, the Lennard-Jones
136
+ parameters).
124
137
125
138
.. admonition :: Note
126
139
:class: non-title-info
@@ -132,8 +145,10 @@ on the region ``simbox`` and reserves space for two types of atoms.
132
145
terminate with an error.
133
146
134
147
The third line, ``create_atoms (...) ``, generates 1500 atoms of
135
- type 1 at random positions within the ``simbox `` region. The
136
- integer 34134 is a seed for the internal random number generator, which
148
+ type 1 at random positions within the ``simbox `` region. Each atom created in
149
+ LAMMPS is automatically assigned a unique atom ID, which serves as a numerical
150
+ identifier to distinguish individual atoms throughout the simulation
151
+ The integer 34134 is a seed for the internal random number generator, which
137
152
can be changed to produce different sequences of random numbers and,
138
153
consequently, different initial atom positions. The fourth line adds
139
154
100 atoms of type 2. Both ``create_atoms `` commands use the
@@ -142,6 +157,13 @@ distance of 0.3 units between the randomly placed atoms. This
142
157
constraint helps avoid close contacts between atoms, which can lead
143
158
to excessively large forces and simulation instability.
144
159
160
+ .. admonition :: Note
161
+ :class: non-title-info
162
+
163
+ Another way to define a system in LAMMPS, besides ``create_atoms ``, is to
164
+ import an existing topology with ``read_data ``, as shown
165
+ in :ref: `carbon-nanotube-label `.
166
+
145
167
.. include :: ../shared/needhelp.rst
146
168
147
169
Settings
@@ -189,19 +211,20 @@ of type 2, :math:`\epsilon_{22} = 0.5`, and :math:`\sigma_{22} = 3.0`.
189
211
types using geometric average: :math: `\epsilon _{ij} = \sqrt {\epsilon _{ii} \epsilon _{jj}}`,
190
212
:math: `\sigma _{ij} = \sqrt {\sigma _{ii} \sigma _{jj}}`. In the present case,
191
213
:math: `\epsilon _{12 } = \sqrt {1.0 \times 0.5 } = 0.707 `, and
192
- :math: `\sigma _{12 } = \sqrt {1.0 \times 3.0 } = 1.732 `.
214
+ :math: `\sigma _{12 } = \sqrt {1.0 \times 3.0 } = 1.732 `. Other rules
215
+ can be selected using the ``pair_modify `` command.
193
216
194
217
Single-point energy
195
218
-------------------
196
219
197
220
The system is now fully parameterized, and the input is ready to compute
198
221
forces. Let us complete the two remaining categories,
199
- ``Visualization `` and ``Run ``, by adding the following lines
222
+ ``Monitoring `` and ``Run ``, by adding the following lines
200
223
to **initial.lmp **:
201
224
202
225
.. code-block :: lammps
203
226
204
- # 4) Visualization
227
+ # 4) Monitoring
205
228
thermo 10
206
229
thermo_style custom step etotal press
207
230
# 5) Run
@@ -216,6 +239,12 @@ The ``run 0 post no`` command instructs LAMMPS to initialize forces and energy
216
239
without actually running the simulation. The ``post no `` option disables
217
240
the post-run summary and statistics output.
218
241
242
+ .. admonition :: Note
243
+ :class: non-title-info
244
+
245
+ The *thermodynamic information * printed by LAMMPS refers to instantaneous values
246
+ of thermodynamic properties at the specified steps, not cumulative averages.
247
+
219
248
You can now run LAMMPS (basic commands for running LAMMPS
220
249
are provided in :ref: `running-lammps-label `.
221
250
The simulation should finish quickly.
@@ -297,7 +326,7 @@ following lines immediately after the ``minimize`` command:
297
326
.. code-block :: lammps
298
327
299
328
# PART B - MOLECULAR DYNAMICS
300
- # 4) Visualization
329
+ # 4) Monitoring
301
330
thermo 50
302
331
thermo_style custom step temp etotal pe ke press
303
332
@@ -423,7 +452,7 @@ thermodynamic information. To better follow the evolution of the system
423
452
and visualize the trajectories of the atoms, let us print the positions
424
453
of the atoms in a file at a regular interval.
425
454
426
- Add the following command to the ``Visualization `` section
455
+ Add the following command to the ``Monitoring `` section
427
456
of ``PART B `` of the **initial.lmp ** file:
428
457
429
458
.. code-block :: lammps
@@ -440,7 +469,7 @@ and adjust the visualization to your liking using the available buttons.
440
469
Now you can copy the commands used to create this visualization to the
441
470
clipboard by either using the ``Ctrl-D `` keyboard shortcut or
442
471
selecting ``Copy dump image command `` from the ``File `` menu.
443
- This text can be pasted into the ``Visualization `` section
472
+ This text can be pasted into the ``Monitoring `` section
444
473
of ``PART B `` of the **initial.lmp ** file. This may look like
445
474
the following:
446
475
@@ -496,7 +525,7 @@ commands in the ``System definition`` section:
496
525
pair_style lj/cut 4.0
497
526
pair_coeff 1 1 1.0 1.0
498
527
pair_coeff 2 2 0.5 3.0
499
- # 4) Visualization
528
+ # 4) Monitoring
500
529
thermo 10
501
530
thermo_style custom step etotal press
502
531
# 5) Run
@@ -591,7 +620,7 @@ and **improved.min.lmp**:
591
620
boundary p p p
592
621
# 2) System definition
593
622
# 3) Settings
594
- # 4) Visualization
623
+ # 4) Monitoring
595
624
# 5) Run
596
625
597
626
Since we read most of the information from the data file, we don't need
@@ -696,7 +725,7 @@ Finally, let us complete the script by adding the following lines to
696
725
697
726
.. code-block :: lammps
698
727
699
- # 4) Visualization
728
+ # 4) Monitoring
700
729
thermo 1000
701
730
thermo_style custom step temp pe ke etotal press v_n1_in v_n2_in c_sumcoor12
702
731
dump viz all image 1000 myimage-*.ppm type type shiny 0.1 box no 0.01 view 0 0 zoom 1.8 fsaa yes size 800 800
0 commit comments