1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 package ffx.potential.nonbonded.pme;
39
40 import static ffx.potential.parameters.ForceField.ELEC_FORM.PAM;
41 import static ffx.utilities.PropertyGroup.ElectrostaticsFunctionalForm;
42 import static java.lang.String.format;
43
44 import ffx.potential.parameters.ForceField;
45 import ffx.potential.parameters.ForceField.ELEC_FORM;
46 import ffx.utilities.FFXProperty;
47
48 import java.util.logging.Logger;
49
50
51
52
53 public class ScaleParameters {
54
55 private static final Logger logger = Logger.getLogger(ScaleParameters.class.getName());
56
57 private static final double DEFAULT_MPOLE_12_SCALE = 0.0;
58 private static final double DEFAULT_MPOLE_13_SCALE = 0.0;
59 private static final double DEFAULT_MPOLE_14_SCALE = 1.0;
60 private static final double DEFAULT_MPOLE_15_SCALE = 1.0;
61 private static final double DEFAULT_CHG_12_SCALE = 0.0;
62 private static final double DEFAULT_CHG_13_SCALE = 0.0;
63 private static final double DEFAULT_CHG_14_SCALE = 2.0;
64 private static final double DEFAULT_CHG_15_SCALE = 1.0;
65
66
67
68
69 @FFXProperty(name = "mpole-12-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "0.0",
70 description = """
71 Provides a multiplicative scale factor that is applied to permanent atomic multipole
72 electrostatic interactions between 1-2 connected atoms, i.e., atoms that are directly bonded.
73 The default value of 0.0 is used, if the mpole-12-scale property is not given
74 in either the parameter file or the property file.
75 """)
76 @FFXProperty(name = "chg-12-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "0.0",
77 description = """
78 Provides a multiplicative scale factor that is applied to charge-charge electrostatic
79 interactions between 1-2 connected atoms, i.e., atoms that are directly bonded.
80 The default value of 0.0 is used, if the chg-12-scale keyword is not given
81 in either the parameter file or the property file.
82 """)
83 public final double m12scale;
84
85
86
87
88 @FFXProperty(name = "mpole-13-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "0.0",
89 description = """
90 Provides a multiplicative scale factor that is applied to permanent atomic multipole
91 electrostatic interactions between 1-3 connected atoms, i.e., atoms separated by two covalent bonds.
92 The default value of 0.0 is used, if the mpole-13-scale keyword is not given
93 in either the parameter file or the property file.
94 """)
95 @FFXProperty(name = "chg-13-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "0.0",
96 description = """
97 Provides a multiplicative scale factor that is applied to charge-charge electrostatic
98 interactions between 1-3 connected atoms, i.e., atoms separated by two covalent bonds.
99 The default value of 0.0 is used, if the chg-13-scale keyword is not given
100 in either the parameter file or the property file.
101 """)
102 public final double m13scale;
103
104
105
106
107 @FFXProperty(name = "mpole-14-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "1.0",
108 description = """
109 Provides a multiplicative scale factor that is applied to permanent atomic multipole
110 electrostatic interactions between 1-4 connected atoms, i.e., atoms separated by three covalent bonds.
111 The default value of 1.0 is used, if the mpole-14-scale keyword is not given
112 in either the parameter file or the property file.
113 """)
114 @FFXProperty(name = "chg-14-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "1.0",
115 description = """
116 Provides a multiplicative scale factor that is applied to charge-charge electrostatic
117 interactions between 1-4 connected atoms, i.e., atoms separated by three covalent bonds.
118 The default value of 1.0 is used, if the chg-14-scale keyword is not given
119 in either the parameter file or the property file.
120 """)
121 public final double m14scale;
122
123
124
125
126 @FFXProperty(name = "mpole-15-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "1.0",
127 description = """
128 Provides a multiplicative scale factor that is applied to permanent atomic multipole
129 electrostatic interactions between 1-5 connected atoms, i.e., atoms separated by four covalent bonds.
130 The default value of 1.0 is used, if the mpole-15-scale keyword is not given
131 in either the parameter file or the property file.
132 """)
133 @FFXProperty(name = "chg-15-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "1.0",
134 description = """
135 Provides a multiplicative scale factor that is applied to charge-charge electrostatic
136 interactions between 1-5 connected atoms, i.e., atoms separated by four covalent bonds.
137 The default value of 1.0 is used, if the chg-15-scale keyword is not given
138 in either the parameter file or the property file.
139 """)
140 public final double m15scale;
141
142 private static final double DEFAULT_DIRECT_11_SCALE = 0.0;
143 private static final double DEFAULT_DIRECT_12_SCALE = 1.0;
144 private static final double DEFAULT_DIRECT_13_SCALE = 1.0;
145 private static final double DEFAULT_DIRECT_14_SCALE = 1.0;
146
147
148
149
150 @FFXProperty(name = "direct-11-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "0.0",
151 description = """
152 Provides a multiplicative scale factor that is applied to the permanent (direct) field
153 due to atoms within a polarization group during an induced dipole calculation,
154 i.e., atoms that are in the same polarization group as the atom being polarized.
155 The default value of 0.0 is used, if the direct-11-scale keyword is not given
156 in either the parameter file or the property file.
157 """)
158 public final double d11scale;
159
160
161
162
163
164 @FFXProperty(name = "direct-12-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "1.0",
165 description = """
166 Provides a multiplicative scale factor that is applied to the permanent (direct) field
167 due to atoms in 1-2 polarization groups during an induced dipole calculation,
168 i.e., atoms that are in polarization groups directly connected to the group containing the atom being polarized.
169 The default value of 0.0 is used, if the direct-12-scale keyword is not given
170 in either the parameter file or the property file.
171 """)
172 public final double d12scale;
173
174
175
176
177
178 @FFXProperty(name = "direct-13-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "1.0",
179 description = """
180 Provides a multiplicative scale factor that is applied to the permanent (direct) field
181 due to atoms in 1-3 polarization groups during an induced dipole calculation,
182 i.e., atoms that are in polarization groups separated by one group from the group containing the atom being polarized.
183 The default value of 0.0 is used, if the direct-13-scale keyword is not given
184 in either the parameter file or the property file.
185 """)
186 public final double d13scale;
187
188
189
190
191
192 @FFXProperty(name = "direct-14-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "1.0",
193 description = """
194 Provides a multiplicative scale factor that is applied to the permanent (direct) field
195 due to atoms in 1-4 polarization groups during an induced dipole calculation,
196 i.e., atoms that are in polarization groups separated by two groups from the group containing the atom being polarized.
197 The default value of 1.0 is used, if the direct-14-scale keyword is not given
198 in either the parameter file or the property file.
199 """)
200 public final double d14scale;
201
202 private static final double DEFAULT_POLAR_12_SCALE = 0.0;
203 private static final double DEFAULT_POLAR_13_SCALE = 0.0;
204 private static final double DEFAULT_POLAR_14_SCALE = 1.0;
205 private static final double DEFAULT_POLAR_15_SCALE = 1.0;
206
207
208
209
210
211 @FFXProperty(name = "polar-12-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "0.0",
212 description = """
213 Provides a multiplicative scale factor that is applied to polarization interactions
214 between 1-2 connected atoms located in different polarization groups.
215 The default value of 0.0 is used, if the polar-12-scale keyword is not given
216 in either the parameter file or the property file.
217 """)
218 public final double p12scale;
219
220
221
222
223
224 @FFXProperty(name = "polar-13-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "0.0",
225 description = """
226 Provides a multiplicative scale factor that is applied to polarization interactions
227 between 1-3 connected atoms located in different polarization groups.
228 The default value of 0.0 is used, if the polar-13-scale keyword is not given
229 in either the parameter file or the property file.
230 """)
231 public final double p13scale;
232
233
234
235
236
237 @FFXProperty(name = "polar-14-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "1.0",
238 description = """
239 Provides a multiplicative scale factor that is applied to polarization interactions
240 between 1-4 connected atoms located in different polarization groups.
241 The default value of 1.0 is used, if the polar-14-scale keyword is not given
242 in either the parameter file or the property file.
243 """)
244 public final double p14scale;
245
246
247
248
249
250 @FFXProperty(name = "polar-15-scale", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "1.0",
251 description = """
252 Provides a multiplicative scale factor that is applied to polarization interactions
253 between 1-5 connected atoms located in different polarization groups.
254 The default value of 1.0 is used, if the polar-15-scale keyword is not given
255 in either the parameter file or the property file.
256 """)
257 public final double p15scale;
258
259 private static final double DEFAULT_POLAR_12_INTRA = 0.0;
260
261 private static final double DEFAULT_POLAR_13_INTRA = 0.0;
262
263 private static final double DEFAULT_POLAR_14_INTRA = 0.5;
264
265 private static final double DEFAULT_POLAR_15_INTRA = 1.0;
266
267
268
269
270 @FFXProperty(name = "polar-12-intra", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "0.0",
271 description = """
272 Provides a multiplicative scale factor that is applied to polarization interactions
273 between 1-2 connected atoms located in the same polarization group.
274 The default value of 0.0 is used, if the polar-12-intra keyword is not given
275 in either the parameter file or the property file.
276 """)
277 public final double intra12Scale;
278
279
280
281 @FFXProperty(name = "polar-13-intra", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "0.0",
282 description = """
283 Provides a multiplicative scale factor that is applied to polarization interactions
284 between 1-3 connected atoms located in the same polarization group.
285 The default value of 0.0 is used, if the polar-13-intra keyword is not given
286 in either the parameter file or the property file.
287 """)
288 public final double intra13Scale;
289
290
291
292
293 @FFXProperty(name = "polar-14-intra", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "0.5",
294 description = """
295 Provides a multiplicative scale factor that is applied to polarization interactions
296 between 1-4 connected atoms located in the same polarization group.
297 The default value of 0.5 is used, if the polar-14-intra keyword is not given
298 in either the parameter file or the property file.
299 """)
300 public final double intra14Scale;
301
302
303
304 @FFXProperty(name = "polar-15-intra", propertyGroup = ElectrostaticsFunctionalForm, defaultValue = "1.0",
305 description = """
306 Provides a multiplicative scale factor that is applied to polarization interactions
307 between 1-5 connected atoms located in the same polarization group.
308 The default value of 1.0 is used, if the polar-15-intra keyword is not given
309 in either the parameter file or the property file.
310 """)
311 public final double intra15Scale;
312
313 public ScaleParameters(ELEC_FORM elecForm, ForceField forceField) {
314 if (elecForm == PAM) {
315 double m12 = forceField.getDouble("MPOLE_12_SCALE", DEFAULT_MPOLE_12_SCALE);
316 if (m12 > 1.0) {
317 m12 = 1.0 / m12;
318 }
319 m12scale = m12;
320 double m13 = forceField.getDouble("MPOLE_13_SCALE", DEFAULT_MPOLE_13_SCALE);
321 if (m13 > 1.0) {
322 m13 = 1.0 / m13;
323 }
324 m13scale = m13;
325 double m14 = forceField.getDouble("MPOLE_14_SCALE", DEFAULT_MPOLE_14_SCALE);
326 if (m14 > 1.0) {
327 m14 = 1.0 / m14;
328 }
329 m14scale = m14;
330 double m15 = forceField.getDouble("MPOLE_15_SCALE", DEFAULT_MPOLE_15_SCALE);
331 if (m15 > 1.0) {
332 m15 = 1.0 / m15;
333 }
334 m15scale = m15;
335 } else {
336 double m12 = forceField.getDouble("CHG_12_SCALE", DEFAULT_CHG_12_SCALE);
337 if (m12 > 1.0) {
338 m12 = 1.0 / m12;
339 }
340 m12scale = m12;
341 double m13 = forceField.getDouble("CHG_13_SCALE", DEFAULT_CHG_13_SCALE);
342 if (m13 > 1.0) {
343 m13 = 1.0 / m13;
344 }
345 m13scale = m13;
346 double m14 = forceField.getDouble("CHG_14_SCALE", DEFAULT_CHG_14_SCALE);
347 if (m14 > 1.0) {
348 m14 = 1.0 / m14;
349 }
350 m14scale = m14;
351 double m15 = forceField.getDouble("CHG_15_SCALE", DEFAULT_CHG_15_SCALE);
352 if (m15 > 1.0) {
353 m15 = 1.0 / m15;
354 }
355 m15scale = m15;
356 }
357
358
359
360 intra12Scale = forceField.getDouble("POLAR_12_INTRA", DEFAULT_POLAR_12_INTRA);
361 if (intra12Scale != 0.0) {
362 logger.severe(format(" Unsupported polar-12-intra parameter: %8.6f", intra12Scale));
363 }
364 intra13Scale = forceField.getDouble("POLAR_13_INTRA", DEFAULT_POLAR_13_INTRA);
365 if (intra13Scale != 0.0) {
366 logger.severe(format(" Unsupported polar-13-intra parameter: %8.6f", intra13Scale));
367 }
368 intra14Scale = forceField.getDouble("POLAR_14_INTRA", DEFAULT_POLAR_14_INTRA);
369 intra15Scale = forceField.getDouble("POLAR_15_INTRA", DEFAULT_POLAR_15_INTRA);
370 if (intra15Scale != 1.0) {
371 logger.severe(format(" Unsupported polar-15-intra parameter: %8.6f", intra15Scale));
372 }
373
374
375 d11scale = forceField.getDouble("DIRECT_11_SCALE", DEFAULT_DIRECT_11_SCALE);
376 d12scale = forceField.getDouble("DIRECT_12_SCALE", DEFAULT_DIRECT_12_SCALE);
377 d13scale = forceField.getDouble("DIRECT_13_SCALE", DEFAULT_DIRECT_13_SCALE);
378 d14scale = forceField.getDouble("DIRECT_14_SCALE", DEFAULT_DIRECT_14_SCALE);
379 if (d12scale != 1.0) {
380 logger.severe(format(" Unsupported direct-12-scale parameter: %8.6f", d12scale));
381 }
382 if (d13scale != 1.0) {
383 logger.severe(format(" Unsupported direct-13-scale parameter: %8.6f", d13scale));
384 }
385 if (d14scale != 1.0) {
386 logger.severe(format(" Unsupported direct-14-scale parameter: %8.6f", d14scale));
387 }
388
389
390 p12scale = forceField.getDouble("POLAR_12_SCALE", DEFAULT_POLAR_12_SCALE);
391 p13scale = forceField.getDouble("POLAR_13_SCALE", DEFAULT_POLAR_13_SCALE);
392 p14scale = forceField.getDouble("POLAR_14_SCALE", DEFAULT_POLAR_14_SCALE);
393 p15scale = forceField.getDouble("POLAR_15_SCALE", DEFAULT_POLAR_15_SCALE);
394 if (p15scale != 1.0) {
395 logger.severe(format(" Unsupported polar-15-scale parameter: %8.6f", p15scale));
396 }
397 }
398 }