@@ -1297,7 +1297,7 @@ \subsubsection{Unbreakable bonds}
12971297$ \sigma _{11} = 3.4 \, \text {\AA {}}$ . The \lmpcmd {bond\_ coeff} provides
12981298the equilibrium distance $ r_0 = 1.4 \, \text {\AA {}}$ and the
12991299spring constant $ k_\text {b} = 469 \, \text {kcal/mol/\AA {}}^2 $ for the
1300- harmonic potential imposed between two neighboring carbon atoms. The potential
1300+ harmonic potential imposed between two neighboring carbon atoms. The potential
13011301is given by $ U_\text {b} = k_\text {b} ( r - r_0 )^2 $ . The
13021302\lmpcmd {angle\_ coeff} gives the equilibrium angle $ \theta _0 $ and
13031303constant for the potential between three neighboring atoms :
@@ -1306,18 +1306,18 @@ \subsubsection{Unbreakable bonds}
13061306for the constraints between 4 atoms.
13071307
13081308Rather than copying the contents of the file into the input, we
1309- incorporate it using the \lmpcmd {include} command. Using \lmpcmd {include} allows
1309+ incorporate it using the \lmpcmd {include} command. Using \lmpcmd {include} allows
13101310us to conveniently reuse the parameter settings
1311- in other inputs or switch them with others. This will become more general
1311+ in other inputs or switch them with others. This will become more general
13121312when using type labels, which is shown in the next
13131313tutorial \cite {typelabel_paper }.
13141314
13151315\paragraph {Prepare the initial state }
13161316
13171317In this tutorial, a deformation will be applied to the CNT by displacing
1318- the atoms located at its edges. To achieve this, we will first isolate the
1318+ the atoms located at its edges. To achieve this, we will first isolate the
13191319atoms at the two edges and place them into groups named \lmpcmd {rtop} and
1320- \lmpcmd {rbot}. Add the following lines to \flecmd {unbreakable.lmp}:
1320+ \lmpcmd {rbot}. Add the following lines to \flecmd {unbreakable.lmp}:
13211321\ begin{lstlisting}
13221322group carbon_atoms type 1
13231323variable xmax equal bound(carbon_atoms,xmax)-0.5
@@ -1330,7 +1330,7 @@ \subsubsection{Unbreakable bonds}
13301330in a group named \lmpcmd {carbon\_ atoms}.
13311331The variable $ x_\text {max}$ corresponds to the coordinate of the
13321332last atoms along $ x$ minus 0.5~Ångströms, and $ x_\text {min}$ to the coordinate
1333- of the first atoms along $ x$ plus 0.5~Ångströms. Then, three regions are defined,
1333+ of the first atoms along $ x$ plus 0.5~Ångströms. Then, three regions are defined,
13341334corresponding to the following: $ x < x_\text {min}$ , (\lmpcmd {rbot}, for region
13351335bottom), $ x_\text {min} > x > x_\text {max}$ (\lmpcmd {rmid}, for region middle),
13361336and $ x > x_\text {max}$ (\lmpcmd {rtop}, for region top).
@@ -1351,12 +1351,11 @@ \subsubsection{Unbreakable bonds}
13511351
13521352\begin {figure }
13531353\centering
1354- \includegraphics [width=\linewidth ]{CNT-underformed}
1355- \caption {The CNT simulated during \hyperref [carbon-nanotube-label]{Tutorial 2}
1356- with the atoms from the \lmpcmd {cnt\_ mid} group in pink
1357- and the atoms from the \lmpcmd {cnt\_ top} and the \lmpcmd {cnt\_ bot}
1358- groups in white.}
1359- \label {fig:CNT-underformed }
1354+ \includegraphics [width=\linewidth ]{CNT-unbreakable}
1355+ \caption {The unbreakable CNT simulated during \hyperref [carbon-nanotube-label]{Tutorial 2}
1356+ before the removal of atoms (top), after the removal of 10 atoms from the \lmpcmd {rmid}
1357+ region (middle), and after deformation (bottom).}
1358+ \label {fig:CNT-unbreakable }
13601359\end {figure }
13611360
13621361Run the simulation using LAMMPS. The number of atoms in each group is given in
@@ -1368,11 +1367,11 @@ \subsubsection{Unbreakable bonds}
13681367680 atoms in group cnt_mid
13691368\end {lstlisting }
13701369The atoms from the \lmpcmd {cnt\_ top} and \lmpcmd {cnt\_ bot} groups are
1371- represented in white in Fig.\, \ref {fig:CNT-underformed }. The atoms from
1370+ represented in white in Fig.\, \ref {fig:CNT-unbreakable }. The atoms from
13721371the \lmpcmd {cnt\_ mid} group are represented in pink.
13731372
13741373Finally, to start from a less ideal state and create a system with some defects,
1375- let us randomly delete a small fraction of the carbon atoms. To avoid deleting
1374+ let us randomly delete a small fraction of the carbon atoms. To avoid deleting
13761375atoms that are too close to the edges, let us define a new region named \lmpcmd {rdel}
13771376that starts at $ 2 \, \text {\AA {}}$ from the CNT edges:
13781377\ begin{lstlisting}
@@ -1383,16 +1382,7 @@ \subsubsection{Unbreakable bonds}
13831382delete_atoms random fraction 0.02 no rdel NULL 2793 bond yes
13841383\end {lstlisting }
13851384The \lmpcmd {delete\_ atoms} command randomly deletes $ 2 \,\% $ of the atoms from
1386- the \lmpcmd {rdel} group, here about 10 atoms (Fig.\, \ref {fig:CNT-underformed-deleted }).
1387-
1388- \begin {figure }
1389- \centering
1390- \includegraphics [width=\linewidth ]{CNT-underformed-deleted}
1391- \caption {Same CNT as in Fig.\, \ref {fig:CNT-underformed }, but with 10 deleted atoms.
1392- The 10 deleted atoms were chosen randomly from the central part
1393- of the CNT (region \lmpcmd {rdel}).}
1394- \label {fig:CNT-underformed-deleted }
1395- \end {figure }
1385+ the \lmpcmd {rdel} group, here about 10 atoms (Fig.\, \ref {fig:CNT-unbreakable }).
13961386
13971387\paragraph {The molecular dynamics }
13981388
@@ -1416,7 +1406,7 @@ \subsubsection{Unbreakable bonds}
14161406\end {lstlisting }
14171407The \lmpcmd {fix nve} are applied to the atoms of \lmpcmd {cnt\_ top} and
14181408\lmpcmd {cnt\_ bot}, respectively, and will ensure that the positions of the atoms
1419- from these groups are recalculated at every step. The \lmpcmd {fix nvt} does the
1409+ from these groups are recalculated at every step. The \lmpcmd {fix nvt} does the
14201410same for the \lmpcmd {cnt\_ mid} group, while also applying a Nos\' e-Hoover thermostat
14211411with desired temperature of 300\, K \cite {nose1984unified , hoover1985canonical }.
14221412To restrain the motion of the atoms at the edges, let us add the following
@@ -1428,19 +1418,19 @@ \subsubsection{Unbreakable bonds}
14281418velocity cnt_bot set 0 0 0
14291419\end {lstlisting }
14301420The two \lmpcmd {setforce} commands cancel the forces applied on the atoms of the
1431- two edges, respectively. The cancellation of the forces is done at every step,
1421+ two edges, respectively. The cancellation of the forces is done at every step,
14321422and along all 3 directions of space, $ x$ , $ y$ , and $ z$ , due to the use of
1433- \lmpcmd {0 0 0}. The two \lmpcmd {velocity} commands set the initial velocities
1423+ \lmpcmd {0 0 0}. The two \lmpcmd {velocity} commands set the initial velocities
14341424along $ x$ , $ y$ , and $ z$ to 0 for the atoms of \lmpcmd {cnt\_ top} and
1435- \lmpcmd {cnt\_ bot}, respectively. As a consequence of these last four commands,
1425+ \lmpcmd {cnt\_ bot}, respectively. As a consequence of these last four commands,
14361426the atoms of the edges will remain immobile during the simulation (or at least
14371427they would if no other command was applied to them).
14381428
14391429On a side note, the \lmpcmd {velocity set}
14401430commands impose the velocity of a group of atoms at the start of a run but do
14411431not enforce the velocity during the entire simulation. When \lmpcmd {velocity set}
14421432is used in combination with \lmpcmd {setforce 0 0 0}, as is the case here, the
1443- atoms won't feel any force during the entire simulation. According to the Newton
1433+ atoms won't feel any force during the entire simulation. According to the Newton
14441434equation, no force means no acceleration, meaning that the initial velocity
14451435will persist during the entire simulation, thus producing a constant velocity motion.
14461436
@@ -1481,14 +1471,14 @@ \subsubsection{Unbreakable bonds}
14811471must be outputted, instead of the temperature of the entire system.
14821472This choice is motivated by the presence of
14831473frozen parts with an effective temperature of 0\, K, which makes the average
1484- temperature of the entire system less relevant. The \lmpcmd {thermo\_ modify}
1474+ temperature of the entire system less relevant. The \lmpcmd {thermo\_ modify}
14851475command also imposes the use of the YAML format that can easily be read by
14861476Python (see below).
14871477
14881478Let us impose a constant velocity deformation on the CNT
14891479by combining the \textit {velocity set } command with previously defined
1490- \lmpcmd {fix setforce}. Add the following lines in the \lmpcmd {unbreakable.lmp} file,
1491- right after the last \lmpcmd {run 5000} command:
1480+ \lmpcmd {fix setforce}. Add the following lines in the \lmpcmd {unbreakable.lmp}
1481+ file, right after the last \lmpcmd {run 5000} command:
14921482\ begin{lstlisting}
14931483velocity cnt_top set 0.0005 0 0
14941484velocity cnt_bot set -0.0005 0 0
@@ -1501,31 +1491,24 @@ \subsubsection{Unbreakable bonds}
15011491\begin {figure }
15021492\centering
15031493\includegraphics [width=\linewidth ]{CNT-lenght-unbreakable}
1504- \caption {Evolution of the length $ L$ of the CNT with time. The CNT starts
1494+ \caption {Evolution of the length $ L$ of the CNT with time. The CNT starts
15051495deforming at $ t = 5 \, \text {ps}$ .}
15061496\label {fig:CNT-unbreakable-lenght }
15071497\end {figure }
15081498
1509- Run the simulation using LAMMPS. As can be seen from the variable $ L_\text {cnt}$ , the length
1499+ Run the simulation using LAMMPS. As can be seen from the variable $ L_\text {cnt}$ , the length
15101500of the CNT increases linearly over time for $ t > 5 \, \text {ps}$ (Fig.\, \ref {fig:CNT-unbreakable-lenght }),
1511- as expected from the imposed constant velocity. What you observe in the \textit {Slide Show }
1512- windows should resembles Fig.\, \ref {fig:CNT-deformed- unbreakable }. The total energy of the system
1501+ as expected from the imposed constant velocity. What you observe in the \guicmd {Slide Show}
1502+ windows should resembles Fig.\, \ref {fig:CNT-unbreakable }. The total energy of the system
15131503shows a non-linear increase with $ t$ once the deformation starts, which is expected
15141504from the typical dependency of bond energy with bond distance,
15151505$ U_\text {b} = k_\text {b} \left ( r - r_0 \right )^2 $ (Fig.\, \ref {fig:CNT-unbreakable-energy }).
15161506
1517- \begin {figure }
1518- \centering
1519- \includegraphics [width=\linewidth ]{CNT-deformed-unbreakable}
1520- \caption {CNT before (top) and after (bottom) deformation.}
1521- \label {fig:CNT-deformed-unbreakable }
1522- \end {figure }
1523-
15241507\begin {figure }
15251508\centering
15261509\includegraphics [width=\linewidth ]{CNT-energy-unbreakable}
15271510\caption {Evolution of the total energy $ E_\text {tot}$ of the system with time $ t$ .
1528- The CNT starts deforming at $ t = 5 \, \text {ps}$ . The potential is OPLS-AA.}
1511+ The CNT starts deforming at $ t = 5 \, \text {ps}$ . The potential is OPLS-AA.}
15291512\label {fig:CNT-unbreakable-energy }
15301513\end {figure }
15311514
@@ -1534,22 +1517,22 @@ \subsubsection{Unbreakable bonds}
15341517Let us import the simulation data into Python, and generate a stress-strain curve.
15351518Here, the stress is defined as $ F_\text {cnt}/A_\text {cnt}$ ,
15361519where $ A_\text {cnt} = \pi r_\text {cnt}^2 $ is the surface area of the
1537- CNT, and $ r_\text {cnt}=5.2 $ \, \AA {} the CNT radius. The strain is defined
1520+ CNT, and $ r_\text {cnt}=5.2 $ \, \AA {} the CNT radius. The strain is defined
15381521as $ (L_\text {cnt}-L_\text {cnt-0})/L_\text {cnt-0}$ , where $ L_\text {cnt-0}$ is the initial CNT length.
15391522
15401523Right-click inside the \guicmd {Output} window, and select
1541- \guicmd {Export YAML data to file}. Call the output \flecmd {unbreakable.yaml}, and save
1524+ \guicmd {Export YAML data to file}. Call the output \flecmd {unbreakable.yaml}, and save
15421525it within the same folder as the input files, where a Python script named
15431526\href {\filepath tutorial2/yaml-reader.py}{\dwlcmd {yaml-reader.py}} should also
1544- be located. When executed using Python, this .py file first imports
1545- the \flecmd {unbreakable.yaml} file. Then, a certain pattern is
1546- identified and stored as a string character named `docs'. The string is
1527+ be located. When executed using Python, this .py file first imports
1528+ the \flecmd {unbreakable.yaml} file. Then, a certain pattern is
1529+ identified and stored as a string character named `docs'. The string is
15471530then converted into a list, and $ F_\text {cnt}$ and $ L_\text {cnt}$
1548- are extracted. The stress and strain
1531+ are extracted. The stress and strain
15491532are then calculated, and the result is saved in a data file using the
1550- NumPy `savetxt' function. `thermo[0]' can be used to access the
1533+ NumPy `savetxt' function. `thermo[0]' can be used to access the
15511534information from the first minimization run, and `thermo[1]' to access the
1552- information from the second MD run. The data extracted from
1535+ information from the second MD run. The data extracted from
15531536the \flecmd {unbreakable.yaml} file can then be used to plot the stress-strain
15541537curve, see Fig.\, \ref {fig:CNT-stress-strain-unbreakable }.
15551538
@@ -1567,7 +1550,7 @@ \subsubsection{Unbreakable bonds}
15671550\subsubsection {Breakable bonds }
15681551
15691552When using a conventional molecular force field, as we have just done, the bonds between the atoms
1570- are non-breakable. Let us perform a similar simulation and deform a small
1553+ are non-breakable. Let us perform a similar simulation and deform a small
15711554CNT again, but this time with a reactive force field that allows bonds
15721555to break if the applied deformation is large enough.
15731556
0 commit comments