Skip to content

Commit

Permalink
Add .load() line for polyalanine simulation to fix DCD issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hjstroud committed Aug 29, 2024
1 parent 8432bcb commit 4c45823
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/openmm/openmm_polyalanine.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Saving the trajectory can be done in the regular way for OpenMM simulations: by attaching a reporter. Here we attach a DCD reporter to save the trajectory in the DCD format every 500 frames."
"Saving the trajectory can be done in the regular way for OpenMM simulations: by attaching a reporter. Here we attach a DCD reporter to save the trajectory in the DCD format every 500 frames.\n",
"\n",
"**Note**: It is essential to load the simulation _before_ attaching a DCD reporter, using the `.load()` function."
]
},
{
Expand All @@ -248,6 +250,9 @@
"metadata": {},
"outputs": [],
"source": [
"# Load the simulation\n",
"polyalanine_simulation.load()\n",
"\n",
"# Attach the DCD reporter\n",
"dcd_reporter = app.DCDReporter('output.dcd', 500)\n",
"polyalanine_simulation.simulation.reporters.append(dcd_reporter)\n",
Expand Down

0 comments on commit 4c45823

Please sign in to comment.