@@ -888,8 +888,27 @@ \subsubsection{Improving the script}
888888
889889Open the \flecmd {improved.min.lmp}, which was downloaded during the
890890tutorial setup. This file contains the \lmpcmd {Part A} of the
891- \flecmd {initial.lmp} file, but \emph {without } the \lmpcmd {create\_ atoms}
892- commands in the \lmpcmd {System definition} section.
891+ \flecmd {initial.lmp} file, but \emph {without } any
892+ commands in the \lmpcmd {System definition} section:
893+ \ begin{lstlisting}
894+ # 1) Initialization
895+ units lj
896+ dimension 3
897+ atom_style atomic
898+ boundary p p p
899+ # 2) System definition
900+ # 3) Settings
901+ mass 1 1.0
902+ mass 2 10.0
903+ pair_style lj/cut 4.0
904+ pair_coeff 1 1 1.0 1.0
905+ pair_coeff 2 2 0.5 3.0
906+ # 4) Visualization
907+ thermo 10
908+ thermo_style custom step etotal press
909+ # 5) Run
910+ minimize 1.0e-6 1.0e-6 1000 10000
911+ \end {lstlisting }
893912
894913We want to create the atoms of types 1 and 2 in two separate
895914regions. To achieve this, we need to add two \lmpcmd {region} commands and then
@@ -908,31 +927,30 @@ \subsubsection{Improving the script}
908927The \lmpcmd {side in} and \lmpcmd {side out} keywords are used to define
909928regions representing the inside and outside of the cylinder of radius
91092910 length units. Then, append a sixth section titled \lmpcmd {Save system} at the end
911- of the file with the following content (make sure the \lmpcmd {write\_ data} command
912- is placed \emph { after } the \lmpcmd {minimize} command) :
930+ of the file, ensuring that the \lmpcmd {write\_ data} command is placed \emph { after }
931+ the \lmpcmd {minimize} command:
913932\ begin{lstlisting}
914933# 6) Save system
915- write_data min_coords .data
934+ write_data improved.min .data
916935\end {lstlisting }
917936
937+ \begin {note }
918938A key improvement to the input is the addition of the
919939\lmpcmd {write\_ data} command. This command writes the state
920- of the system to a text file called \flecmd {min\_ coords .data}.
940+ of the system to a text file called \flecmd {improved. min.data}.
921941This \flecmd {.data} file will be used later
922942to restart the simulation from the final state of the energy
923- minimization step without having to repeat the system creation and
924- minimization.
943+ minimization step, eliminating the need to repeat the system creation and minimization.
944+ \end { note }
925945
926- Run the \flecmd {improved.min.lmp} file using LAMMPS. At the end of the simulation, a file
927- called \flecmd {min\_ coords.data} is created. You can view the contents
928- of the file with the file view feature of LAMMPS--GUI, e.g.,~from the
929- \guicmd {File} menu or by right-clicking on the file name in the editor
930- and selecting the entry \guicmd {View file `min\_ coords.data'}.
946+ Run the \flecmd {improved.min.lmp} file using LAMMPS. At the end of the simulation,
947+ a file called \flecmd {improved.min.data} is created. You can view the contents
948+ of this file from the LAMMPS--GUI, by right-clicking on the file name in
949+ the editor and selecting the entry \guicmd {View file `improved.min.data'}.
931950
932951The created \flecmd {.data} file contains all the information necessary to
933952restart the simulation, such as the number of atoms, the box size, the
934- masses, and the pair coefficients. The
935- \flecmd {.data} file also contains the final
953+ masses, and the pair coefficients. This \flecmd {.data} file also contains the final
936954positions of the atoms within the \lmpcmd {Atoms} section. The first five
937955columns of the \lmpcmd {Atoms} section correspond (from left to right) to
938956the atom indexes (from 1 to the total number of atoms, 1150), the atom
@@ -970,18 +988,29 @@ \subsubsection{Improving the script}
970988To continue a simulation from the saved configuration, open the
971989\flecmd {improved.md.lmp} file, which was downloaded during the tutorial setup.
972990This file contains the \textit {Initialization } part from \flecmd {initial.lmp}
973- and \flecmd {improved.min.lmp}.
991+ and \flecmd {improved.min.lmp}:
992+ \ begin{lstlisting}
993+ # 1) Initialization
994+ units lj
995+ dimension 3
996+ atom_style atomic
997+ boundary p p p
998+ # 2) System definition
999+ # 3) Settings
1000+ # 4) Visualization
1001+ # 5) Run
1002+ \end {lstlisting }
9741003
9751004Since we want to read the system from the data file, we do not need
9761005to repeat most of the commands from the \lmpcmd {System definition}
977- and \lmpcmd {Settings} categories. The exception is the \textit {pair\_ style }
1006+ and \lmpcmd {Settings} categories. The exception is the \lmpcmd {pair\_ style}
9781007command, which now must come \emph {before } the simulation box is defined,
9791008meaning before the \lmpcmd {read\_ data} command. Add the following
9801009lines to \flecmd {improved.md.lmp}:
9811010\ begin{lstlisting}
9821011# 2) System definition
9831012pair_style lj/cut 4.0
984- read_data min_coords .data
1013+ read_data improved.min .data
9851014\end {lstlisting }
9861015
9871016By visualizing the system (see Fig.~\ref {fig:improved-min }), you may
0 commit comments