Skip to content

Commit 64613be

Browse files
committed
continue proof reading tutorial 1
1 parent 057856e commit 64613be

File tree

5 files changed

+51
-23
lines changed

5 files changed

+51
-23
lines changed

files/tutorial1/improved.min.lmp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ pair_coeff 2 2 0.5 3.0
1414
thermo 10
1515
thermo_style custom step etotal press
1616
# 5) Run
17-
minimize 1.0e-6 1.0e-6 1000 10000
18-
# 6) Save status
17+
minimize 1.0e-6 1.0e-6 1000 10000

files/tutorial1/solution/improved.md.lmp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ atom_style atomic
55
boundary p p p
66
# 2) System definition
77
pair_style lj/cut 4.0
8-
read_data min_coords.data
8+
read_data improved.min.data
99
region cyl_in cylinder z 0 0 10 INF INF side in
1010
region cyl_out cylinder z 0 0 10 INF INF side out
1111
group grp_t1 type 1
File renamed without changes.

files/tutorial1/solution/improved.min.lmp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ thermo 10
2222
thermo_style custom step etotal press
2323
# 5) Run
2424
minimize 1.0e-6 1.0e-6 1000 10000
25-
# 6) Save status
26-
write_data min_coords.data
25+
# 6) Save system
26+
write_data improved.min.data
2727

lammps-tutorials.tex

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,27 @@ \subsubsection{Improving the script}
888888

889889
Open the \flecmd{improved.min.lmp}, which was downloaded during the
890890
tutorial 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

894913
We want to create the atoms of types 1 and 2 in two separate
895914
regions. To achieve this, we need to add two \lmpcmd{region} commands and then
@@ -908,31 +927,30 @@ \subsubsection{Improving the script}
908927
The \lmpcmd{side in} and \lmpcmd{side out} keywords are used to define
909928
regions representing the inside and outside of the cylinder of radius
910929
10 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}
918938
A 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}.
921941
This \flecmd{.data} file will be used later
922942
to 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

932951
The created \flecmd{.data} file contains all the information necessary to
933952
restart 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
936954
positions of the atoms within the \lmpcmd{Atoms} section. The first five
937955
columns of the \lmpcmd{Atoms} section correspond (from left to right) to
938956
the atom indexes (from 1 to the total number of atoms, 1150), the atom
@@ -970,18 +988,29 @@ \subsubsection{Improving the script}
970988
To continue a simulation from the saved configuration, open the
971989
\flecmd{improved.md.lmp} file, which was downloaded during the tutorial setup.
972990
This 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

9751004
Since we want to read the system from the data file, we do not need
9761005
to 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}
9781007
command, which now must come \emph{before} the simulation box is defined,
9791008
meaning before the \lmpcmd{read\_data} command. Add the following
9801009
lines to \flecmd{improved.md.lmp}:
9811010
\begin{lstlisting}
9821011
# 2) System definition
9831012
pair_style lj/cut 4.0
984-
read_data min_coords.data
1013+
read_data improved.min.data
9851014
\end{lstlisting}
9861015

9871016
By visualizing the system (see Fig.~\ref{fig:improved-min}), you may

0 commit comments

Comments
 (0)