Skip to content

Commit

Permalink
deploy: 89e9a3a
Browse files Browse the repository at this point in the history
  • Loading branch information
simongravelle committed Jun 18, 2024
1 parent 70d5645 commit 04cc53e
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 128 deletions.
Binary file modified sphinx/build/doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ Pulling on a carbon nanotube

In this tutorial, a small carbon nanotube (CNT) is simulated
within an empty box using LAMMPS. An external
forcing is imposed on the CNT, and its deformation is measured with time.
force is imposed on the CNT, and its deformation is measured over time.

.. container:: abstract

The difference between classical and reactive force fields
is illustrated in this tutorial. With a classical force field, the bonds
between atoms are unbreakable. With the reactive
force field (named AIREBO :cite:`stuart2000reactive`),
the breaking of the chemical bonds is possible when
the imposed deformation is strong enough.
To illustrate the difference between classical and reactive force fields,
this tutorial is divided into two parts. Within the first part, a classical
force field is used and the bonds between the atoms of the CNT are
unbreakable. Within the second part, a reactive force field
(named AIREBO :cite:`stuart2000reactive`) is used, allowing for the breaking
of chemical bonds when the CNT undergoes strong deformation.

.. include:: ../../non-tutorials/recommand-lj.rst

Expand Down Expand Up @@ -240,8 +240,7 @@ The LAMMPS input
Atoms connected by a bond do not typically interact through
Lennard-Jones interaction. Therefore, atoms that are
bounded must be excluded from the Lennard-Jones potential calculation.
Here, this is done by the
*special_bonds* command. The three numbers of the
Here, this is done by the *special_bonds* command. The three numbers of the
*special_bonds* command are weighting factors for the
Lennard-Jones interaction between atoms connected by a bond
(respectively directly bounded :math:`C-C`, separated by two bonds :math:`C-C-C`,
Expand Down Expand Up @@ -296,8 +295,8 @@ The LAMMPS input
include parm.lammps
Prepare initial state
---------------------
Prepare the initial state
-------------------------

.. container:: justify

Expand Down Expand Up @@ -374,15 +373,18 @@ Prepare initial state
The variable :math:`z_\mathrm{max}` corresponds to
the coordinate of the last atoms along :math:`z` minus 0.5
Ångstroms, and :math:`z_\mathrm{min}` to the coordinate of
the first atoms along :math:`z` plus 0.5 Ångstroms. Then, 3
regions are defined, and correspond respectively to: :math:`z < z_\mathrm{min}`, (bottom)
:math:`z_\mathrm{min} > z > z_\mathrm{max}` (middle), and
:math:`z > z_\mathrm{max}` (top).
the first atoms along :math:`z` plus 0.5 Ångstroms. Then, three
regions are defined, and correspond respectively to: :math:`z < z_\mathrm{min}`,
(*rbot*, for region bottom)
:math:`z_\mathrm{min} > z > z_\mathrm{max}`
(*rmid*, for region middle), and
:math:`z > z_\mathrm{max}`
(*rtop*, for region top).

.. container:: justify

Finally, let us define 3 groups of atoms
corresponding to the atoms located in each of the 3 regions,
corresponding to the atoms located in each of the three regions,
respectively, by adding to *input.lammps*:

.. code-block:: lammps
Expand Down Expand Up @@ -423,7 +425,8 @@ Prepare initial state
.. container:: justify

Finally, let us randomly delete some of the carbon atoms.
Finally, to start from a less ideal state and create a system with some defects,
let us randomly delete some of the carbon atoms.
In order to avoid deleting atoms that are too close to the edges,
let us define a new region name *rdel* that
starts :math:`2\,Å`
Expand Down Expand Up @@ -626,6 +629,8 @@ Data extraction
.. container:: justify

The chosen velocity for the deformation is :math:`100\,\text{m/s}`.
The length :math:`L` of the CNT increase linearly over
time for :math:`t > 5\,\text{ps}`, as expected from the imposed constant velocity.

.. figure:: ../figures/level1/breaking-a-carbon-nanotube/length-unbreakable-dark.png
:alt: length of the CNT with time - lammps molecular dynamics
Expand All @@ -637,7 +642,7 @@ Data extraction

.. container:: figurelegend

Figure: Evolution of the length of the CNT with time.
Figure: Evolution of the length :math:`L` of the CNT with time.
The CNT starts deforming at :math:`t = 5\,\text{ps}`.

.. container:: justify
Expand Down Expand Up @@ -686,9 +691,9 @@ Breakable bonds

.. container:: justify

When using a classical force field, as we just did, the bonds between atoms
are non-breakable. Let us perform a similar simulation,
but this time using a reactive force field instead, allowing for the bonds to break
When using a classical force field, as we just did, the bonds between the atoms
are non-breakable. Let us perform a similar simulation and deform a small CNT again,
but this time using a reactive force field that allows for the bonds to break
if the applied deformation is large enough.

Input file initialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,17 +742,23 @@ Control the initial atom positions

.. container:: justify

Run the *input.min.lammps* script using LAMMPS. A new dump file named
*dump.min.lammpstrj* will appear in the folder, allowing you to visualize
the atom's trajectories during minimization. In
addition, a file named *minimized_coordinate.data* will be created.

Run the *input.min.lammps* script using LAMMPS.

.. container:: justify

As soon as the simulation starts, a new dump file named
*dump.min.lammpstrj* must appear in the folder.
This *.lammpstrj* can be used to visualize the
atom's trajectories during minimization using VMD.
At the end of the simulation, a file named
*minimized_coordinate.data* is created by LAMMPS.

If you open *minimized_coordinate.data* with a text editor, you can see
that it contains all the information necessary to restart the
simulation, such as the number of atoms and the box size, the
*masses*, the *pair_coeffs*:
.. container:: justify

If you open *minimized_coordinate.data* with a text editor,
you can see that it contains all the information necessary to
restart the simulation, such as the number of atoms, the box
size, the *masses*, and the *pair_coeffs*:

.. code-block:: lammps
Expand Down Expand Up @@ -863,7 +869,8 @@ Restarting from a saved configuration

.. container:: justify

The first two *group* commands create atom groups based on their types.
The first two *group* commands are used to create groups containing
all the atoms of type 1 and all the atoms of type 2, respectively.
The next two *group* commands create atom groups based on their
positions at the beginning of the simulation, i.e. when the commands
are being read by LAMMPS.
Expand All @@ -873,9 +880,8 @@ Restarting from a saved configuration
.. container:: justify

Finally, the two *delete_atoms* commands delete the
atoms of type 1 that are located within the cylinder, as
well as the atoms of type 2 that are located outside the
cylinder, respectively.
atoms of type 1 that are located within the cylinder and the atoms of
type 2 that are located outside the cylinder, respectively.

.. container:: justify

Expand Down Expand Up @@ -936,11 +942,12 @@ Restarting from a saved configuration

.. container:: justify

Let us also extract the coordination number per atom between atoms
of type 1 and 2, i.e. the average number of atoms of type 2 in the vicinity
of the atoms of type 1. This coordination number will be used as
an indicator of the degree of mixing of our binary mixture.
Add the following lines into *input.md.lammps*:
In addition to counting the atoms in each region, let us also extract the
coordination number per atom between atoms of types 1 and 2. The
coordination number is a measure of the average number of type 2 atoms
in the vicinity of type 1 atoms, serving as a good indicator of
the degree of mixing in a binary mixture. Add the following lines into
*input.md.lammps*:

.. code-block:: lammps
Expand Down Expand Up @@ -979,7 +986,7 @@ Restarting from a saved configuration
momentum (*rot yes*) are given to the system and that the generated
velocities are distributed as a Gaussian. Another improvement
is the *zero yes* keyword in the Langevin thermostat, which
ensures that the total random force is equal to zero.
ensures that the total random force applied to the atoms is equal to zero.

.. container:: justify

Expand All @@ -996,7 +1003,10 @@ Restarting from a saved configuration

.. container:: figurelegend

Figure: Evolution of the system during mixing.
Figure: Evolution of the system during mixing. The three snapshots show
respectively the system at :math:`t=0` (left panel),
:math:`t=75` (middle panel),
and :math:`t=1500` (right panel).

.. container:: justify

Expand All @@ -1015,7 +1025,8 @@ Restarting from a saved configuration
.. container:: figurelegend

Figure: Evolution of the number of atoms within the *region_cylinder_in* region
as a function of time (a), and evolution of the coordination number (b).
as a function of time (a), and evolution of the coordination number
between atoms of types 1 and 2 (b).

.. include:: ../../non-tutorials/accessfile.rst

Expand Down
2 changes: 1 addition & 1 deletion sphinx/build/html/searchindex.js

Large diffs are not rendered by default.

51 changes: 28 additions & 23 deletions sphinx/build/html/tutorials/level1/breaking-a-carbon-nanotube.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,15 @@
<div class="abstract docutils container">
<p>In this tutorial, a small carbon nanotube (CNT) is simulated
within an empty box using LAMMPS. An external
forcing is imposed on the CNT, and its deformation is measured with time.</p>
force is imposed on the CNT, and its deformation is measured over time.</p>
</div>
<div class="abstract docutils container">
<p>The difference between classical and reactive force fields
is illustrated in this tutorial. With a classical force field, the bonds
between atoms are unbreakable. With the reactive
force field (named AIREBO <span id="id1">[<a class="reference internal" href="../../non-tutorials/bibliography.html#id34" title="Steven J Stuart, Alan B Tutein, and Judith A Harrison. A reactive potential for hydrocarbons with intermolecular interactions. The Journal of chemical physics, 112(14):6472–6486, 2000.">18</a>]</span>),
the breaking of the chemical bonds is possible when
the imposed deformation is strong enough.</p>
<p>To illustrate the difference between classical and reactive force fields,
this tutorial is divided into two parts. Within the first part, a classical
force field is used and the bonds between the atoms of the CNT are
unbreakable. Within the second part, a reactive force field
(named AIREBO <span id="id1">[<a class="reference internal" href="../../non-tutorials/bibliography.html#id34" title="Steven J Stuart, Alan B Tutein, and Judith A Harrison. A reactive potential for hydrocarbons with intermolecular interactions. The Journal of chemical physics, 112(14):6472–6486, 2000.">18</a>]</span>) is used, allowing for the breaking
of chemical bonds when the CNT undergoes strong deformation.</p>
</div>
<div class="justify docutils container">
<p>If you are completely new to LAMMPS, I recommend that
Expand Down Expand Up @@ -484,8 +484,7 @@ <h3>The LAMMPS input<a class="headerlink" href="#the-lammps-input" title="Link t
<p>Atoms connected by a bond do not typically interact through
Lennard-Jones interaction. Therefore, atoms that are
bounded must be excluded from the Lennard-Jones potential calculation.
Here, this is done by the
<em>special_bonds</em> command. The three numbers of the
Here, this is done by the <em>special_bonds</em> command. The three numbers of the
<em>special_bonds</em> command are weighting factors for the
Lennard-Jones interaction between atoms connected by a bond
(respectively directly bounded <span class="math notranslate nohighlight">\(C-C\)</span>, separated by two bonds <span class="math notranslate nohighlight">\(C-C-C\)</span>,
Expand Down Expand Up @@ -535,8 +534,8 @@ <h3>The LAMMPS input<a class="headerlink" href="#the-lammps-input" title="Link t
</pre></div>
</div>
</section>
<section id="prepare-initial-state">
<h3>Prepare initial state<a class="headerlink" href="#prepare-initial-state" title="Link to this heading"></a></h3>
<section id="prepare-the-initial-state">
<h3>Prepare the initial state<a class="headerlink" href="#prepare-the-initial-state" title="Link to this heading"></a></h3>
<div class="justify docutils container">
<p>Before starting the molecular dynamics simulation,
let us make sure that we start from a clean initial state
Expand Down Expand Up @@ -601,14 +600,17 @@ <h3>Prepare initial state<a class="headerlink" href="#prepare-initial-state" tit
<p>The variable <span class="math notranslate nohighlight">\(z_\mathrm{max}\)</span> corresponds to
the coordinate of the last atoms along <span class="math notranslate nohighlight">\(z\)</span> minus 0.5
Ångstroms, and <span class="math notranslate nohighlight">\(z_\mathrm{min}\)</span> to the coordinate of
the first atoms along <span class="math notranslate nohighlight">\(z\)</span> plus 0.5 Ångstroms. Then, 3
regions are defined, and correspond respectively to: <span class="math notranslate nohighlight">\(z &lt; z_\mathrm{min}\)</span>, (bottom)
<span class="math notranslate nohighlight">\(z_\mathrm{min} &gt; z &gt; z_\mathrm{max}\)</span> (middle), and
<span class="math notranslate nohighlight">\(z &gt; z_\mathrm{max}\)</span> (top).</p>
the first atoms along <span class="math notranslate nohighlight">\(z\)</span> plus 0.5 Ångstroms. Then, three
regions are defined, and correspond respectively to: <span class="math notranslate nohighlight">\(z &lt; z_\mathrm{min}\)</span>,
(<em>rbot</em>, for region bottom)
<span class="math notranslate nohighlight">\(z_\mathrm{min} &gt; z &gt; z_\mathrm{max}\)</span>
(<em>rmid</em>, for region middle), and
<span class="math notranslate nohighlight">\(z &gt; z_\mathrm{max}\)</span>
(<em>rtop</em>, for region top).</p>
</div>
<div class="justify docutils container">
<p>Finally, let us define 3 groups of atoms
corresponding to the atoms located in each of the 3 regions,
corresponding to the atoms located in each of the three regions,
respectively, by adding to <em>input.lammps</em>:</p>
</div>
<div class="highlight-lammps notranslate"><div class="highlight"><pre><span></span><span class="k">group </span><span class="nv nv-Identifier">carbon_top</span><span class="w"> </span><span class="k">region </span><span class="nv nv-Identifier">rtop</span>
Expand Down Expand Up @@ -641,7 +643,8 @@ <h3>Prepare initial state<a class="headerlink" href="#prepare-initial-state" tit
</pre></div>
</div>
<div class="justify docutils container">
<p>Finally, let us randomly delete some of the carbon atoms.
<p>Finally, to start from a less ideal state and create a system with some defects,
let us randomly delete some of the carbon atoms.
In order to avoid deleting atoms that are too close to the edges,
let us define a new region name <em>rdel</em> that
starts <span class="math notranslate nohighlight">\(2\,Å\)</span>
Expand Down Expand Up @@ -814,7 +817,9 @@ <h3>Data extraction<a class="headerlink" href="#data-extraction" title="Link to
</pre></div>
</div>
<div class="justify docutils container">
<p>The chosen velocity for the deformation is <span class="math notranslate nohighlight">\(100\,\text{m/s}\)</span>.</p>
<p>The chosen velocity for the deformation is <span class="math notranslate nohighlight">\(100\,\text{m/s}\)</span>.
The length <span class="math notranslate nohighlight">\(L\)</span> of the CNT increase linearly over
time for <span class="math notranslate nohighlight">\(t &gt; 5\,\text{ps}\)</span>, as expected from the imposed constant velocity.</p>
</div>
<figure class="align-default">
<img alt="length of the CNT with time - lammps molecular dynamics" class="only-dark" src="../../_images/length-unbreakable-dark.png" />
Expand All @@ -823,7 +828,7 @@ <h3>Data extraction<a class="headerlink" href="#data-extraction" title="Link to
<img alt="length of the CNT with time - lammps molecular dynamics" class="only-light" src="../../_images/length-unbreakable-light.png" />
</figure>
<div class="figurelegend docutils container">
<p>Figure: Evolution of the length of the CNT with time.
<p>Figure: Evolution of the length <span class="math notranslate nohighlight">\(L\)</span> of the CNT with time.
The CNT starts deforming at <span class="math notranslate nohighlight">\(t = 5\,\text{ps}\)</span>.</p>
</div>
<div class="justify docutils container">
Expand Down Expand Up @@ -860,9 +865,9 @@ <h3>Data extraction<a class="headerlink" href="#data-extraction" title="Link to
<section id="breakable-bonds">
<h2>Breakable bonds<a class="headerlink" href="#breakable-bonds" title="Link to this heading"></a></h2>
<div class="justify docutils container">
<p>When using a classical force field, as we just did, the bonds between atoms
are non-breakable. Let us perform a similar simulation,
but this time using a reactive force field instead, allowing for the bonds to break
<p>When using a classical force field, as we just did, the bonds between the atoms
are non-breakable. Let us perform a similar simulation and deform a small CNT again,
but this time using a reactive force field that allows for the bonds to break
if the applied deformation is large enough.</p>
</div>
<section id="input-file-initialization">
Expand Down Expand Up @@ -1280,7 +1285,7 @@ <h3>Make a membrane of CNTs<a class="headerlink" href="#make-a-membrane-of-cnts"
<li><a class="reference internal" href="#unbreakable-bonds">Unbreakable bonds</a><ul>
<li><a class="reference internal" href="#create-topology-with-vmd">Create topology with VMD</a></li>
<li><a class="reference internal" href="#the-lammps-input">The LAMMPS input</a></li>
<li><a class="reference internal" href="#prepare-initial-state">Prepare initial state</a></li>
<li><a class="reference internal" href="#prepare-the-initial-state">Prepare the initial state</a></li>
<li><a class="reference internal" href="#the-molecular-dynamics">The molecular dynamics</a></li>
<li><a class="reference internal" href="#data-extraction">Data extraction</a></li>
</ul>
Expand Down
Loading

0 comments on commit 04cc53e

Please sign in to comment.