Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions tyff/compute/_equilibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from parsl import File

import tyff.mm
from tyff.compute._files import (
EquilibrationFiles,
MinimizationFiles,
Expand Down Expand Up @@ -122,18 +123,27 @@ def _run_equilibration(
)
)

dcd_reporter = openmm.app.DCDReporter(
file=files["dcd_trajectory"].filepath,
reportInterval=1000,
simulation.reporters.append(
openmm.app.DCDReporter(
file=files["dcd_trajectory"].filepath,
reportInterval=1000,
)
)

simulation.reporters.append(dcd_reporter)

simulation.context.setVelocitiesToTemperature(
compute_config["temperature"], # kelvin, but as float
compute_config["replicate_index"] + 1,
)

simulation.reporters.append(
tyff.mm.TensorReporter(
output_file=files["msgpack_trajectory"].filepath,
report_interval=1000,
beta=1.0 / (openmm.unit.MOLAR_GAS_CONSTANT_R * compute_config["temperature"] * openmm.unit.kelvin),
pressure=pressure * openmm.unit.kilopascal,
Comment thread
mattwthompson marked this conversation as resolved.
)
)

logger.info("Running 10,000 steps of MD")

detected_platform = simulation.context.getPlatform().getName()
Expand Down
28 changes: 19 additions & 9 deletions tyff/compute/_produce.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import openmm.app
from parsl import File

import tyff.mm
from tyff.compute._files import (
EquilibrationFiles,
ProductionFiles,
Expand Down Expand Up @@ -97,6 +98,11 @@ def _run_production(

assert barostat.getDefaultPressure() is not None

pressure = compute_config.get("pressure", None)

if pressure is None:
raise PressureNotDefinedError("Trying to set up NPT simulation but no pressure defined.")

simulation.context.setVelocitiesToTemperature(
compute_config["temperature"], # kelvin, but as float
compute_config["replicate_index"] + 1,
Expand All @@ -117,17 +123,21 @@ def _run_production(
)
)

dcd_reporter = openmm.app.DCDReporter(
file=files["dcd_trajectory"].filepath,
reportInterval=1000,
simulation.reporters.append(
openmm.app.DCDReporter(
file=files["dcd_trajectory"].filepath,
reportInterval=1000,
)
)

simulation.reporters.append(dcd_reporter)

pressure = compute_config.get("pressure", None)

if pressure is None:
raise PressureNotDefinedError("Trying to set up NPT simulation but no pressure defined.")
simulation.reporters.append(
tyff.mm.TensorReporter(
output_file=files["msgpack_trajectory"].filepath,
report_interval=1000,
beta=1.0 / (openmm.unit.MOLAR_GAS_CONSTANT_R * compute_config["temperature"] * openmm.unit.kelvin),
pressure=pressure * openmm.unit.kilopascal,
Comment thread
mattwthompson marked this conversation as resolved.
)
)

logger.info("Running 100,000 steps of MD")

Expand Down
Loading