Skip to content

Commit

Permalink
Set COLVAR and HILLS reporting to hill deposition frequency. [ref #194]
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed May 26, 2021
1 parent 8e17bc6 commit e682046
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/BioSimSpace/Process/_openmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,11 +784,15 @@ def _generate_config(self):
report_interval = self._protocol.getReportInterval()
restart_interval = self._protocol.getRestartInterval()

# Get the hill deposition frequency.
hill_freq = self._protocol.getHillFrequency()

# Work out the number of integration steps.
total_steps = _math.ceil(self._protocol.getRunTime() / self._protocol.getTimeStep())

# Work out the number of cycles.
total_cycles = _math.ceil(total_steps / report_interval)
# (Record COLVAR and HILLS at hill deposition frequency.)
total_cycles = _math.ceil(total_steps / hill_freq)

# Subtract the current number of steps.
remaining_steps = total_steps - step
Expand All @@ -811,9 +815,8 @@ def _generate_config(self):
bias = self._protocol.getBiasFactor()
self.addToConfig(f"bias = {bias}")
height = self._protocol.getHillHeight().kj_per_mol().magnitude()
freq = self._protocol.getHillFrequency()

self.addToConfig(f"meta = Metadynamics(system, [proj, ext], {temperature}*kelvin, bias, {height}*kilojoules_per_mole, {freq}, biasDir = '.', saveFrequency = {report_interval})")
self.addToConfig(f"meta = Metadynamics(system, [proj, ext], {temperature}*kelvin, bias, {height}*kilojoules_per_mole, {hill_freq}, biasDir = '.', saveFrequency = {report_interval})")

# Get the integration time step from the protocol.
timestep = self._protocol.getTimeStep().picoseconds().magnitude()
Expand Down

0 comments on commit e682046

Please sign in to comment.