@@ -1134,10 +1134,11 @@ \subsubsection{Improving the script}
11341134\begin {figure }
11351135\centering
11361136\includegraphics [width=0.55\linewidth ]{LJ-coords}
1137- \caption {Snapshot image of the binary mixture simulated
1138- during \hyperref [lennard-jones-label]{Tutorial 1} with atoms colored by the
1139- computed $ 1 -2 $ coordination number \lmpcmd {c\_ coor12}, from
1140- turquoise (0.0) to blue (2.0).}
1137+ \caption {Snapshot of the binary mixture simulated
1138+ during \hyperref [lennard-jones-label]{Tutorial 1} with atoms of type 1
1139+ colored according to their computed $ 1 -2 $ coordination
1140+ number \lmpcmd {c\_ coor12}, ranging from turquoise, \lmpcmd {c\_ coor12 = 0},
1141+ to yellow, \lmpcmd {c\_ coor12 = 1}, and red, \lmpcmd {c\_ coor12 = 2}.}
11411142\label {fig:coords-viz }
11421143\end {figure }
11431144
@@ -1156,17 +1157,21 @@ \subsubsection{Improving the script}
11561157\end {itemize }
11571158
11581159Another useful experiment to try is to color the atoms in the \guicmd {Slide Show}
1159- according to their respective coordination numbers. To do this, replace the
1160+ according to an observable, such as their respective coordination
1161+ numbers. To do this, replace the
11601162\lmpcmd {dump} and \lmpcmd {dump\_ modify} commands with the following lines:
11611163\ begin{lstlisting}
1162- dump mydmp all image 100 dump.md.*.ppm c_coor12 &
1163- type shiny 0.1 box no 0.01 view 0 0 zoom 1.8 fsaa yes
1164- dump_modify mydmp amap 0.0 2.0 cf 1.0 2 min darkturquoise &
1165- max darkblue adiam 1 1 adiam 2 3 backcolor white
1166- \end {lstlisting }
1167- Now, the atom colors are based on the value of \lmpcmd {c\_ coor12}, which is mapped
1168- continuously from dark turquoise (min) to dark blue (max) for values of
1169- \lmpcmd {c\_ coor12} in the range $ 0.0 $ to $ 2.0 $ (Figure~\ref {fig:coords-viz }).
1164+ variable coor12 atom (type==1)*(c_coor12)+(type==2)*-1
1165+ dump mydmp all image 100 dump.md.*.ppm v_coor12 type shiny 0.1 &
1166+ box no 0.01 view 0 0 zoom 1.8 fsaa yes
1167+ dump_modify mydmp adiam 1 1 adiam 2 3 backcolor white &
1168+ amap -1 2 ca 0.0 4 min royalblue 0 turquoise 1 yellow max red
1169+ \end {lstlisting }
1170+ Run LAMMPS again. Now, the atoms of type 1 are colored based on the value
1171+ of \lmpcmd {c\_ coor12}, which is mapped continuously from turquoise to yellow
1172+ and red for atoms with the highest coordination (Figure~\ref {fig:coords-viz }).
1173+ In the definition of the variable \lmpcmd {v\_ coor12}, atoms of type 2 are
1174+ all assigned a value of -1, and will therefore always be colored their default blue.
11701175
11711176\subsection {Tutorial 2: Pulling on a carbon nanotube }
11721177\label {carbon-nanotube-label }
0 commit comments