Skip to content

Commit b5c8ca9

Browse files
committed
fixed free sampling code and figures
1 parent 77492c7 commit b5c8ca9

10 files changed

Lines changed: 247 additions & 564 deletions

figures/US-density-evolution.png

-4.6 KB
Loading

figures/US-density.png

76.2 KB
Loading

figures/US-potential.png

27.2 KB
Loading

figures/US-system-unbiased.png

124 KB
Loading
Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +0,0 @@
1-
# Chunk-averaged data for fix myac and group all
2-
# Timestep Number-of-chunks Total-count
3-
# Chunk Coord1 Ncount density/number
4-
4000000 50 200.00000000000006
5-
1 -24.5 4.74 0.00948
6-
2 -23.5 4.7831 0.00956619
7-
3 -22.5 4.7604 0.0095208
8-
4 -21.5 4.86592 0.00973184
9-
5 -20.5 4.86826 0.00973651
10-
6 -19.5 4.76565 0.0095313
11-
7 -18.5 4.79443 0.00958886
12-
8 -17.5 4.85737 0.00971473
13-
9 -16.5 4.89866 0.00979732
14-
10 -15.5 4.82998 0.00965996
15-
11 -14.5 4.90789 0.00981579
16-
12 -13.5 4.93531 0.00987062
17-
13 -12.5 4.91643 0.00983286
18-
14 -11.5 4.86221 0.00972442
19-
15 -10.5 4.96515 0.00993031
20-
16 -9.5 4.93611 0.00987222
21-
17 -8.5 4.47913 0.00895826
22-
18 -7.5 4.73773 0.00947546
23-
19 -6.5 5.79113 0.0115823
24-
20 -5.5 4.64622 0.00929243
25-
21 -4.5 1.05415 0.00210829
26-
22 -3.5 0.72657 0.00145314
27-
23 -2.5 0.751093 0.00150219
28-
24 -1.5 0.73587 0.00147174
29-
25 -0.5 0.721085 0.00144217
30-
26 0.5 0.736407 0.00147281
31-
27 1.5 0.760687 0.00152137
32-
28 2.5 0.73136 0.00146272
33-
29 3.5 0.63102 0.00126204
34-
30 4.5 0.936882 0.00187376
35-
31 5.5 4.4201 0.0088402
36-
32 6.5 5.55349 0.011107
37-
33 7.5 4.67568 0.00935137
38-
34 8.5 4.50497 0.00900995
39-
35 9.5 4.65875 0.0093175
40-
36 10.5 4.73779 0.00947558
41-
37 11.5 4.78154 0.00956308
42-
38 12.5 4.7601 0.0095202
43-
39 13.5 4.7299 0.0094598
44-
40 14.5 4.7456 0.0094912
45-
41 15.5 4.7732 0.00954639
46-
42 16.5 4.71844 0.00943687
47-
43 17.5 4.65763 0.00931525
48-
44 18.5 4.59819 0.00919637
49-
45 19.5 4.739 0.009478
50-
46 20.5 4.79002 0.00958004
51-
47 21.5 4.76412 0.00952823
52-
48 22.5 4.71521 0.00943042
53-
49 23.5 4.71839 0.00943677
54-
50 24.5 4.83169 0.00966339

files/tutorial7/solution/free-sampling.ipynb

Lines changed: 160 additions & 10 deletions
Large diffs are not rendered by default.

files/tutorial7/solution/free-sampling.lmp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
variable sigma equal 3.405
33
variable epsilon equal 0.238
44
variable U0 equal 1.5*${epsilon}
5-
variable dlt equal 0.5
6-
variable x0 equal 5.0
5+
variable dlt equal 1.0
6+
variable x0 equal 10.0
77

88
units real
99
atom_style atomic
1010
pair_style lj/cut 3.822
1111
pair_modify shift yes
1212
boundary p p p
1313

14-
region myreg block -25 25 -5 5 -25 25
14+
region myreg block -50 50 -15 15 -50 50
1515
create_box 1 myreg
1616
create_atoms 1 random 200 34134 myreg overlap 3 maxtry 50
1717

@@ -23,23 +23,25 @@ variable F atom ${U0}/((x-${x0})^2/${dlt}^2+1)/${dlt}-${U0}/((x+${x0})^2/${dlt}^
2323
fix myadf all addforce v_F 0.0 0.0 energy v_U
2424

2525
fix mynve all nve
26-
fix mylgv all langevin 119.8 119.8 50 30917
26+
fix mylgv all langevin 119.8 119.8 500 30917
2727

2828
region mymes block -${x0} ${x0} INF INF INF INF
2929
variable n_center equal count(all,mymes)
3030
thermo_style custom step temp etotal v_n_center
31-
thermo 10000
31+
thermo 2000
3232

3333
dump viz all image 50000 myimage-*.ppm type type &
34-
shiny 0.1 box yes 0.01 view 180 90 zoom 7 size 1600 400
35-
dump_modify viz backcolor white acolor 1 cyan adiam 1 1 boxcolor black
34+
shiny 0.1 box yes 0.01 view 180 90 zoom 6 size 1600 500 fsaa yes
35+
dump_modify viz backcolor white acolor 1 cyan adiam 1 3 boxcolor black
3636

3737
timestep 2.0
38-
run 500000
38+
run 50000
3939
reset_timestep 0
4040

41-
compute cc1 all chunk/atom bin/1d x 0.0 1.0
42-
fix myac all ave/chunk 10 400000 4000000 &
41+
thermo 200000
42+
43+
compute cc1 all chunk/atom bin/1d x 0.0 2.0
44+
fix myac all ave/chunk 100 20000 2000000 &
4345
cc1 density/number file free-sampling.dat
4446

45-
run 4000000
47+
run 2000000

files/tutorial7/solution/free-sampling.log

Lines changed: 71 additions & 486 deletions
Large diffs are not rendered by default.
124 KB
Loading

lammps-tutorials.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3573,7 +3573,7 @@ \subsubsection{Method 1: Free sampling}
35733573
\begin{lstlisting}
35743574
variable sigma equal 3.405
35753575
variable epsilon equal 0.238
3576-
variable U0 equal 2.0*${epsilon}
3576+
variable U0 equal 1.5*${epsilon}
35773577
variable dlt equal 0.5
35783578
variable x0 equal 5.0
35793579

@@ -3740,9 +3740,9 @@ \subsubsection{Method 1: Free sampling}
37403740
\begin{figure}
37413741
\centering
37423742
\includegraphics[width=\linewidth]{US-density}
3743-
\caption{Fluid density $\rho$ along the $x$ direction. Here,
3743+
\caption{Fluid density $\rho$ along the $x$ direction. Here,
37443744
$U_0 = 0.36~\text{kcal/mol}$, $\delta = 0.5~\mathrm{\AA{}}$, $x_0 = 5~\mathrm{\AA{}}$,
3745-
and reference density $\rho_\text{bulk} = 0.0033~\text{\AA{}}^{-3}$.}
3745+
and the reference density is $\rho_\text{bulk} = 0.0033~\text{\AA{}}^{-3}$.}
37463746
\label{fig:US-density}
37473747
\end{figure}
37483748

0 commit comments

Comments
 (0)