Skip to content

Commit ac51959

Browse files
committed
deploy: b170970
1 parent 314c842 commit ac51959

File tree

8 files changed

+77
-59
lines changed

8 files changed

+77
-59
lines changed
0 Bytes
Binary file not shown.
517 Bytes
Binary file not shown.
517 Bytes
Binary file not shown.

sphinx/build/html/_sources/tutorial4/tutorial.rst.txt

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ file in a text editor of your choice, and copy the following into it:
2323
kspace_style pppm/tip4p 1.0e-5
2424
kspace_modify slab 3.0
2525
26-
2726
.. admonition:: If you are using LAMMPS-GUI
2827
:class: gui
2928

@@ -32,8 +31,9 @@ file in a text editor of your choice, and copy the following into it:
3231
The editor should display the following content corresponding to **create.lmp**
3332

3433
These lines are used to define the most basic parameters, including the
35-
atom, bond, and angle styles, as well as the non-bonded interaction
36-
potential. Here, ``lj/cut/tip4p/long`` imposes a Lennard-Jones potential with
34+
atom style, the forms of the non-bonded,
35+
bond, and angle potentials, as well as other specifics of
36+
the non-bonded interactions. Here, ``lj/cut/tip4p/long`` imposes a Lennard-Jones potential with
3737
a cut-off at :math:`12\,\text{Å}` and a long-range Coulomb potential.
3838
The parameters ``O``, ``H``, ``O-H``, and ``H-O-H`` correspond
3939
respectively to the oxygens, hydrogens, O-H bonds, and H-O-H angle constraints of
@@ -82,7 +82,8 @@ along the :math:`x` direction. The ``create_box`` command creates a simulation
8282
and 1 type of angle (both required by the water molecules).
8383
The parameters for these bond and angle constraints will be given later. The ``extra (...)``
8484
keywords are for memory allocation. Finally, the ``labelmap`` commands assign
85-
alphanumeric type labels to each numeric atom type, bond type, and angle type.
85+
alphanumeric type labels to each numeric atom type, bond type, and angle type, concepts
86+
already introduced in previous tutorials.
8687

8788
Now, we can add atoms to the system. First, let us create two sub-regions corresponding
8889
respectively to the two solid walls, and create a larger region from the union of the
@@ -116,7 +117,7 @@ bonds, and angles. Add the following lines to **create.lmp**:
116117
117118
Within the last three lines, a ``region`` named ``rliquid`` is
118119
created based on the last defined lattice, ``fcc 4.04``. ``rliquid``
119-
will be used for depositing the water molecules. The ``molecule`` command
120+
will be used for introducing the water molecules. The ``molecule`` command
120121
opens up the molecule template called **water.mol**, and names the
121122
associated molecule ``h2omol``. The new molecules are placed on the
122123
``fcc 4.04`` lattice by the ``create_atoms`` command. The first
@@ -209,8 +210,9 @@ Finally, the **parameters.inc** file contains the following two lines:
209210
210211
The ``bond_coeff`` command, used here for the O-H bond of the water
211212
molecule, sets both the spring constant of the harmonic potential and the
212-
equilibrium bond distance of :math:`0.9572~\text{Å}`. The constant can be 0 for a
213-
rigid water molecule because the SHAKE algorithm will maintain the rigid
213+
equilibrium bond distance of :math:`0.9572~\text{Å}`. The force constant can be 0 for a
214+
rigid water molecule because the SHAKE algorithm which, will be used
215+
in the input at a later step, will constrain the intramolecular
214216
structure of the water molecule (see below) :cite:`ryckaert1977numerical, andersen1983rattle`.
215217
Similarly, the ``angle_coeff`` command for the H-O-H angle of the water molecule sets
216218
the force constant of the angular harmonic potential to 0 and the equilibrium
@@ -265,8 +267,8 @@ Finally, add the following lines into **create.lmp**:
265267
266268
write_data create.data nocoeff
267269
268-
The ``run 0`` command runs the simulation for 0 steps, which is sufficient for
269-
creating the system and saving its state. The ``write_data`` command
270+
The ``run 0`` command initializes the simulation, which is required for cleanly
271+
saving the state, but it does not advance positions or velocities. The ``write_data`` command
270272
generates a file called **system.data** containing the information required
271273
to restart the simulation from the final configuration produced by this input
272274
file. With the ``nocoeff`` option, the parameters from the force field are
@@ -322,7 +324,8 @@ The only difference from the previous input is that, instead of creating a new
322324
box and new atoms, we open the previously created **create.data** file.
323325

324326
Now, let us use the SHAKE algorithm to maintain the shape of the
325-
water molecules :cite:`ryckaert1977numerical, andersen1983rattle`.
327+
water molecules :cite:`ryckaert1977numerical, andersen1983rattle`
328+
by adding the following line to the script.
326329

327330
.. code-block:: lammps
328331
@@ -375,8 +378,8 @@ Let us equilibrate further the entire system by letting both fluid and wall
375378
relax at ambient temperature. Here, the commands are written within the same
376379
**equilibrate.lmp** file, right after the ``reset_timestep`` command.
377380

378-
Let us update the positions of all the atoms and use a Nosé-Hoover
379-
thermostat. Add the following lines to **equilibrate.lmp**:
381+
Let us do a molecular dynamics simulation using
382+
the Nosé-Hoover thermostat. Add the following lines to **equilibrate.lmp**:
380383

381384
.. code-block:: lammps
382385
@@ -555,9 +558,10 @@ and ``f_mysf2[1]``. Add these lines to **shearing.lmp**:
555558
thermo_style custom step temp etotal f_mysf1[1] f_mysf2[1]
556559
557560
Let us also extract the density and velocity profiles using
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
561+
the ``chunk/atom`` and ``ave/chunk`` commands. When deployed as
562+
below, these commands discretize the simulation domain
563+
into spatial bins and compute and output average proper-
564+
ties of the atoms belonging to each bin, here the velocity
561565
along :math:`x` (``vx``) within the bins. Add the following lines to **shearing.lmp**:
562566

563567
.. code-block:: lammps

sphinx/build/html/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sphinx/build/html/tutorial4/nanosheared-electrolyte.html

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ <h3>System generation<a class="headerlink" href="#system-generation" title="Link
331331
The editor should display the following content corresponding to <strong>create.lmp</strong></p>
332332
</div>
333333
<p>These lines are used to define the most basic parameters, including the
334-
atom, bond, and angle styles, as well as the non-bonded interaction
335-
potential. Here, <code class="docutils literal notranslate"><span class="pre">lj/cut/tip4p/long</span></code> imposes a Lennard-Jones potential with
334+
atom style, the forms of the non-bonded,
335+
bond, and angle potentials, as well as other specifics of
336+
the non-bonded interactions. Here, <code class="docutils literal notranslate"><span class="pre">lj/cut/tip4p/long</span></code> imposes a Lennard-Jones potential with
336337
a cut-off at <span class="math notranslate nohighlight">\(12\,\text{Å}\)</span> and a long-range Coulomb potential.
337338
The parameters <code class="docutils literal notranslate"><span class="pre">O</span></code>, <code class="docutils literal notranslate"><span class="pre">H</span></code>, <code class="docutils literal notranslate"><span class="pre">O-H</span></code>, and <code class="docutils literal notranslate"><span class="pre">H-O-H</span></code> correspond
338339
respectively to the oxygens, hydrogens, O-H bonds, and H-O-H angle constraints of
@@ -380,7 +381,8 @@ <h3>System generation<a class="headerlink" href="#system-generation" title="Link
380381
and 1 type of angle (both required by the water molecules).
381382
The parameters for these bond and angle constraints will be given later. The <code class="docutils literal notranslate"><span class="pre">extra</span> <span class="pre">(...)</span></code>
382383
keywords are for memory allocation. Finally, the <code class="docutils literal notranslate"><span class="pre">labelmap</span></code> commands assign
383-
alphanumeric type labels to each numeric atom type, bond type, and angle type.</p>
384+
alphanumeric type labels to each numeric atom type, bond type, and angle type, concepts
385+
already introduced in previous tutorials.</p>
384386
<p>Now, we can add atoms to the system. First, let us create two sub-regions corresponding
385387
respectively to the two solid walls, and create a larger region from the union of the
386388
two regions. Then, let us create atoms of type WALL within the two regions. Add the
@@ -404,7 +406,7 @@ <h3>System generation<a class="headerlink" href="#system-generation" title="Link
404406
</div>
405407
<p>Within the last three lines, a <code class="docutils literal notranslate"><span class="pre">region</span></code> named <code class="docutils literal notranslate"><span class="pre">rliquid</span></code> is
406408
created based on the last defined lattice, <code class="docutils literal notranslate"><span class="pre">fcc</span> <span class="pre">4.04</span></code>. <code class="docutils literal notranslate"><span class="pre">rliquid</span></code>
407-
will be used for depositing the water molecules. The <code class="docutils literal notranslate"><span class="pre">molecule</span></code> command
409+
will be used for introducing the water molecules. The <code class="docutils literal notranslate"><span class="pre">molecule</span></code> command
408410
opens up the molecule template called <strong>water.mol</strong>, and names the
409411
associated molecule <code class="docutils literal notranslate"><span class="pre">h2omol</span></code>. The new molecules are placed on the
410412
<code class="docutils literal notranslate"><span class="pre">fcc</span> <span class="pre">4.04</span></code> lattice by the <code class="docutils literal notranslate"><span class="pre">create_atoms</span></code> command. The first
@@ -476,8 +478,9 @@ <h3>System generation<a class="headerlink" href="#system-generation" title="Link
476478
</div>
477479
<p>The <code class="docutils literal notranslate"><span class="pre">bond_coeff</span></code> command, used here for the O-H bond of the water
478480
molecule, sets both the spring constant of the harmonic potential and the
479-
equilibrium bond distance of <span class="math notranslate nohighlight">\(0.9572~\text{Å}\)</span>. The constant can be 0 for a
480-
rigid water molecule because the SHAKE algorithm will maintain the rigid
481+
equilibrium bond distance of <span class="math notranslate nohighlight">\(0.9572~\text{Å}\)</span>. The force constant can be 0 for a
482+
rigid water molecule because the SHAKE algorithm which, will be used
483+
in the input at a later step, will constrain the intramolecular
481484
structure of the water molecule (see below) <span id="id5">[<a class="reference internal" href="../non-tutorials/bibliography.html#id27" title="Jean-Paul Ryckaert, Giovanni Ciccotti, and Herman JC Berendsen. Numerical integration of the cartesian equations of motion of a system with constraints: molecular dynamics of n-alkanes. Journal of computational physics, 23(3):327–341, 1977.">35</a>, <a class="reference internal" href="../non-tutorials/bibliography.html#id28" title="Hans C Andersen. Rattle: a “velocity” version of the shake algorithm for molecular dynamics calculations. Journal of computational Physics, 52(1):24–34, 1983.">36</a>]</span>.
482485
Similarly, the <code class="docutils literal notranslate"><span class="pre">angle_coeff</span></code> command for the H-O-H angle of the water molecule sets
483486
the force constant of the angular harmonic potential to 0 and the equilibrium
@@ -521,8 +524,8 @@ <h3>System generation<a class="headerlink" href="#system-generation" title="Link
521524
<span class="k">write_data </span><span class="nv nv-Identifier">create.data</span><span class="w"> </span><span class="n">nocoeff</span>
522525
</pre></div>
523526
</div>
524-
<p>The <code class="docutils literal notranslate"><span class="pre">run</span> <span class="pre">0</span></code> command runs the simulation for 0 steps, which is sufficient for
525-
creating the system and saving its state. The <code class="docutils literal notranslate"><span class="pre">write_data</span></code> command
527+
<p>The <code class="docutils literal notranslate"><span class="pre">run</span> <span class="pre">0</span></code> command initializes the simulation, which is required for cleanly
528+
saving the state, but it does not advance positions or velocities. The <code class="docutils literal notranslate"><span class="pre">write_data</span></code> command
526529
generates a file called <strong>system.data</strong> containing the information required
527530
to restart the simulation from the final configuration produced by this input
528531
file. With the <code class="docutils literal notranslate"><span class="pre">nocoeff</span></code> option, the parameters from the force field are
@@ -569,7 +572,8 @@ <h3>Energy minimization<a class="headerlink" href="#energy-minimization" title="
569572
<p>The only difference from the previous input is that, instead of creating a new
570573
box and new atoms, we open the previously created <strong>create.data</strong> file.</p>
571574
<p>Now, let us use the SHAKE algorithm to maintain the shape of the
572-
water molecules <span id="id6">[<a class="reference internal" href="../non-tutorials/bibliography.html#id27" title="Jean-Paul Ryckaert, Giovanni Ciccotti, and Herman JC Berendsen. Numerical integration of the cartesian equations of motion of a system with constraints: molecular dynamics of n-alkanes. Journal of computational physics, 23(3):327–341, 1977.">35</a>, <a class="reference internal" href="../non-tutorials/bibliography.html#id28" title="Hans C Andersen. Rattle: a “velocity” version of the shake algorithm for molecular dynamics calculations. Journal of computational Physics, 52(1):24–34, 1983.">36</a>]</span>.</p>
575+
water molecules <span id="id6">[<a class="reference internal" href="../non-tutorials/bibliography.html#id27" title="Jean-Paul Ryckaert, Giovanni Ciccotti, and Herman JC Berendsen. Numerical integration of the cartesian equations of motion of a system with constraints: molecular dynamics of n-alkanes. Journal of computational physics, 23(3):327–341, 1977.">35</a>, <a class="reference internal" href="../non-tutorials/bibliography.html#id28" title="Hans C Andersen. Rattle: a “velocity” version of the shake algorithm for molecular dynamics calculations. Journal of computational Physics, 52(1):24–34, 1983.">36</a>]</span>
576+
by adding the following line to the script.</p>
573577
<div class="highlight-lammps notranslate"><div class="highlight"><pre><span></span><span class="k">fix </span><span class="nv nv-Identifier">myshk</span><span class="w"> </span><span class="nv nv-Identifier">H2O</span><span class="w"> </span><span class="n">shake</span><span class="w"> </span><span class="m">1.0e-5</span><span class="w"> </span><span class="m">200</span><span class="w"> </span><span class="m">0</span><span class="w"> </span><span class="n">b</span><span class="w"> </span><span class="n">O</span><span class="o">-</span><span class="n">H</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">H</span><span class="o">-</span><span class="n">O</span><span class="o">-</span><span class="n">H</span><span class="w"> </span><span class="n">kbond</span><span class="w"> </span><span class="m">2000</span>
574578
</pre></div>
575579
</div>
@@ -612,8 +616,8 @@ <h3>System equilibration<a class="headerlink" href="#system-equilibration" title
612616
<p>Let us equilibrate further the entire system by letting both fluid and wall
613617
relax at ambient temperature. Here, the commands are written within the same
614618
<strong>equilibrate.lmp</strong> file, right after the <code class="docutils literal notranslate"><span class="pre">reset_timestep</span></code> command.</p>
615-
<p>Let us update the positions of all the atoms and use a Nosé-Hoover
616-
thermostat. Add the following lines to <strong>equilibrate.lmp</strong>:</p>
619+
<p>Let us do a molecular dynamics simulation using
620+
the Nosé-Hoover thermostat. Add the following lines to <strong>equilibrate.lmp</strong>:</p>
617621
<div class="highlight-lammps notranslate"><div class="highlight"><pre><span></span><span class="k">fix </span><span class="nv nv-Identifier">mynvt</span><span class="w"> </span><span class="nv nv-Identifier">all</span><span class="w"> </span><span class="n">nvt</span><span class="w"> </span><span class="n">temp</span><span class="w"> </span><span class="m">300</span><span class="w"> </span><span class="m">300</span><span class="w"> </span><span class="m">100</span>
618622
<span class="k">fix </span><span class="nv nv-Identifier">myshk</span><span class="w"> </span><span class="nv nv-Identifier">H2O</span><span class="w"> </span><span class="n">shake</span><span class="w"> </span><span class="m">1.0e-5</span><span class="w"> </span><span class="m">200</span><span class="w"> </span><span class="m">0</span><span class="w"> </span><span class="n">b</span><span class="w"> </span><span class="n">O</span><span class="o">-</span><span class="n">H</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">H</span><span class="o">-</span><span class="n">O</span><span class="o">-</span><span class="n">H</span>
619623
<span class="k">fix </span><span class="nv nv-Identifier">myrct</span><span class="w"> </span><span class="nv nv-Identifier">all</span><span class="w"> </span><span class="n">recenter</span><span class="w"> </span><span class="n">NULL</span><span class="w"> </span><span class="n">NULL</span><span class="w"> </span><span class="m">0</span>
@@ -764,9 +768,10 @@ <h3>Imposed shearing<a class="headerlink" href="#imposed-shearing" title="Link t
764768
</pre></div>
765769
</div>
766770
<p>Let us also extract the density and velocity profiles using
767-
the <code class="docutils literal notranslate"><span class="pre">chunk/atom</span></code> and <code class="docutils literal notranslate"><span class="pre">ave/chunk</span></code> commands. These
768-
commands discretize the simulation domain into spatial bins and compute and output
769-
average properties of the atoms belonging to each bin, here the velocity
771+
the <code class="docutils literal notranslate"><span class="pre">chunk/atom</span></code> and <code class="docutils literal notranslate"><span class="pre">ave/chunk</span></code> commands. When deployed as
772+
below, these commands discretize the simulation domain
773+
into spatial bins and compute and output average proper-
774+
ties of the atoms belonging to each bin, here the velocity
770775
along <span class="math notranslate nohighlight">\(x\)</span> (<code class="docutils literal notranslate"><span class="pre">vx</span></code>) within the bins. Add the following lines to <strong>shearing.lmp</strong>:</p>
771776
<div class="highlight-lammps notranslate"><div class="highlight"><pre><span></span><span class="k">compute </span><span class="nv nv-Identifier">cc1</span><span class="w"> </span><span class="nv nv-Identifier">H2O</span><span class="w"> </span><span class="n">chunk</span><span class="o">/</span><span class="n">atom</span><span class="w"> </span><span class="n">bin</span><span class="o">/</span><span class="m">1</span><span class="n">d</span><span class="w"> </span><span class="n">z</span><span class="w"> </span><span class="m">0.0</span><span class="w"> </span><span class="m">0.25</span>
772777
<span class="k">compute </span><span class="nv nv-Identifier">cc2</span><span class="w"> </span><span class="nv nv-Identifier">wall</span><span class="w"> </span><span class="n">chunk</span><span class="o">/</span><span class="n">atom</span><span class="w"> </span><span class="n">bin</span><span class="o">/</span><span class="m">1</span><span class="n">d</span><span class="w"> </span><span class="n">z</span><span class="w"> </span><span class="m">0.0</span><span class="w"> </span><span class="m">0.25</span>

0 commit comments

Comments
 (0)