@@ -100,30 +100,21 @@ def createConfig(self, version=None, extra_options={}, extra_lines=[]):
100
100
if not all (isinstance (line , str ) for line in extra_lines ):
101
101
raise TypeError ("Lines in 'extra_lines' must be of type 'str'." )
102
102
103
- # Make sure the report interval is a multiple of nstcalcenergy.
104
- if isinstance (self ._protocol , _FreeEnergyMixin ):
105
- nstcalcenergy = 250
106
- else :
107
- nstcalcenergy = 100
108
- report_interval = self .reportInterval ()
109
- if report_interval % nstcalcenergy != 0 :
110
- report_interval = nstcalcenergy * _math .ceil (
111
- report_interval / nstcalcenergy
112
- )
113
-
114
103
# Define some miscellaneous defaults.
115
104
protocol_dict = {
116
105
# Interval between writing to the log file.
117
- "nstlog" : report_interval ,
106
+ "nstlog" : self . reportInterval () ,
118
107
# Interval between writing to the energy file.
119
- "nstenergy" : report_interval ,
108
+ "nstenergy" : self . reportInterval () ,
120
109
# Interval between writing to the trajectory file.
121
110
"nstxout-compressed" : self .restartInterval (),
122
111
}
123
112
124
113
# Minimisation.
125
114
if isinstance (self ._protocol , _Protocol .Minimisation ):
126
115
protocol_dict ["integrator" ] = "steep"
116
+ # Maximum step size in nanometers.
117
+ protocol_dict ["emstep" ] = "0.001"
127
118
else :
128
119
# Timestep in picoseconds
129
120
timestep = self ._protocol .getTimeStep ().picoseconds ().value ()
@@ -212,7 +203,7 @@ def createConfig(self, version=None, extra_options={}, extra_lines=[]):
212
203
# Temperature control.
213
204
if not isinstance (self ._protocol , _Protocol .Minimisation ):
214
205
if isinstance (self ._protocol , _FreeEnergyMixin ):
215
- # Langevin dynamics.
206
+ # Leap-frog stochastic dynamics integrator .
216
207
protocol_dict ["integrator" ] = "sd"
217
208
else :
218
209
# Leap-frog molecular dynamics.
@@ -260,6 +251,24 @@ def createConfig(self, version=None, extra_options={}, extra_lines=[]):
260
251
"%.2f" % self ._protocol .getTemperature ().kelvin ().value ()
261
252
)
262
253
254
+ # Set as a continuation run.
255
+ if self .isRestart ():
256
+ protocol_dict ["continuation" ] = "yes"
257
+ protocol_dict ["gen-vel" ] = "no"
258
+ # Generate velocities.
259
+ else :
260
+ protocol_dict ["continuation" ] = "no"
261
+ protocol_dict ["gen-vel" ] = "yes"
262
+ protocol_dict ["gen-seed" ] = "-1"
263
+ if isinstance (self ._protocol , _Protocol .Equilibration ):
264
+ protocol_dict ["gen-temp" ] = (
265
+ "%.2f" % self ._protocol .getStartTemperature ().kelvin ().value ()
266
+ )
267
+ else :
268
+ protocol_dict ["gen-temp" ] = (
269
+ "%.2f" % self ._protocol .getTemperature ().kelvin ().value ()
270
+ )
271
+
263
272
# Free energies.
264
273
if isinstance (self ._protocol , _FreeEnergyMixin ):
265
274
# Extract the lambda array.
@@ -280,10 +289,14 @@ def createConfig(self, version=None, extra_options={}, extra_lines=[]):
280
289
protocol_dict ["couple-lambda1" ] = "vdw-q"
281
290
# Write all lambda values.
282
291
protocol_dict ["calc-lambda-neighbors" ] = - 1
283
- # Calculate energies every 250 steps.
284
- protocol_dict ["nstcalcenergy" ] = 250
285
- # Write gradients every 250 steps.
286
- protocol_dict ["nstdhdl" ] = 250
292
+ # Calculate energies at the report interval.
293
+ protocol_dict ["nstcalcenergy" ] = self .reportInterval ()
294
+ # Write gradients at the report interval.
295
+ protocol_dict ["nstdhdl" ] = self .reportInterval ()
296
+ # Soft-core parameters.
297
+ protocol_dict ["sc-alpha" ] = "0.30"
298
+ protocol_dict ["sc-sigma" ] = "0.25"
299
+ protocol_dict ["sc-coul" ] = "yes"
287
300
288
301
# Put everything together in a line-by-line format.
289
302
total_dict = {** protocol_dict , ** extra_options }
0 commit comments