changes to integrate USER-BOCS into LAMMPS and to closer follow the LAMMPS programming/documentation style

This commit is contained in:
Axel Kohlmeyer
2018-05-05 10:21:11 -04:00
parent fc0110a2e0
commit 81293b0fda
15 changed files with 201 additions and 3755 deletions

View File

@ -122,6 +122,7 @@ Package, Description, Doc page, Example, Library
Package, Description, Doc page, Example, Library Package, Description, Doc page, Example, Library
"USER-ATC"_#USER-ATC, atom-to-continuum coupling, "fix atc"_fix_atc.html, USER/atc, int "USER-ATC"_#USER-ATC, atom-to-continuum coupling, "fix atc"_fix_atc.html, USER/atc, int
"USER-AWPMD"_#USER-AWPMD, wave-packet MD, "pair_style awpmd/cut"_pair_awpmd.html, USER/awpmd, int "USER-AWPMD"_#USER-AWPMD, wave-packet MD, "pair_style awpmd/cut"_pair_awpmd.html, USER/awpmd, int
"USER-BOCS"_#USER-BOCS, BOCS bottom up coarse graining, "fix bocs"_fix_bocs.html, USER/bocs, -
"USER-CGDNA"_#USER-CGDNA, coarse-grained DNA force fields, src/USER-CGDNA/README, USER/cgdna, - "USER-CGDNA"_#USER-CGDNA, coarse-grained DNA force fields, src/USER-CGDNA/README, USER/cgdna, -
"USER-CGSDK"_#USER-CGSDK, SDK coarse-graining model, "pair_style lj/sdk"_pair_sdk.html, USER/cgsdk, - "USER-CGSDK"_#USER-CGSDK, SDK coarse-graining model, "pair_style lj/sdk"_pair_sdk.html, USER/cgsdk, -
"USER-COLVARS"_#USER-COLVARS, collective variables library, "fix colvars"_fix_colvars.html, USER/colvars, int "USER-COLVARS"_#USER-COLVARS, collective variables library, "fix colvars"_fix_colvars.html, USER/colvars, int
@ -1625,6 +1626,43 @@ examples/USER/awpmd :ul
:line :line
USER-BOCS package :link(USER-BOCS),h4
[Contents:]
This package provides "fix bocs"_fix_bocs.html, a modified version
of "fix npt"_fix_nh.html which includes the pressure correction to
the barostat as outlined in:
N. J. H. Dunn and W. G. Noid, "Bottom-up coarse-grained models that
accurately describe the structure, pressure, and compressibility of
molecular liquids," J. Chem. Phys. 143, 243148 (2015).
[Authors:] Nicholas J. H. Dunn and Michael R. DeLyser (The Pennsylvania State University)
[Install or un-install:]
make yes-user-bocs
make machine :pre
make no-user-bocs
make machine :pre
[Supporting info:]
The USER-BOCS user package for LAMMPS is part of the BOCS software package:
"https://github.com/noid-group/BOCS"_https://github.com/noid-group/BOCS
See the following reference for information about the entire package:
Dunn, NJH; Lebold, KM; DeLyser, MR; Rudzinski, JF; Noid, WG.
"BOCS: Bottom-Up Open-Source Coarse-Graining Software."
J. Phys. Chem. B. 122, 13, 3363-3377 (2018).
Example inputs are in the examples/USER/bocs folder.
:line
USER-CGDNA package :link(USER-CGDNA),h4 USER-CGDNA package :link(USER-CGDNA),h4
[Contents:] [Contents:]

View File

@ -84,6 +84,10 @@ the examples. For the last argument in the command, you should put
XXXX_press, where XXXX is the ID given to the fix bocs command (in the XXXX_press, where XXXX is the ID given to the fix bocs command (in the
example, the ID of the fix bocs command is 1 ). example, the ID of the fix bocs command is 1 ).
This fix is part of the USER-BOCS package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related:] [Related:]
For more details about the pressure correction and the entire BOCS software For more details about the pressure correction and the entire BOCS software

View File

@ -20,6 +20,7 @@ Fixes :h1
fix_ave_time fix_ave_time
fix_aveforce fix_aveforce
fix_balance fix_balance
fix_bocs
fix_bond_break fix_bond_break
fix_bond_create fix_bond_create
fix_bond_swap fix_bond_swap

View File

@ -135,6 +135,7 @@ fix_ave_histo.html
fix_ave_time.html fix_ave_time.html
fix_aveforce.html fix_aveforce.html
fix_balance.html fix_balance.html
fix_bocs.html
fix_bond_break.html fix_bond_break.html
fix_bond_create.html fix_bond_create.html
fix_bond_swap.html fix_bond_swap.html

View File

@ -57,7 +57,7 @@ PACKAGE = asphere body class2 colloid compress coreshell dipole gpu \
molecule mpiio mscg opt peri poems \ molecule mpiio mscg opt peri poems \
python qeq reax replica rigid shock snap srd voronoi python qeq reax replica rigid shock snap srd voronoi
PACKUSER = user-atc user-awpmd user-cgdna user-cgsdk user-colvars \ PACKUSER = user-atc user-awpmd user-bocs user-cgdna user-cgsdk user-colvars \
user-diffraction user-dpd user-drude user-eff user-fep user-h5md \ user-diffraction user-dpd user-drude user-eff user-fep user-h5md \
user-intel user-lb user-manifold user-meamc user-meso \ user-intel user-lb user-manifold user-meamc user-meso \
user-mgpt user-misc user-molfile \ user-mgpt user-misc user-molfile \

View File

@ -16,16 +16,4 @@ Dunn, NJH; Lebold, KM; DeLyser, MR; Rudzinski, JF; Noid, WG.
"BOCS: Bottom-Up Open-Source Coarse-Graining Software." "BOCS: Bottom-Up Open-Source Coarse-Graining Software."
J. Phys. Chem. B. 122, 13, 3363-3377 (2018). J. Phys. Chem. B. 122, 13, 3363-3377 (2018).
Along with the source code files, the following files have been included Example inputs are in the examples/USER/bocs folder.
(in the /bocs/ directory):
methanol.lmp
methanol.data
lammps_nb_MET-MET.table
methanol.lmp is the input file for LAMMPS.
methanol.data contains the positions of 968 CG methanol molecules. It is
read in by methanol.lmp
lammps_nb_MET-MET.table contains the pairwise nonbonded force calculated
via the Multi-Scale Coarse-Graining method.

View File

@ -1,6 +0,0 @@
This folder contains the files to run a NPT simulation of 1 site CG methanol
while employing a correction to the barostat.
The pair force was computed via the Multi-Scale Coarse-Graining method.
The resulting model was then iteratively pressure matched.
The model accurately reproduces both structural (RDF) and thermodynamic
(Pressure-Volume EoS) properties of the underlying OPLS-AA model of methanol.

File diff suppressed because it is too large Load Diff

View File

@ -1,991 +0,0 @@
LAMMPS Description
968 atoms
0 bonds
0 angles
0 dihedrals
0 impropers
1 atom types
0 bond types
0 angle types
0 dihedral types
0 40.4635 xlo xhi
0 40.4635 ylo yhi
0 40.4635 zlo zhi
Masses
1 32.0424
Atoms
1 1 36.39 8.05 27.55
2 1 18.38 15.72 26.03
3 1 3.52 1.77 23.57
4 1 31.09 11.38 12.17
5 1 13.3 34.8 2.89
6 1 1.72 38.55 10.36
7 1 38.6 23.16 6.19
8 1 0.74 33.21 0.17
9 1 26.97 9.53 11.24
10 1 31.68 12.19 17.04
11 1 15.19 9.06 0.2
12 1 34.39 20.63 35.71
13 1 21.79 4.93 6.49
14 1 28.08 33.01 24.51
15 1 37.03 20.52 32.9
16 1 32.69 20 30.11
17 1 23.77 38.59 18.79
18 1 16.01 2.31 20.15
19 1 5.65 15.5 28.5
20 1 8.35 17.35 20.48
21 1 31.24 24.68 27.4
22 1 29.41 16.64 19.79
23 1 37.42 31.93 26.68
24 1 18.76 39.06 30.68
25 1 22.97 35 20.81
26 1 39.47 18.28 29.6
27 1 34.37 19.4 0.17
28 1 5.94 9.53 10.95
29 1 11.45 38.44 14.64
30 1 39.57 11.04 1.57
31 1 25.91 20.97 12.79
32 1 36.3 22.1 1.68
33 1 21.87 22.49 3.43
34 1 5.77 18.66 3.97
35 1 7 7.59 18.42
36 1 39.76 27.63 17.98
37 1 10.26 23.18 5.11
38 1 23.23 21.37 17.38
39 1 7.47 37.37 5.57
40 1 0.73 21.6 14.78
41 1 2.27 30.22 14.93
42 1 7.39 28.22 14.88
43 1 27.48 1.11 25.02
44 1 8.37 13.19 14.64
45 1 7.11 33.57 0.65
46 1 34.19 35.11 3.17
47 1 7.52 3.2 20.33
48 1 1.02 17.69 37.85
49 1 8.59 6.21 10.26
50 1 2.89 16.81 30.02
51 1 27.05 9.07 32.8
52 1 12.32 14.79 21.11
53 1 26.63 22.69 16.75
54 1 31.6 2.79 20.45
55 1 35.11 0.74 12.16
56 1 29.71 31.23 37.63
57 1 38.22 19.02 18.12
58 1 10.95 17.4 0.39
59 1 1.65 19.87 6.67
60 1 5.15 1.94 14.61
61 1 8.2 31.43 15.72
62 1 0.55 20.85 2.45
63 1 15.27 31.74 0.33
64 1 17.9 9.84 23.87
65 1 1.46 8.39 19.24
66 1 37.79 25.11 12.24
67 1 14.11 27.19 30.7
68 1 29.39 24.12 38.92
69 1 39.15 20.32 39.86
70 1 11.79 11.38 30.6
71 1 29.87 30.18 32.5
72 1 11.06 37.8 30.18
73 1 20.11 4.59 35.57
74 1 37.19 27.23 1.44
75 1 18.83 26.13 35.26
76 1 29.27 7.86 36.75
77 1 34.83 29.59 37.82
78 1 22.16 34.68 25.27
79 1 5.95 14.65 25.55
80 1 -0.04 3.48 29.91
81 1 14.69 6.75 38.06
82 1 16.8 23.69 3.14
83 1 14.52 38.72 21.61
84 1 37.36 15.13 27.98
85 1 29.79 17.03 27.55
86 1 21.01 0.39 0.9
87 1 35.3 6.45 14.41
88 1 13.74 34.69 10.01
89 1 13.83 7.92 31.88
90 1 26.88 37.81 22.36
91 1 31.76 7.34 10.03
92 1 11.98 37.49 19.61
93 1 29.19 31.74 20.69
94 1 39.15 10.97 21.06
95 1 1.47 5 22.21
96 1 -0.1 1.33 16.26
97 1 34.74 34.78 30.66
98 1 22.09 26.78 2.27
99 1 36.58 34.8 16.19
100 1 19.09 24.88 15.75
101 1 2.21 31.42 38.32
102 1 28.02 8.18 29.77
103 1 15.99 16.78 17.61
104 1 32.43 12.2 35.3
105 1 26.54 38.8 30.88
106 1 35.58 22.23 18.31
107 1 28.3 30.81 2.96
108 1 8.95 32.9 9.02
109 1 28.51 30.02 29.39
110 1 13 5.35 34.26
111 1 37.9 36.79 1.37
112 1 12.78 1.99 40.66
113 1 21.19 34.55 17.45
114 1 10.5 20 5.07
115 1 16.19 21.64 18.49
116 1 14.62 26.41 19.88
117 1 27.97 2.89 28.03
118 1 29.44 14.35 39.04
119 1 2.29 24.16 33.8
120 1 39.22 15.81 32.02
121 1 7.31 19.66 18.18
122 1 27.67 7.98 15.53
123 1 31.23 4.04 33
124 1 29.52 39.44 28.71
125 1 30.86 20.28 15.84
126 1 32.25 7.44 19.79
127 1 34.68 15.68 1.18
128 1 16.58 27.98 27.97
129 1 32.27 24.24 15.82
130 1 3.86 6.57 39.8
131 1 9.1 2.88 13.12
132 1 17.84 27.8 11.79
133 1 4.77 10.88 6.75
134 1 16.58 24.21 24.5
135 1 10.17 19.31 38.32
136 1 6.27 7.81 36.44
137 1 34.76 37.89 29.76
138 1 40.99 38.22 35.21
139 1 25.04 21.79 36.88
140 1 4.78 15.35 16.44
141 1 19.24 5.77 40.18
142 1 13.59 11.27 37.14
143 1 1.61 23.83 39.61
144 1 6.02 33.07 3.77
145 1 0.85 7.4 35.42
146 1 6.47 40.34 4.65
147 1 16.45 36.52 15.44
148 1 19.58 9.5 1.64
149 1 1.36 1.72 35.53
150 1 11.74 5.48 4.98
151 1 25.45 40.36 15.44
152 1 19.09 0.74 36.18
153 1 31.78 37.98 1.84
154 1 23.26 18.47 38.56
155 1 7.29 22.87 25.86
156 1 2.36 7.83 8.78
157 1 39.61 25.94 21.12
158 1 7.78 18.97 25.29
159 1 36.56 19.61 26.7
160 1 4.64 12.06 19.9
161 1 21.05 33.08 0.87
162 1 33.93 22.87 39.71
163 1 33.62 29.48 20.83
164 1 0.64 18.79 9.52
165 1 27.53 16.7 22.51
166 1 17.66 9.84 14.61
167 1 31.23 22.44 24.98
168 1 39.3 34.88 11.03
169 1 24.01 10.56 0.09
170 1 15.81 33.44 18.52
171 1 19.92 30.61 19.25
172 1 16.49 3.95 38.28
173 1 18.6 38.87 24.98
174 1 33.04 25.55 8.57
175 1 16.9 35.09 22.94
176 1 15.18 6.74 2.33
177 1 40.54 12.58 31.65
178 1 21.21 37.62 14.35
179 1 33.52 38.19 14.89
180 1 22.06 12.49 29.81
181 1 19.49 29.03 2.52
182 1 26.97 18.55 38.45
183 1 24.1 11.86 17.22
184 1 12.02 0.55 10.39
185 1 3.8 35.94 19.94
186 1 8.31 14.31 37.4
187 1 29.03 8.28 22.92
188 1 18.92 0.22 27.87
189 1 26.79 24.9 24.62
190 1 36.59 18.86 21.13
191 1 33.06 13.58 30.17
192 1 32.37 2.02 39.69
193 1 22.65 25.97 32.59
194 1 21.81 38.04 33.85
195 1 36.82 37.68 19.22
196 1 32.48 31.43 33.66
197 1 8.75 36.66 20.34
198 1 14.88 15.11 28.76
199 1 22.83 28.55 29.5
200 1 2.98 12.06 2.88
201 1 3.01 37 6.91
202 1 14.79 16.69 3.66
203 1 12.62 38.28 0.97
204 1 40.07 21.27 25.25
205 1 34.58 6.14 39.48
206 1 11.51 30.52 33.53
207 1 32.22 9.28 30.52
208 1 0.7 4.01 38.87
209 1 32.66 39.86 36.84
210 1 27.34 34.57 21.76
211 1 13.7 23.12 8.34
212 1 28 9.71 6.29
213 1 31.69 26.39 38.19
214 1 2.04 20.93 36.95
215 1 30.31 26.61 12.31
216 1 25.37 20.63 9.4
217 1 16.29 5.62 14.04
218 1 1.36 1.95 4.97
219 1 38.75 26.8 5.62
220 1 40.28 29.89 12.27
221 1 0.52 31.22 7.58
222 1 15.64 21.64 14.71
223 1 10.11 28.8 9.67
224 1 19.03 37.3 38.87
225 1 12.07 6.46 19.25
226 1 36.22 21.11 15.02
227 1 12.49 15.69 7.21
228 1 25.2 30.8 19.71
229 1 8.24 35.22 23.02
230 1 9.94 4.1 1.86
231 1 4.31 19.07 26.23
232 1 22.03 19.99 14.19
233 1 30.84 5.24 2.75
234 1 35.51 30.52 32.3
235 1 3.88 20.41 39.48
236 1 30.86 0.39 31.56
237 1 25.91 27.12 39.04
238 1 33.39 5.37 4.51
239 1 20.58 28.33 37.53
240 1 11.83 21.81 39.11
241 1 39.94 5.2 5.73
242 1 29.89 33.21 15.44
243 1 23.42 15.38 30.98
244 1 28.66 11.56 16.13
245 1 16.74 20.43 21.72
246 1 9.31 0.26 22.42
247 1 4.38 37.78 14.12
248 1 13.86 4.65 16.99
249 1 6.72 27.43 8.14
250 1 33.45 18.74 19.98
251 1 17.34 14.55 35.57
252 1 14.21 37.39 28.76
253 1 26.29 29.06 22.26
254 1 36.52 26.18 15.62
255 1 17.6 8.81 10.14
256 1 21.95 25.19 17.69
257 1 17.4 7.46 18.59
258 1 6.15 29.7 35.99
259 1 9.73 37.39 24.96
260 1 28.58 28.21 36.19
261 1 8.24 13.72 32.2
262 1 13.25 34.6 22.71
263 1 38.58 7.98 10.3
264 1 18.29 29.75 23.51
265 1 3.74 13.22 31.05
266 1 30.78 0.7 24.57
267 1 24.5 12.94 10.81
268 1 33.88 26.44 1.96
269 1 29.92 22.6 9.59
270 1 15.87 21.94 33.44
271 1 23.63 8.41 10.95
272 1 26.53 0.01 7.58
273 1 33.88 8.73 2.52
274 1 39.74 31.46 36.87
275 1 13.28 39.54 37
276 1 24.74 35.41 32.14
277 1 17.3 34.32 6.85
278 1 24.43 13.36 5.63
279 1 31.23 17.12 7.11
280 1 15.58 37.85 34.06
281 1 25.93 38.17 3.13
282 1 31.84 34.34 39.67
283 1 14.41 17.74 14.43
284 1 9.4 1.78 29.53
285 1 8.29 29.61 6.81
286 1 7.13 17.36 -0.19
287 1 38.04 19.52 11.25
288 1 34.87 32.77 38.75
289 1 27.18 22.49 5.69
290 1 29.69 27.11 20.29
291 1 25.23 2.22 39.75
292 1 35.8 17.1 36.09
293 1 20.53 17.67 35.47
294 1 23.41 31.36 2.24
295 1 25.17 20.09 29.2
296 1 0.32 9.28 39.74
297 1 22.49 18.77 29.89
298 1 38.64 0.85 39.43
299 1 18.55 5.87 9.15
300 1 35.21 28.69 25.76
301 1 39.24 15.68 6.36
302 1 5.91 13.29 3.92
303 1 0.5 21.25 21.62
304 1 34.39 9.43 18.59
305 1 22.7 1.03 8.79
306 1 40.15 16.25 24.87
307 1 16.52 13.69 10.25
308 1 6.88 36.77 39.57
309 1 11.95 37.1 7.59
310 1 19.49 26.66 9.76
311 1 36.34 29.89 29.31
312 1 18.76 35.75 12.72
313 1 23.15 38.68 4.96
314 1 10.78 17.11 34.38
315 1 13.58 14.89 0.34
316 1 4.73 33.88 32.41
317 1 12.68 29.51 17.07
318 1 9.45 27 4.98
319 1 29.02 19.27 6.45
320 1 19.09 36.35 19.84
321 1 23.13 6.75 19.78
322 1 8.02 34.1 26.95
323 1 26.03 14.18 1.57
324 1 15.01 34.16 28.32
325 1 28.71 36.53 15.08
326 1 9.64 13.94 24.05
327 1 1.24 36.96 30.41
328 1 15.44 31.39 4.77
329 1 25.72 14.42 38.01
330 1 7.35 31.84 12.61
331 1 32.33 16.79 3.07
332 1 15.86 0.39 8.39
333 1 27.69 7.32 25.74
334 1 27.77 1.17 4.96
335 1 29.38 26.68 23.48
336 1 14.95 3.41 2.13
337 1 2.45 38.8 17.54
338 1 9.18 27.58 31.12
339 1 36.62 15.23 23.66
340 1 12.23 30.74 10.85
341 1 12.87 0.23 24.05
342 1 33.85 35.75 19.95
343 1 36.36 30.35 13.94
344 1 38.11 8.15 5.49
345 1 15.58 1.29 29.89
346 1 25.95 30.47 39.19
347 1 27.69 15.5 13.37
348 1 25.48 13.7 25.29
349 1 0.72 39.53 4.41
350 1 8.75 15.21 5.79
351 1 10.49 26.46 27.25
352 1 16.9 20.08 26.58
353 1 3.95 4.33 20.25
354 1 18.03 7.66 31.87
355 1 21.35 2.88 17.26
356 1 32.92 22.68 6.56
357 1 21.72 4.62 12.02
358 1 37.6 6.04 25.2
359 1 22.22 23.78 7.36
360 1 12.53 19.53 10.6
361 1 17.87 26.05 19.32
362 1 20.94 30.75 31.23
363 1 22.33 11.87 35.79
364 1 28.54 6.88 10.52
365 1 29.58 26.13 8.56
366 1 19.06 24.2 21.73
367 1 25.05 38.41 26.91
368 1 18.66 40.35 4.69
369 1 11.87 6.75 12.72
370 1 17.99 11.82 37.79
371 1 8.97 24.7 0.61
372 1 26.89 1.52 31.33
373 1 6.88 22.51 14.06
374 1 29.51 3.87 13.35
375 1 0.95 14.53 10
376 1 26.43 31.54 11.63
377 1 6.1 35.16 11.28
378 1 10.2 15.91 28.7
379 1 13.24 25.67 24.3
380 1 34.5 3.91 20.22
381 1 22.48 2.17 5.2
382 1 24.26 16.15 11.3
383 1 20.63 32.57 27.3
384 1 39.95 6.81 1.05
385 1 24.38 34.78 38.27
386 1 4.63 23.56 0.55
387 1 33.5 8.38 36.97
388 1 5.76 27.14 12.06
389 1 37.45 26.58 32.25
390 1 2.8 8.96 32.35
391 1 5.29 39.84 30.1
392 1 29.2 26.49 31.18
393 1 33.91 27.39 12.89
394 1 3.37 14.19 39.34
395 1 30.68 28.7 27
396 1 2.59 18.45 19.38
397 1 13.55 0.75 27.35
398 1 3.82 20.12 16.1
399 1 37.72 0.72 34.29
400 1 23.85 3.32 19.46
401 1 4.78 0.67 38.23
402 1 22.78 23.26 38.6
403 1 11.56 39.29 4.23
404 1 21.38 32.45 5.39
405 1 8.32 19.42 9.52
406 1 28.43 31.07 17.8
407 1 11.02 5.75 39.84
408 1 27.36 36.71 7.62
409 1 34.22 16.74 27.88
410 1 3.22 22.01 27.42
411 1 29.2 15.76 32.33
412 1 25.29 23.44 2.2
413 1 10.8 32.43 39.96
414 1 32.2 1.41 4.44
415 1 32.94 15.59 37.21
416 1 6.8 8.08 0.84
417 1 10.42 9.91 37.73
418 1 1.18 31.39 3.93
419 1 10.1 36.38 38.57
420 1 32.89 26.96 35.07
421 1 28.12 11.93 25.96
422 1 4.9 29.15 -0.25
423 1 2.21 27.99 3.72
424 1 11.33 3.94 25.55
425 1 3.3 30.26 10.78
426 1 11.57 27.26 19.31
427 1 21.79 32.67 13.3
428 1 4.96 26.53 33.78
429 1 33.41 32.87 18.46
430 1 13.92 30.37 20.3
431 1 16.91 3.5 11.57
432 1 -0.06 4.42 34.05
433 1 7.04 24.33 16.85
434 1 28.66 11.93 19.73
435 1 30.21 1.75 36.36
436 1 3.91 6.2 6.26
437 1 7.01 25.6 27.34
438 1 34 1.06 18.12
439 1 29.14 8.5 3.09
440 1 40.13 23.52 16.94
441 1 21.69 22.38 26.78
442 1 18.44 32.85 39.84
443 1 38.87 1.99 27.63
444 1 10.47 12.02 33.68
445 1 9.65 19.94 21.88
446 1 25.04 8.12 27.89
447 1 12.18 16.78 31.09
448 1 38.31 8.2 30.6
449 1 0.11 5.21 18.12
450 1 23.48 7.88 38.7
451 1 7.9 11.99 7.04
452 1 2.09 34.5 8.64
453 1 19 18.3 0.42
454 1 37.94 18.06 15.21
455 1 25.05 33.33 29.55
456 1 33.74 37.88 34.54
457 1 36.07 29.5 17.47
458 1 27.7 13.54 10.46
459 1 27.18 23.18 21.06
460 1 17.49 2.04 23.22
461 1 23.84 26.31 36.76
462 1 31.08 32.24 24.92
463 1 17.7 28.73 16.66
464 1 1.59 15.5 18.04
465 1 33.49 18.99 8.75
466 1 1.19 8.43 28.01
467 1 5.43 20.26 22.25
468 1 23.3 5.31 15.05
469 1 27.09 4.47 21.96
470 1 26.61 27.48 28.83
471 1 13 3.18 13.4
472 1 36.09 34.56 10.58
473 1 19.09 15.33 7.48
474 1 12.94 18.16 22.07
475 1 38.8 16.16 36.73
476 1 16.73 39.94 -0.46
477 1 3.64 12.56 9.42
478 1 27.64 3.31 18.29
479 1 15.58 12.36 4.52
480 1 15.37 11.18 18.19
481 1 37.52 11.23 14.94
482 1 37.16 2.3 10.01
483 1 36.19 9.86 21.99
484 1 36.38 21.09 4.76
485 1 38.15 12.94 25.35
486 1 15.1 29.65 24.64
487 1 16.54 29.12 38.85
488 1 33.86 11.39 14.4
489 1 27.99 18.55 9.87
490 1 0.66 1.26 8.28
491 1 29.89 33.84 29.75
492 1 6.64 33.3 6.74
493 1 31.47 0.39 11.25
494 1 8.76 15.96 10.74
495 1 39.6 15.8 21.04
496 1 22.38 28.55 19.85
497 1 25.87 6.23 5.4
498 1 36.24 26.67 38.61
499 1 23.05 8.79 7.01
500 1 32.05 4.16 8.87
501 1 35.3 13.36 38.03
502 1 39.91 25.91 36.45
503 1 32.17 17.27 31.82
504 1 29.99 21.54 20.57
505 1 9.39 0.57 34.17
506 1 22.12 17.22 13.03
507 1 15.23 16.27 24.39
508 1 26.32 25.89 13.26
509 1 39.25 3.46 1.34
510 1 32.56 10.28 7.96
511 1 25.76 14.8 34.79
512 1 32.12 5.38 36.94
513 1 17.74 15.37 14.87
514 1 21.93 3.26 25.26
515 1 24.05 0.48 36.27
516 1 8.2 19.02 33.92
517 1 33.07 25.88 24.79
518 1 12.54 0.52 32.8
519 1 18.5 6.34 23.21
520 1 35.93 10.26 34.79
521 1 19.33 11.86 6.94
522 1 1.63 5.31 25.43
523 1 30.62 36.78 30.77
524 1 12.25 26.79 13.74
525 1 21 1.47 13.99
526 1 22.24 29.36 34.11
527 1 29.05 1.74 0.24
528 1 19.34 25.14 39.77
529 1 12.9 25.42 35.42
530 1 4.1 20.69 33.31
531 1 35.38 5.64 9.17
532 1 5.01 34.03 23.36
533 1 15.7 10.01 7.1
534 1 25.95 19.48 24.73
535 1 11.15 4.16 21.43
536 1 1.47 3.23 13.72
537 1 26.54 36.76 17.48
538 1 7.65 30.6 27.73
539 1 18.59 3.05 3.32
540 1 6.92 36.14 15.67
541 1 12.72 36.21 32.72
542 1 16.33 26.24 14.35
543 1 21.66 12.61 26.18
544 1 15.72 32.37 10.71
545 1 27.57 15.75 4.97
546 1 20.18 39.13 18.44
547 1 18.77 17.09 4.74
548 1 12.75 14.08 17.89
549 1 10.71 37.26 35.13
550 1 20.88 32.12 9.94
551 1 8.69 0.06 9.54
552 1 1.58 12.61 26.42
553 1 10.29 22.73 13.14
554 1 23.31 25.7 4.97
555 1 36.7 30.78 5.26
556 1 5.6 28.71 23.76
557 1 13.04 7.91 15.46
558 1 40.24 33.53 34.5
559 1 39.7 18.36 34.25
560 1 23.52 22.84 21.14
561 1 32.82 27.9 5.02
562 1 1.52 33.77 27.04
563 1 31.48 18.68 13.1
564 1 34 24.07 34.55
565 1 34.72 25.03 30.45
566 1 18.92 5.7 16.54
567 1 15.26 40.2 16.97
568 1 24.55 16.8 26.26
569 1 17.59 18.03 31.75
570 1 12.08 27.38 38.42
571 1 31.42 21.91 35.27
572 1 9.68 6.93 36.96
573 1 22.93 15.19 2.53
574 1 11.83 24.38 2.24
575 1 16.02 12.44 31.42
576 1 20.24 10.7 20.15
577 1 37.38 17.37 40.63
578 1 3.74 17.41 22.49
579 1 23.21 9.86 23.99
580 1 2.49 36.56 38
581 1 20.51 1.54 22.62
582 1 8.23 33.44 33.15
583 1 30.93 8.12 14.85
584 1 36.35 3.92 37.65
585 1 5.57 10.63 28.64
586 1 30.24 22.84 4.6
587 1 3.24 15.97 7.43
588 1 22.64 0.7 27.09
589 1 1.64 40.37 27.74
590 1 30.53 35.28 3.5
591 1 25.55 4.7 2.53
592 1 22.04 29.56 12.29
593 1 3.42 8.76 2.28
594 1 16.37 37.65 7.87
595 1 20.65 12.75 2.9
596 1 8.07 20.49 2.6
597 1 20.04 24.72 28.2
598 1 29.75 0.33 16.1
599 1 31.36 33.09 8.02
600 1 8.6 10.56 2.65
601 1 20.55 33.93 33.71
602 1 23.11 -0.42 31.7
603 1 27.07 6.69 18.5
604 1 15.65 23.71 11.8
605 1 23.88 24.17 30.1
606 1 0.79 32.46 16.99
607 1 25.96 20.19 2.43
608 1 35.16 12.33 4.73
609 1 16.53 17.12 10.45
610 1 19.74 35.94 8.62
611 1 -0.24 28.29 28.3
612 1 33.15 4.39 12.64
613 1 24.27 18.59 33.59
614 1 0.3 9.61 23.54
615 1 5.52 10.89 34.71
616 1 9.85 26.26 34.42
617 1 25.54 37.74 39.13
618 1 4.11 29.65 5.81
619 1 30.86 22.72 31.07
620 1 39.54 34.54 23.24
621 1 15.03 9.34 12.11
622 1 21.93 38.49 9.53
623 1 18.21 19.2 16.65
624 1 38.71 32.83 14.49
625 1 37.74 36.38 31.43
626 1 7.57 2.2 1.07
627 1 12.27 10.05 1.53
628 1 18.32 19.55 12.51
629 1 12.49 24.81 16.57
630 1 35.07 31.62 22.85
631 1 4.91 19.68 30.45
632 1 11.36 2.92 36.19
633 1 26.76 35.53 1.29
634 1 1.13 14.55 14.77
635 1 8.2 25.14 37.83
636 1 -0.5 0.85 23.08
637 1 17.95 18.01 37.61
638 1 2.44 37.75 0.71
639 1 3.77 23.41 17.91
640 1 3.34 14.41 35.96
641 1 14.89 31.42 31.76
642 1 15.72 22.91 30.66
643 1 37.42 3.13 5.51
644 1 1.51 38.14 20.78
645 1 12.55 18.16 25.81
646 1 18.98 15.88 29.21
647 1 17.33 32.04 27.87
648 1 31.21 37.38 22.84
649 1 11.88 32.4 31
650 1 25.1 2.19 12.69
651 1 38.85 39.1 27.87
652 1 5.9 16.14 33.34
653 1 6.3 17.5 36.46
654 1 2.28 25.02 12.53
655 1 19.33 25.49 6.78
656 1 8.57 37.22 8.4
657 1 22 38.61 24.14
658 1 35.63 3.23 2.15
659 1 37.35 22.64 9.99
660 1 25.46 28.22 33.18
661 1 13.99 4.21 9.07
662 1 9.04 40.64 37.59
663 1 17.46 6.49 27.93
664 1 1.42 6.14 30.2
665 1 25.82 28.28 10.33
666 1 30.71 30.2 -0.02
667 1 8.05 29.32 0.62
668 1 6.49 3.17 6.65
669 1 7.77 39.88 26.03
670 1 28.53 12.14 30.96
671 1 6.25 12.64 39.55
672 1 3.78 7.96 25.83
673 1 28.69 29.58 6.61
674 1 5.32 18.55 8.6
675 1 5.3 11.44 14.19
676 1 39 12.03 36.99
677 1 11.08 32.51 19.12
678 1 38.48 1.03 20.34
679 1 38.47 11.31 10.12
680 1 3.65 20.3 11.99
681 1 27.18 11.39 3.4
682 1 29.61 20.72 38.86
683 1 31.88 4.82 24.75
684 1 14.52 36.61 25.66
685 1 21.68 19.96 24.58
686 1 1.2 13.59 23.16
687 1 37.71 5.97 35.28
688 1 19.81 22.04 37.54
689 1 40.67 27.07 10.14
690 1 38.57 13.96 13.75
691 1 18.15 17.19 21.63
692 1 3.76 27.51 30.32
693 1 11.39 25.09 7.96
694 1 28.95 22.02 13.33
695 1 31.72 35.46 35.33
696 1 15.17 6.03 23.94
697 1 9.63 9.42 22.18
698 1 27.76 4.1 38.61
699 1 27.37 37.46 11.07
700 1 35.69 15.24 6.39
701 1 21.92 33.09 36.84
702 1 4.79 15.51 13.28
703 1 9.31 26.44 22.8
704 1 30.14 38.31 6.98
705 1 4.33 6.66 13.77
706 1 3.66 27.15 37.83
707 1 0.44 24.06 29.62
708 1 35.4 9.59 9.8
709 1 33.77 39.44 21.41
710 1 29.2 18.74 24.38
711 1 34.14 30 7.36
712 1 16.02 4.37 6.43
713 1 35.75 39.41 40.58
714 1 15.32 11.84 23.24
715 1 32.52 24.39 20.97
716 1 11.45 2.9 7.16
717 1 7.07 34.28 36.04
718 1 11.41 8.83 7.57
719 1 29.29 27.79 16.55
720 1 2.41 9.16 16.14
721 1 13.14 38.07 12.01
722 1 37.45 14.26 18.3
723 1 34.64 18.37 16.65
724 1 29.26 34.28 33.46
725 1 13.67 19.83 3.04
726 1 19.64 2.6 32.95
727 1 23.61 23.55 11.34
728 1 6.87 22.5 36.5
729 1 36.78 28.34 22.96
730 1 11.3 13.98 9.84
731 1 20.82 19.73 9.16
732 1 12.65 12.61 6.16
733 1 9.25 7.81 25.28
734 1 25.4 29.36 5.84
735 1 17.86 9.06 4.45
736 1 35.84 40.51 26.06
737 1 26.97 21.28 31.59
738 1 39.94 38.14 24.86
739 1 3.16 17.07 2.49
740 1 14.08 15.4 36.99
741 1 26.1 13.88 29.68
742 1 26.36 20 20.56
743 1 12.02 6.35 27.65
744 1 11.21 19.14 15.27
745 1 35.86 22.93 26.81
746 1 32.26 12.62 2.68
747 1 29.36 4.91 6.86
748 1 20.14 7.97 29.32
749 1 25.53 11.2 36.18
750 1 30.36 14.25 24.79
751 1 29.84 38.37 39.29
752 1 15.79 36.4 4.26
753 1 32.59 14.17 10.29
754 1 13.89 34.54 15.42
755 1 12.13 33.62 7.27
756 1 25.86 23.81 33.97
757 1 18.4 31.27 34.96
758 1 6.58 40.49 17.57
759 1 5.64 39.86 23.05
760 1 25.32 33 16.24
761 1 0.98 10.99 12.21
762 1 32.86 23.75 12.41
763 1 32.91 1.3 26.94
764 1 9.46 8.66 31.47
765 1 17.49 15.53 1.82
766 1 8.17 18.16 15.3
767 1 4.84 30.63 26.32
768 1 6.75 37.1 30.8
769 1 7.16 5.72 15.74
770 1 20.09 17.82 19.18
771 1 1.02 27.99 32.54
772 1 21.44 1.28 38.4
773 1 21.06 14.62 37.08
774 1 27.82 18.99 15.96
775 1 33.51 21.46 22.82
776 1 8.29 2.79 17.09
777 1 18.14 11.41 28.62
778 1 17.94 28.54 32.73
779 1 36.1 9.54 40.1
780 1 36.55 2.62 22.97
781 1 27.29 10.41 39.35
782 1 22.04 37.76 2.02
783 1 23.01 30.08 16.58
784 1 6.34 15.31 21.61
785 1 7.3 22.39 7.74
786 1 38 5.77 21.04
787 1 32.93 12.85 26.58
788 1 22.43 15.36 16.72
789 1 18.54 2.38 8.35
790 1 0.62 31.88 23.84
791 1 39.56 30.3 21.7
792 1 7.56 11.78 25.2
793 1 16.05 3.98 26.72
794 1 24.33 36.16 13.16
795 1 26.38 31.24 35.77
796 1 14.94 26.46 -0.44
797 1 3.53 28 19.79
798 1 11.94 32.27 25.88
799 1 34.59 15.06 19.23
800 1 3.51 10.62 24.22
801 1 13.18 21.59 35.52
802 1 19.95 13.15 16.23
803 1 24.48 9.63 19.58
804 1 37.7 34.42 19.19
805 1 22.84 19.59 5.52
806 1 34.62 36.75 12.26
807 1 10.33 21.85 25.15
808 1 21.51 29.7 7.23
809 1 34.05 3 30.58
810 1 12.43 29.67 5.59
811 1 18.94 21.82 29.31
812 1 39.21 17.7 4
813 1 7.04 2.97 37.09
814 1 30.87 10.8 22.09
815 1 33.54 7.16 23.15
816 1 32.82 32.27 11.47
817 1 21.8 14.54 21.61
818 1 38.83 6.69 13.68
819 1 30.37 39.05 18.66
820 1 31.21 15.08 13.79
821 1 1.07 11.97 35.04
822 1 26.02 35.8 35.47
823 1 27.64 33.32 8.04
824 1 39.57 36.88 4.39
825 1 14.48 30.97 36.87
826 1 36.86 27.04 8.96
827 1 34.73 26.27 19.55
828 1 29.24 29.12 10.86
829 1 8.35 39.9 13.92
830 1 5.43 5.1 31.85
831 1 18.36 22.31 5.89
832 1 2.46 27.35 16.36
833 1 21.76 37.05 27.45
834 1 29.32 17.11 2.28
835 1 3.58 21.98 3.09
836 1 10.61 9.17 10.69
837 1 25.15 17.54 6.05
838 1 3.4 22.81 7.03
839 1 16.12 23.66 38.29
840 1 8.67 4.79 31.8
841 1 27.82 0.02 20.45
842 1 4.46 2.44 29.46
843 1 39.11 22.69 36.33
844 1 4.26 2.45 34.43
845 1 13.47 3.5 30.9
846 1 26.92 22.55 26.54
847 1 5.66 30.07 30.65
848 1 31.58 35.68 25.46
849 1 31.23 5.65 27.78
850 1 8.76 19.49 28.61
851 1 24.13 8.02 2.3
852 1 8.27 6.8 4.93
853 1 15.31 34.36 37.63
854 1 3.96 35.82 26.97
855 1 24.95 4.01 29.96
856 1 26.54 25.95 19.15
857 1 17.76 29.23 5.35
858 1 16.95 21.79 0.78
859 1 17.52 39.02 13.01
860 1 20.5 22.86 10.41
861 1 27.67 27.07 2.78
862 1 37.1 31.02 2.03
863 1 37.17 2.24 16.34
864 1 24.51 34.69 10.28
865 1 17.38 13.41 21.4
866 1 38 9.37 17.94
867 1 35.67 25.27 5.3
868 1 22.66 4.47 0.97
869 1 20.06 28.17 27.42
870 1 27.33 2.38 9.79
871 1 36.4 10.73 31.42
872 1 0.53 9.45 6.96
873 1 12.89 9.03 25.13
874 1 37.5 23.54 21.33
875 1 7.19 28.87 19.11
876 1 21.45 32.81 22.71
877 1 8.76 8.3 13.51
878 1 10.24 31.46 3.73
879 1 15.93 9.7 35.82
880 1 14.92 19.46 39.91
881 1 13.02 22.03 27.3
882 1 34.57 1.59 34.73
883 1 0.5 21.04 30.77
884 1 24.84 32.67 4.97
885 1 30.96 4.24 17.34
886 1 23.63 8.84 32.7
887 1 6.84 3.83 26.13
888 1 31.57 9.23 27.06
889 1 14.99 35.15 0.07
890 1 36.29 40.01 8.22
891 1 18 36.86 35.66
892 1 11.5 29.22 0.37
893 1 35.18 36.03 24.88
894 1 14.49 9.41 27.73
895 1 10.12 12.91 0.99
896 1 11.91 29.4 27.3
897 1 25.51 28.68 14.56
898 1 29.32 12.95 35.59
899 1 2.96 0.59 0.53
900 1 5.47 5.35 9.88
901 1 8.93 39.33 1.78
902 1 39.68 38.49 12.33
903 1 3.78 1.24 11.85
904 1 29.54 33.76 11.99
905 1 7.48 6.16 28.8
906 1 10.83 33.63 36.96
907 1 22.03 19.06 21.39
908 1 31.68 31 3.71
909 1 35.32 0.3 30.88
910 1 9.93 35.42 14.85
911 1 21.01 10.66 12.97
912 1 22.54 21.62 33.81
913 1 12.48 12.46 25.15
914 1 0.64 27.93 39.01
915 1 13.88 27.29 3.8
916 1 13.03 20.93 19.25
917 1 5.7 37.48 34.09
918 1 2.27 35.08 14.29
919 1 21.75 26.44 13.48
920 1 10.66 11.35 17.49
921 1 36.67 34.72 27.69
922 1 8.23 22.8 33.36
923 1 4.79 4.05 3.48
924 1 35.61 35 35.21
925 1 31.38 37.67 10.06
926 1 26.44 35.58 27.52
927 1 25.53 4.47 8.03
928 1 38.81 33.08 31.55
929 1 29.62 39.68 34.32
930 1 0.76 3.88 10.61
931 1 24.06 30.13 24.84
932 1 18.77 8.38 37.02
933 1 2.81 24.14 24.45
934 1 11.33 1.25 19.69
935 1 1.61 26.53 6.48
936 1 9.52 29.81 35.98
937 1 7.83 31.75 20.77
938 1 9.67 23.93 20.57
939 1 33.96 16.95 24.79
940 1 37.55 37.31 37.17
941 1 6.2 24.19 31.13
942 1 17.79 4.35 30.56
943 1 13.51 20.25 30.45
944 1 14.76 12.48 13.13
945 1 32.56 27.52 30.41
946 1 35.81 40.1 4.85
947 1 39.01 25.43 27.07
948 1 22.8 5.53 32.22
949 1 2.35 39.55 32.5
950 1 3.31 31.51 34.19
951 1 40.63 37.01 15.9
952 1 18.43 35.86 30.77
953 1 37.01 39.18 15.57
954 1 6.74 6.26 21.64
955 1 5.22 24.94 22.53
956 1 25.2 11.08 13.98
957 1 14.66 -0.14 5
958 1 14.96 8.38 20.32
959 1 1.89 23.03 10.1
960 1 33.01 11.23 39.32
961 1 32.68 6.79 32.04
962 1 6.25 25.81 3.82
963 1 18.37 31.97 14.57
964 1 9.74 30.21 22.71
965 1 3.09 1.52 19.38
966 1 33.98 37.34 5.63
967 1 32.19 28.35 15.8
968 1 24.4 15.49 19.39

View File

@ -1,69 +0,0 @@
units real
dimension 3
boundary p p p
atom_style atomic
newton on
timestep 1.0
read_data methanol.data
velocity all create 300.0 16802 dist gaussian
pair_style table spline 15000
pair_coeff 1 1 lammps_nb_MET-MET.table nb_METMET 12.0
neigh_modify delay 0 every 1 check yes one 10000
neighbor 12.0 bin
thermo 500
thermo_style custom step temp pe etotal press vol
variable STEP equal step
variable TEMP equal temp
## volume from cubic angstroms to cubic nm
variable VOL equal vol/1000.0
## pressure from atm to bar
variable PRESS equal press*1.01325
variable PXX equal pxx*1.01325
variable PYY equal pyy*1.01325
variable PZZ equal pzz*1.01325
variable PXY equal pxy*1.01325
variable PXZ equal pxz*1.01325
variable PYZ equal pyz*1.01325
## energy from kcal/mol to kJ/mol
variable KE equal ke*4.184
variable PE equal pe*4.184
variable UVDW equal evdwl*4.184
##### SPECIAL COMMANDS FOR FIX_BOCS #####
# ID group-ID style_name thermostat T_init T_end T_couple barostat P_start P_end P_couple pmatch_basis avg_vol N_sites N_coeffs coeff1 coeff2
fix 1 all bocs temp 300.0 300.0 100.0 cgiso 0.986 0.986 1000.0 analytic 66476.015 968 2 245030.10 8962.20
# Report the modified pressure
thermo_modify press 1_press
## Save some data from simulation to files
fix print_temp all print 500 "${STEP} ${TEMP}" file temp.dat screen no
fix print_vol all print 500 "${STEP} ${VOL}" file vol.dat screen no
fix print_press all print 500 "${STEP} ${PRESS}" file press.dat screen no
fix print_ke all print 500 "${STEP} ${KE}" file kinetic_E.dat screen no
fix print_pe all print 500 "${STEP} ${PE}" file potential_E.dat screen no
fix print_ve all print 500 "${STEP} ${UVDW}" file vdw_E.dat screen no
fix print_press_tens all print 500 "${STEP} ${PXX} ${PYY} ${PZZ} ${PXY} ${PXZ} ${PYZ}" file press_tens.dat screen no
fix print_PV_eos all print 500 "${VOL} ${PRESS}" file pv_eos.dat screen no
## Prints a configuration to dump.txt every 500 steps
dump 1 all custom 500 dump.txt id type x y z fx fy fz
# Write restart files to continue simulations
restart 10000 state1.restart state2.restart
## Run for this many steps
run_style verlet
run 10000

View File

@ -9,14 +9,14 @@
the GNU General Public License. the GNU General Public License.
See the README file in the top-level LAMMPS directory. See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- -------------------------------------------------------------------------
USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
from The Pennsylvania State University from The Pennsylvania State University
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#include <mpi.h> #include <mpi.h>
#include <string.h> #include <cstring>
#include <stdlib.h> #include <cstdlib>
#include "compute_pressure_bocs.h" #include "compute_pressure_bocs.h"
#include "atom.h" #include "atom.h"
#include "update.h" #include "update.h"
@ -41,8 +41,8 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg), Compute(lmp, narg, arg),
vptr(NULL), id_temp(NULL) vptr(NULL), id_temp(NULL)
{ {
if (narg < 4) error->all(FLERR,"Illegal compute pressure command"); if (narg < 4) error->all(FLERR,"Illegal compute pressure/bocs command");
if (igroup) error->all(FLERR,"Compute pressure must use group all"); if (igroup) error->all(FLERR,"Compute pressure/bocs must use group all");
scalar_flag = vector_flag = 1; scalar_flag = vector_flag = 1;
size_vector = 6; size_vector = 6;
@ -51,7 +51,7 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) :
pressflag = 1; pressflag = 1;
timeflag = 1; timeflag = 1;
p_match_flag = 0; // NJD MRD p_match_flag = 0;
// store temperature ID used by pressure computation // store temperature ID used by pressure computation
// insure it is valid for temperature computation // insure it is valid for temperature computation
@ -64,9 +64,9 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) :
int icompute = modify->find_compute(id_temp); int icompute = modify->find_compute(id_temp);
if (icompute < 0) if (icompute < 0)
error->all(FLERR,"Could not find compute pressure temperature ID"); error->all(FLERR,"Could not find compute pressure/bocs temperature ID");
if (modify->compute[icompute]->tempflag == 0) if (modify->compute[icompute]->tempflag == 0)
error->all(FLERR,"Compute pressure temperature ID does not " error->all(FLERR,"Compute pressure/bocs temperature ID does not "
"compute temperature"); "compute temperature");
} }
@ -96,7 +96,7 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) :
pairflag = 1; pairflag = 1;
bondflag = angleflag = dihedralflag = improperflag = 1; bondflag = angleflag = dihedralflag = improperflag = 1;
kspaceflag = fixflag = 1; kspaceflag = fixflag = 1;
} else error->all(FLERR,"Illegal compute pressure command"); } else error->all(FLERR,"Illegal compute pressure/bocs command");
iarg++; iarg++;
} }
} }
@ -104,7 +104,7 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) :
// error check // error check
if (keflag && id_temp == NULL) if (keflag && id_temp == NULL)
error->all(FLERR,"Compute pressure requires temperature ID " error->all(FLERR,"Compute pressure/bocs requires temperature ID "
"to include kinetic energy"); "to include kinetic energy");
vector = new double[6]; vector = new double[6];
@ -135,7 +135,7 @@ void ComputePressureBocs::init()
if (keflag) { if (keflag) {
int icompute = modify->find_compute(id_temp); int icompute = modify->find_compute(id_temp);
if (icompute < 0) if (icompute < 0)
error->all(FLERR,"Could not find compute pressure temperature ID"); error->all(FLERR,"Could not find compute pressure/bocs temperature ID");
temperature = modify->compute[icompute]; temperature = modify->compute[icompute];
} }
@ -182,13 +182,13 @@ void ComputePressureBocs::init()
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
Compute the pressure correction for the analytical basis set Compute the pressure correction for the analytical basis set
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
double ComputePressureBocs::get_cg_p_corr(int N_basis, double *phi_coeff, double ComputePressureBocs::get_cg_p_corr(int N_basis, double *phi_coeff,
int N_mol, double vavg, double vCG) int N_mol, double vavg, double vCG)
{ {
double correction = 0.0; double correction = 0.0;
for (int i = 1; i <= N_basis; ++i) for (int i = 1; i <= N_basis; ++i)
{ {
correction -= phi_coeff[i-1] * ( N_mol * i / vavg ) * correction -= phi_coeff[i-1] * ( N_mol * i / vavg ) *
pow( ( 1 / vavg ) * ( vCG - vavg ),i-1); pow( ( 1 / vavg ) * ( vCG - vavg ),i-1);
} }
return correction; return correction;
@ -201,7 +201,7 @@ double ComputePressureBocs::find_index(double * grid, double value)
{ {
int i; int i;
double spacing = fabs(grid[1]-grid[0]); double spacing = fabs(grid[1]-grid[0]);
int gridsize = spline_length; int gridsize = spline_length;
for (i = 0; i < (gridsize-1); ++i) for (i = 0; i < (gridsize-1); ++i)
{ {
if (value >= grid[i] && value <= grid[i+1]) { return i; } if (value >= grid[i] && value <= grid[i+1]) { return i; }
@ -209,14 +209,14 @@ double ComputePressureBocs::find_index(double * grid, double value)
if (value >= grid[i] && value <= (grid[i] + spacing)) { return i; } if (value >= grid[i] && value <= (grid[i] + spacing)) { return i; }
for (int i = 0; i < gridsize; ++i) for (int i = 0; i < gridsize; ++i)
{ {
fprintf(stderr, "grid %d: %f\n",i,grid[i]); fprintf(stderr, "grid %d: %f\n",i,grid[i]);
} }
char * errmsg = (char *) calloc(100,sizeof(char)); char * errmsg = (char *) calloc(100,sizeof(char));
sprintf(errmsg,"Value %f does not fall within spline grid.\n",value); sprintf(errmsg,"Value %f does not fall within spline grid.\n",value);
error->all(FLERR,errmsg); error->all(FLERR,errmsg);
exit(1); exit(1);
} }
@ -224,20 +224,20 @@ double ComputePressureBocs::find_index(double * grid, double value)
Compute the pressure correction for a spline basis set Compute the pressure correction for a spline basis set
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
double ComputePressureBocs::get_cg_p_corr(double ** grid, int basis_type, double ComputePressureBocs::get_cg_p_corr(double ** grid, int basis_type,
double vCG) double vCG)
{ {
int i = find_index(grid[0],vCG); int i = find_index(grid[0],vCG);
double correction, deltax = vCG - grid[0][i]; double correction, deltax = vCG - grid[0][i];
if (basis_type == 1) if (basis_type == 1)
{ {
correction = grid[1][i] + (deltax) * correction = grid[1][i] + (deltax) *
( grid[1][i+1] - grid[1][i] ) / ( grid[0][i+1] - grid[0][i] ); ( grid[1][i+1] - grid[1][i] ) / ( grid[0][i+1] - grid[0][i] );
} }
else if (basis_type == 2) else if (basis_type == 2)
{ {
correction = grid[1][i] + (grid[2][i] * deltax) + correction = grid[1][i] + (grid[2][i] * deltax) +
(grid[3][i] * pow(deltax,2)) + (grid[4][i] * pow(deltax,3)); (grid[3][i] * pow(deltax,2)) + (grid[4][i] * pow(deltax,3));
} }
else else
@ -248,21 +248,21 @@ double ComputePressureBocs::get_cg_p_corr(double ** grid, int basis_type,
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
send cg info from fix_bocs to compute_pressure_bocs for the analytical send cg info from fix_bocs to compute_pressure_bocs for the analytical
basis set basis set
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void ComputePressureBocs::send_cg_info(int basis_type, int sent_N_basis, void ComputePressureBocs::send_cg_info(int basis_type, int sent_N_basis,
double *sent_phi_coeff, int sent_N_mol, double sent_vavg) double *sent_phi_coeff, int sent_N_mol, double sent_vavg)
{ {
if (basis_type == 0) { p_basis_type = 0; } if (basis_type == 0) { p_basis_type = 0; }
else else
{ {
error->all(FLERR,"Incorrect basis type passed to ComputePressureBocs\n"); error->all(FLERR,"Incorrect basis type passed to ComputePressureBocs\n");
} }
p_match_flag = 1; p_match_flag = 1;
N_basis = sent_N_basis; N_basis = sent_N_basis;
phi_coeff = ((double *) calloc(N_basis, sizeof(double)) ); phi_coeff = ((double *) calloc(N_basis, sizeof(double)) );
for (int i=0; i<N_basis; i++) { phi_coeff[i] = sent_phi_coeff[i]; } for (int i=0; i<N_basis; i++) { phi_coeff[i] = sent_phi_coeff[i]; }
@ -271,16 +271,16 @@ void ComputePressureBocs::send_cg_info(int basis_type, int sent_N_basis,
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
send cg info from fix_bocs to compute_pressure_bocs for a spline basis send cg info from fix_bocs to compute_pressure_bocs for a spline basis
set set
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void ComputePressureBocs::send_cg_info(int basis_type, void ComputePressureBocs::send_cg_info(int basis_type,
double ** in_splines, int gridsize) double ** in_splines, int gridsize)
{ {
if (basis_type == 1) { p_basis_type = 1; } if (basis_type == 1) { p_basis_type = 1; }
else if (basis_type == 2) { p_basis_type = 2; } else if (basis_type == 2) { p_basis_type = 2; }
else else
{ {
error->all(FLERR,"Incorrect basis type passed to ComputePressureBocs\n"); error->all(FLERR,"Incorrect basis type passed to ComputePressureBocs\n");
} }
splines = in_splines; splines = in_splines;
@ -302,7 +302,7 @@ double ComputePressureBocs::compute_scalar()
// invoke temperature if it hasn't been already // invoke temperature if it hasn't been already
double t; double t;
double volume, correction = 0; // NJD MRD double volume, correction = 0;
if (keflag) { if (keflag) {
if (temperature->invoked_scalar != update->ntimestep) if (temperature->invoked_scalar != update->ntimestep)
t = temperature->compute_scalar(); t = temperature->compute_scalar();
@ -311,28 +311,28 @@ double ComputePressureBocs::compute_scalar()
if (dimension == 3) { if (dimension == 3) {
inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd); inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd);
volume = (domain->xprd * domain->yprd * domain->zprd); // NJD MRD volume = (domain->xprd * domain->yprd * domain->zprd);
/* MRD NJD if block */ /* MRD NJD if block */
if ( p_basis_type == 0 ) if ( p_basis_type == 0 )
{ {
correction = get_cg_p_corr(N_basis,phi_coeff,N_mol,vavg,volume); correction = get_cg_p_corr(N_basis,phi_coeff,N_mol,vavg,volume);
} }
else if ( p_basis_type == 1 || p_basis_type == 2 ) else if ( p_basis_type == 1 || p_basis_type == 2 )
{ {
correction = get_cg_p_corr(splines, p_basis_type, volume); correction = get_cg_p_corr(splines, p_basis_type, volume);
} }
virial_compute(3,3); virial_compute(3,3);
if (keflag) if (keflag)
scalar = (temperature->dof * boltz * t + scalar = (temperature->dof * boltz * t +
virial[0] + virial[1] + virial[2]) / 3.0 * virial[0] + virial[1] + virial[2]) / 3.0 *
inv_volume * nktv2p + (correction); // NJD MRD correction inv_volume * nktv2p + (correction); correction
else else
scalar = (virial[0] + virial[1] + virial[2]) / 3.0 * scalar = (virial[0] + virial[1] + virial[2]) / 3.0 *
inv_volume * nktv2p + (correction); // NJD MRD correction inv_volume * nktv2p + (correction); correction
} else { } else {
if (p_match_flag) // NJD MRD if (p_match_flag)
{ {
error->all(FLERR,"Pressure matching not implemented in 2-d.\n"); error->all(FLERR,"Pressure matching not implemented in 2-d.\n");
exit(1); exit(1);

View File

@ -9,36 +9,35 @@
the GNU General Public License. the GNU General Public License.
See the README file in the top-level LAMMPS directory. See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- -------------------------------------------------------------------------
USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
from The Pennsylvania State University from The Pennsylvania State University
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS #ifdef COMPUTE_CLASS
ComputeStyle(pressureBocs,ComputePressureBocs) // MRD NJD ComputeStyle(PRESSURE/BOCS,ComputePressureBocs)
#else #else
// MRD NJD
#ifndef LMP_COMPUTE_PRESSURE_BOCS_H #ifndef LMP_COMPUTE_PRESSURE_BOCS_H
#define LMP_COMPUTE_PRESSURE_BOCS_H #define LMP_COMPUTE_PRESSURE_BOCS_H
#include "compute.h" #include "compute.h"
namespace LAMMPS_NS { namespace LAMMPS_NS {
// ComputePressure -> ComputePressureBocs MRD NJD // ComputePressure -> ComputePressureBocs MRD NJD
class ComputePressureBocs : public Compute { class ComputePressureBocs : public Compute {
public: public:
ComputePressureBocs(class LAMMPS *, int, char **); // MRD NJD ComputePressureBocs(class LAMMPS *, int, char **);
virtual ~ComputePressureBocs(); // MRD NJD virtual ~ComputePressureBocs();
virtual void init(); virtual void init();
virtual double compute_scalar(); virtual double compute_scalar();
virtual void compute_vector(); virtual void compute_vector();
void reset_extra_compute_fix(const char *); void reset_extra_compute_fix(const char *);
// NJD MRD double compute_cg_scalar();
double compute_cg_scalar();
double get_cg_p_corr(int, double *, int, double, double); double get_cg_p_corr(int, double *, int, double, double);
double get_cg_fluct(double, double); double get_cg_fluct(double, double);
void send_cg_info(int, int, double*, int, double); void send_cg_info(int, int, double*, int, double);

View File

@ -9,15 +9,15 @@
the GNU General Public License. the GNU General Public License.
See the README file in the top-level LAMMPS directory. See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- -------------------------------------------------------------------------
USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
from The Pennsylvania State University from The Pennsylvania State University
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#include <string.h> #include <cstring>
#include <stdlib.h> #include <cstdlib>
#include <math.h> #include <cmath>
#include "fix_bocs.h" #include "fix_bocs.h"
#include "math_extra.h" #include "math_extra.h"
#include "atom.h" #include "atom.h"
#include "force.h" #include "force.h"
@ -64,7 +64,7 @@ enum{ISO,ANISO,TRICLINIC};
NVT,NPH,NPT integrators for improved Nose-Hoover equations of motion NVT,NPH,NPT integrators for improved Nose-Hoover equations of motion
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg), Fix(lmp, narg, arg),
rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL), rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL),
eta(NULL), eta_dot(NULL), eta_dotdot(NULL), eta(NULL), eta_dot(NULL), eta_dotdot(NULL),
@ -155,20 +155,18 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :
iarg += 4; iarg += 4;
} else if (strcmp(arg[iarg],"iso") == 0) { } else if (strcmp(arg[iarg],"iso") == 0) {
error->all(FLERR,"Illegal fix bocs command. Pressure fix must be " error->all(FLERR,"Illegal fix bocs command. Pressure fix must be "
"cgiso . Use regular fix npt/nph for iso"); // MRD NJD "cgiso . Use regular fix bocs for iso"); // MRD NJD
} else if (strcmp(arg[iarg],"cgiso") == 0) { // MRD NJD the whole else if } else if (strcmp(arg[iarg],"cgiso") == 0) { // MRD NJD the whole else if
if (iarg+4 > narg) if (iarg+4 > narg)
{
error->all(FLERR,"Illegal fix bocs command. cgiso must be " error->all(FLERR,"Illegal fix bocs command. cgiso must be "
"followed by: P_0 P_f P_coupl"); "followed by: P_0 P_f P_coupl");
}
p_match_flag = 1; p_match_flag = 1;
pcouple = XYZ; pcouple = XYZ;
p_start[0] = p_start[1] = p_start[2] = p_start[0] = p_start[1] = p_start[2] =
force->numeric(FLERR,arg[iarg+1]); force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = p_stop[0] = p_stop[1] = p_stop[2] =
force->numeric(FLERR,arg[iarg+2]); force->numeric(FLERR,arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = p_period[0] = p_period[1] = p_period[2] =
force->numeric(FLERR,arg[iarg+3]); force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1; p_flag[0] = p_flag[1] = p_flag[2] = 1;
@ -179,38 +177,29 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :
} }
iarg += 4; iarg += 4;
if ( strcmp(arg[iarg], "analytic") == 0 ) if ( strcmp(arg[iarg], "analytic") == 0 ) {
{ if (iarg + 4 > narg) {
if (iarg + 4 > narg)
{
error->all(FLERR,"Illegal fix bocs command. basis type analytic" error->all(FLERR,"Illegal fix bocs command. basis type analytic"
" must be followed by: avg_vol n_mol n_pmatch_coeff"); " must be followed by: avg_vol n_mol n_pmatch_coeff");
} }
p_basis_type = 0; p_basis_type = 0;
vavg = atof(arg[iarg+1]); vavg = force->numeric(FLERR,arg[iarg+1]);
N_mol = atoi(arg[iarg+2]); N_mol = force->inumeric(FLERR,arg[iarg+2]);
N_p_match = atoi(arg[iarg+3]); N_p_match = force->inumeric(FLERR,arg[iarg+3]);
p_match_coeffs = (double *) (calloc(N_p_match, sizeof(double)) ); p_match_coeffs = (double *) (calloc(N_p_match, sizeof(double)) );
iarg += 4; iarg += 4;
if (iarg + N_p_match > narg) if (iarg + N_p_match > narg)
{ error->all(FLERR,"Illegal fix bocs command. Missing coeffs.");
error->all(FLERR,"Illegal fix bocs command. Missing coeffs.");
}
for (int pmatchi = 0; pmatchi < N_p_match; pmatchi++) for (int pmatchi = 0; pmatchi < N_p_match; pmatchi++)
{ p_match_coeffs[pmatchi] = force->numeric(FLERR,arg[iarg+pmatchi]);
p_match_coeffs[pmatchi] = atof(arg[iarg+pmatchi]);
}
iarg += (N_p_match); iarg += (N_p_match);
} else if (strcmp(arg[iarg], "linear_spline") == 0 ) } else if (strcmp(arg[iarg], "linear_spline") == 0 ) {
{
if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command. " if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command. "
"Supply a file name after linear_spline."); "Supply a file name after linear_spline.");
p_basis_type = 1; p_basis_type = 1;
spline_length = read_F_table( arg[iarg+1], p_basis_type ); spline_length = read_F_table( arg[iarg+1], p_basis_type );
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg], "cubic_spline") == 0 ) } else if (strcmp(arg[iarg], "cubic_spline") == 0 ) {
{
if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command. " if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command. "
"Supply a file name after cubic_spline."); "Supply a file name after cubic_spline.");
p_basis_type = 2; p_basis_type = 2;
@ -222,34 +211,34 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :
sprintf(errmsg,"CG basis type %s is not recognized\nSupported " sprintf(errmsg,"CG basis type %s is not recognized\nSupported "
"basis types: analytic linear_spline cubic_spline",arg[iarg]); "basis types: analytic linear_spline cubic_spline",arg[iarg]);
error->all(FLERR,errmsg); error->all(FLERR,errmsg);
} // END NJD MRD } // END NJD MRD
} else if (strcmp(arg[iarg],"tchain") == 0) { } else if (strcmp(arg[iarg],"tchain") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command");
mtchain = force->inumeric(FLERR,arg[iarg+1]); mtchain = force->inumeric(FLERR,arg[iarg+1]);
// used by FixNVTSllod to preserve non-default value // used by FixNVTSllod to preserve non-default value
mtchain_default_flag = 0; mtchain_default_flag = 0;
if (mtchain < 1) error->all(FLERR,"Illegal fix nvt/npt/nph command"); if (mtchain < 1) error->all(FLERR,"Illegal fix bocs command");
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"pchain") == 0) { } else if (strcmp(arg[iarg],"pchain") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command");
mpchain = force->inumeric(FLERR,arg[iarg+1]); mpchain = force->inumeric(FLERR,arg[iarg+1]);
if (mpchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); if (mpchain < 0) error->all(FLERR,"Illegal fix bocs command");
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"mtk") == 0) { } else if (strcmp(arg[iarg],"mtk") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command");
if (strcmp(arg[iarg+1],"yes") == 0) mtk_flag = 1; if (strcmp(arg[iarg+1],"yes") == 0) mtk_flag = 1;
else if (strcmp(arg[iarg+1],"no") == 0) mtk_flag = 0; else if (strcmp(arg[iarg+1],"no") == 0) mtk_flag = 0;
else error->all(FLERR,"Illegal fix nvt/npt/nph command"); else error->all(FLERR,"Illegal fix bocs command");
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"tloop") == 0) { } else if (strcmp(arg[iarg],"tloop") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command");
nc_tchain = force->inumeric(FLERR,arg[iarg+1]); nc_tchain = force->inumeric(FLERR,arg[iarg+1]);
if (nc_tchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); if (nc_tchain < 0) error->all(FLERR,"Illegal fix bocs command");
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"ploop") == 0) { } else if (strcmp(arg[iarg],"ploop") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command");
nc_pchain = force->inumeric(FLERR,arg[iarg+1]); nc_pchain = force->inumeric(FLERR,arg[iarg+1]);
if (nc_pchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); if (nc_pchain < 0) error->all(FLERR,"Illegal fix bocs command");
iarg += 2; iarg += 2;
} else { } else {
char * errmsg = (char *) calloc(80,sizeof(char)); char * errmsg = (char *) calloc(80,sizeof(char));
@ -422,7 +411,7 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :
// create a new compute pressure style // create a new compute pressure style
// id = fix-ID + press, compute group = all // id = fix-ID + press, compute group = all
// pass id_temp as 4th arg to pressure constructor // pass id_temp as 4th arg to pressure constructor
n = strlen(id) + 7; n = strlen(id) + 7;
id_press = new char[n]; id_press = new char[n];
strcpy(id_press,id); strcpy(id_press,id);
@ -431,7 +420,7 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :
newarg = new char*[4]; newarg = new char*[4];
newarg[0] = id_press; newarg[0] = id_press;
newarg[1] = (char *) "all"; newarg[1] = (char *) "all";
newarg[2] = (char *) "pressureBocs"; newarg[2] = (char *) "PRESSURE/BOCS";
newarg[3] = id_temp; newarg[3] = id_temp;
modify->add_compute(4,newarg); modify->add_compute(4,newarg);
delete [] newarg; delete [] newarg;
@ -512,9 +501,9 @@ void FixBocs::init()
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
(p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) ||
(p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5])) (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
error->all(FLERR,"Cannot use fix npt and fix deform on " error->all(FLERR,"Cannot use fix bocs and fix deform on "
"same component of stress tensor"); "same component of stress tensor");
} }
} }
// set temperature and pressure ptrs // set temperature and pressure ptrs
@ -634,7 +623,7 @@ void FixBocs::init()
int FixBocs::read_F_table( char *filename, int p_basis_type ) int FixBocs::read_F_table( char *filename, int p_basis_type )
{ {
char separator = ','; char separator = ',';
FILE *fpi; FILE *fpi;
int N_columns = 2, n_entries = 0, i; int N_columns = 2, n_entries = 0, i;
float f1, f2; float f1, f2;
double n1, n2; double n1, n2;
@ -647,15 +636,15 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
{ {
while (fgets(line,199,fpi)) { ++n_entries; } while (fgets(line,199,fpi)) { ++n_entries; }
fclose(fpi); fclose(fpi);
for (i = 0; i < N_columns; ++i) for (i = 0; i < N_columns; ++i)
{ {
data[i] = (double *) calloc(n_entries,sizeof(double)); data[i] = (double *) calloc(n_entries,sizeof(double));
} }
} }
else else
{ {
char * errmsg = (char *) calloc(50,sizeof(char)); char * errmsg = (char *) calloc(50,sizeof(char));
sprintf(errmsg,"Unable to open file: %s\n",filename); sprintf(errmsg,"Unable to open file: %s\n",filename);
error->all(FLERR,errmsg); error->all(FLERR,errmsg);
} }
@ -679,10 +668,10 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
} }
} }
} }
else else
{ {
char * errmsg = (char *) calloc(50,sizeof(char)); char * errmsg = (char *) calloc(50,sizeof(char));
sprintf(errmsg,"Unable to open file: %s\n",filename); sprintf(errmsg,"Unable to open file: %s\n",filename);
error->all(FLERR,errmsg); error->all(FLERR,errmsg);
} }
fclose(fpi); fclose(fpi);
@ -693,12 +682,12 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
splines[0] = (double *) calloc(n_entries,sizeof(double)); splines[0] = (double *) calloc(n_entries,sizeof(double));
splines[1] = (double *) calloc(n_entries,sizeof(double)); splines[1] = (double *) calloc(n_entries,sizeof(double));
int idxa, idxb; int idxa, idxb;
for (idxa = 0; idxa < 2; ++idxa) for (idxa = 0; idxa < 2; ++idxa)
{ {
for (idxb = 0; idxb < n_entries; ++idxb) for (idxb = 0; idxb < n_entries; ++idxb)
{ {
splines[idxa][idxb] = data[idxa][idxb]; splines[idxa][idxb] = data[idxa][idxb];
} }
} }
} }
else if (p_basis_type == 2) else if (p_basis_type == 2)
@ -720,7 +709,7 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
void FixBocs::build_cubic_splines( double **data ) void FixBocs::build_cubic_splines( double **data )
{ {
double *a, *b, *d, *h, *alpha, *c, *l, *mu, *z; double *a, *b, *d, *h, *alpha, *c, *l, *mu, *z;
int n = spline_length; int n = spline_length;
double alpha_i; double alpha_i;
a = (double *) calloc(n,sizeof(double)); a = (double *) calloc(n,sizeof(double));
b = (double *) calloc(n+1,sizeof(double)); b = (double *) calloc(n+1,sizeof(double));
@ -738,14 +727,14 @@ void FixBocs::build_cubic_splines( double **data )
b[i] = 0.0; b[i] = 0.0;
d[i] = 0.0; d[i] = 0.0;
if (i<(n-1)) if (i<(n-1))
{ {
h[i] = (data[0][i+1] - data[0][i]); h[i] = (data[0][i+1] - data[0][i]);
} }
if (i>1 && i<(n-1)) if (i>1 && i<(n-1))
{ {
alpha_i = (3.0 / h[i]) * ( data[1][i+1] - data[1][i]) - (3.0 / h[i-1] ) alpha_i = (3.0 / h[i]) * ( data[1][i+1] - data[1][i]) - (3.0 / h[i-1] )
* ( data[1][i] - data[1][i-1] ); * ( data[1][i] - data[1][i-1] );
alpha[i-1] = alpha_i; alpha[i-1] = alpha_i;
} }
@ -755,15 +744,15 @@ void FixBocs::build_cubic_splines( double **data )
z[0] = 0.0; z[0] = 0.0;
for (int i=1; i<n-1; i++) for (int i=1; i<n-1; i++)
{ {
l[i] = 2*(data[0][i+1] - data[0][i-1]) - h[i-1] * mu[i-1]; l[i] = 2*(data[0][i+1] - data[0][i-1]) - h[i-1] * mu[i-1];
mu[i] = h[i]/l[i]; mu[i] = h[i]/l[i];
z[i] = (alpha[i] - h[i-1] * z[i-1]) / l[i]; z[i] = (alpha[i] - h[i-1] * z[i-1]) / l[i];
} }
l[n-1] = 1.0; l[n-1] = 1.0;
mu[n-1] = 0.0; mu[n-1] = 0.0;
z[n-1] = 0.0; z[n-1] = 0.0;
c[n] = 0.0; c[n] = 0.0;
b[n] = 0.0; b[n] = 0.0;
d[n] = 0.0; d[n] = 0.0;
@ -777,7 +766,7 @@ void FixBocs::build_cubic_splines( double **data )
d[j] = (c[j+1]-c[j])/(3.0 * h[j]); d[j] = (c[j+1]-c[j])/(3.0 * h[j]);
} }
splines = (double **) calloc(5,sizeof(double *)); splines = (double **) calloc(5,sizeof(double *));
for ( idx = 0; idx < 5; ++idx) for ( idx = 0; idx < 5; ++idx)
{ {
splines[idx] = (double *) calloc(n-1,sizeof(double)); splines[idx] = (double *) calloc(n-1,sizeof(double));
@ -1488,15 +1477,15 @@ int FixBocs::modify_param(int narg, char **arg)
if (p_match_flag) // NJD MRD if (p_match_flag) // NJD MRD
{ {
if ( p_basis_type == 0 ) if ( p_basis_type == 0 )
{ {
((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, N_p_match, ((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, N_p_match,
p_match_coeffs, N_mol, vavg); p_match_coeffs, N_mol, vavg);
} }
else if ( p_basis_type == 1 || p_basis_type == 2 ) else if ( p_basis_type == 1 || p_basis_type == 2 )
{ {
((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, splines, ((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, splines,
spline_length ); spline_length );
} }
} }

View File

@ -9,20 +9,18 @@
the GNU General Public License. the GNU General Public License.
See the README file in the top-level LAMMPS directory. See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- -------------------------------------------------------------------------
USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
from The Pennsylvania State University from The Pennsylvania State University
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef FIX_CLASS #ifdef FIX_CLASS
// MRD NJD
FixStyle(bocs,FixBocs) FixStyle(bocs,FixBocs)
#else #else
// MRD NJD
#ifndef LMP_FIX_BOCS_H #ifndef LMP_FIX_BOCS_H
#define LMP_FIX_BOCS_H #define LMP_FIX_BOCS_H
@ -30,7 +28,7 @@ FixStyle(bocs,FixBocs)
namespace LAMMPS_NS { namespace LAMMPS_NS {
// MRD NJD
class FixBocs : public Fix { class FixBocs : public Fix {
public: public:
FixBocs(class LAMMPS *, int, char **); // MRD NJD FixBocs(class LAMMPS *, int, char **); // MRD NJD
@ -54,10 +52,6 @@ class FixBocs : public Fix {
virtual void *extract(const char*,int &); virtual void *extract(const char*,int &);
double memory_usage(); double memory_usage();
// MRD NJD
int read_F_table(char *, int);
void build_cubic_splines(double **);
protected: protected:
int dimension,which; int dimension,which;
@ -97,7 +91,7 @@ class FixBocs : public Fix {
int N_p_match; int N_p_match;
double *p_match_coeffs; double *p_match_coeffs;
double ** splines; double ** splines;
int spline_length; int spline_length;
int nlevels_respa; int nlevels_respa;
@ -156,6 +150,9 @@ class FixBocs : public Fix {
void nhc_temp_integrate(); void nhc_temp_integrate();
void nhc_press_integrate(); void nhc_press_integrate();
int read_F_table(char *, int);
void build_cubic_splines(double **);
virtual void nve_x(); // may be overwritten by child classes virtual void nve_x(); // may be overwritten by child classes
virtual void nve_v(); virtual void nve_v();
virtual void nh_v_press(); virtual void nh_v_press();
@ -183,64 +180,64 @@ Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line. command-line option when running LAMMPS to see the offending line.
E: Target temperature for fix nvt/npt/nph cannot be 0.0 E: Target temperature for fix bocs cannot be 0.0
Self-explanatory. Self-explanatory.
E: Invalid fix nvt/npt/nph command for a 2d simulation E: Invalid fix bocs command for a 2d simulation
Cannot control z dimension in a 2d model. Cannot control z dimension in a 2d model.
E: Fix nvt/npt/nph dilate group ID does not exist E: Fix bocs dilate group ID does not exist
Self-explanatory. Self-explanatory.
E: Invalid fix nvt/npt/nph command pressure settings E: Invalid fix bocs command pressure settings
If multiple dimensions are coupled, those dimensions must be If multiple dimensions are coupled, those dimensions must be
specified. specified.
E: Cannot use fix nvt/npt/nph on a non-periodic dimension E: Cannot use fix bocs on a non-periodic dimension
When specifying a diagonal pressure component, the dimension must be When specifying a diagonal pressure component, the dimension must be
periodic. periodic.
E: Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension E: Cannot use fix bocs on a 2nd non-periodic dimension
When specifying an off-diagonal pressure component, the 2nd of the two When specifying an off-diagonal pressure component, the 2nd of the two
dimensions must be periodic. E.g. if the xy component is specified, dimensions must be periodic. E.g. if the xy component is specified,
then the y dimension must be periodic. then the y dimension must be periodic.
E: Cannot use fix nvt/npt/nph with yz scaling when z is non-periodic dimension E: Cannot use fix bocs with yz scaling when z is non-periodic dimension
The 2nd dimension in the barostatted tilt factor must be periodic. The 2nd dimension in the barostatted tilt factor must be periodic.
E: Cannot use fix nvt/npt/nph with xz scaling when z is non-periodic dimension E: Cannot use fix bocs with xz scaling when z is non-periodic dimension
The 2nd dimension in the barostatted tilt factor must be periodic. The 2nd dimension in the barostatted tilt factor must be periodic.
E: Cannot use fix nvt/npt/nph with xy scaling when y is non-periodic dimension E: Cannot use fix bocs with xy scaling when y is non-periodic dimension
The 2nd dimension in the barostatted tilt factor must be periodic. The 2nd dimension in the barostatted tilt factor must be periodic.
E: Cannot use fix nvt/npt/nph with both yz dynamics and yz scaling E: Cannot use fix bocs with both yz dynamics and yz scaling
Self-explanatory. Self-explanatory.
E: Cannot use fix nvt/npt/nph with both xz dynamics and xz scaling E: Cannot use fix bocs with both xz dynamics and xz scaling
Self-explanatory. Self-explanatory.
E: Cannot use fix nvt/npt/nph with both xy dynamics and xy scaling E: Cannot use fix bocs with both xy dynamics and xy scaling
Self-explanatory. Self-explanatory.
E: Can not specify Pxy/Pxz/Pyz in fix nvt/npt/nph with non-triclinic box E: Can not specify Pxy/Pxz/Pyz in fix bocs with non-triclinic box
Only triclinic boxes can be used with off-diagonal pressure components. Only triclinic boxes can be used with off-diagonal pressure components.
See the region prism command for details. See the region prism command for details.
E: Invalid fix nvt/npt/nph pressure settings E: Invalid fix bocs pressure settings
Settings for coupled dimensions must be the same. Settings for coupled dimensions must be the same.
@ -251,12 +248,12 @@ Self-explanatory.
E: Using update dipole flag requires atom attribute mu E: Using update dipole flag requires atom attribute mu
Self-explanatory. Self-explanatory.
E: The dlm flag must be used with update dipole E: The dlm flag must be used with update dipole
Self-explanatory. Self-explanatory.
E: Fix nvt/npt/nph damping parameters must be > 0.0 E: Fix bocs damping parameters must be > 0.0
Self-explanatory. Self-explanatory.
@ -264,15 +261,15 @@ E: Cannot use fix npt and fix deform on same component of stress tensor
This would be changing the same box dimension twice. This would be changing the same box dimension twice.
E: Temperature ID for fix nvt/npt does not exist E: Temperature ID for fix bocs does not exist
Self-explanatory. Self-explanatory.
E: Pressure ID for fix npt/nph does not exist E: Pressure ID for fix bocs does not exist
Self-explanatory. Self-explanatory.
E: Fix npt/nph has tilted box too far in one step - periodic cell is too far from equilibrium state E: Fix bocs has tilted box too far in one step - periodic cell is too far from equilibrium state
Self-explanatory. The change in the box tilt is too extreme Self-explanatory. The change in the box tilt is too extreme
on a short timescale. on a short timescale.