Commit 38ea6054 authored by jchodera's avatar jchodera
Browse files

Fix bug where CHARMM impropers did not respect toroidal boundary conditions

parent 9f6bd494
# Packaging OpenMM into ZIP installers # Packaging OpenMM into ZIP installers
Set your environment variable `TAG` to the git tag for the release:
```bash
# OpenMM 7.1.0rc1
export TAG="9567ddb"
```
## Source ## Source
Start the docker container: Start the docker container:
```bash ```bash
docker run -i -t --rm -v `pwd`:/io jchodera/omnia-build-box:cuda80-amd30-clang38 bash docker run -i -t --rm -e TAG -v `pwd`:/io jchodera/omnia-build-box:cuda80-amd30-clang38 bash
``` ```
Inside the docker container: Inside the docker container:
```bash ```bash
...@@ -23,7 +29,7 @@ cp packaging/compressed/* /io ...@@ -23,7 +29,7 @@ cp packaging/compressed/* /io
Start the docker container: Start the docker container:
```bash ```bash
docker run -i -t --rm -v `pwd`:/io jchodera/omnia-build-box:cuda80-amd30-clang38 bash docker run -i -t --rm -e TAG -v `pwd`:/io jchodera/omnia-build-box:cuda80-amd30-clang38 bash
``` ```
Inside the docker container: Inside the docker container:
```bash ```bash
...@@ -50,4 +56,3 @@ source openmm/devtools/packaging/scripts/osx/prepare.sh ...@@ -50,4 +56,3 @@ source openmm/devtools/packaging/scripts/osx/prepare.sh
source openmm/devtools/packaging/scripts/osx/build.sh source openmm/devtools/packaging/scripts/osx/build.sh
source openmm/devtools/packaging/scripts/osx/package.sh source openmm/devtools/packaging/scripts/osx/package.sh
``` ```
...@@ -906,8 +906,11 @@ class CharmmPsfFile(object): ...@@ -906,8 +906,11 @@ class CharmmPsfFile(object):
if verbose: print('Adding impropers...') if verbose: print('Adding impropers...')
# Ick. OpenMM does not have an improper torsion class. Need to # Ick. OpenMM does not have an improper torsion class. Need to
# construct one from CustomTorsionForce # construct one from CustomTorsionForce that respects toroidal boundaries
force = mm.CustomTorsionForce('k*(theta-theta0)^2') energy_function = 'k*dtheta_torus^2;'
energy_function += 'dtheta_torus = dtheta - floor(dtheta/(2*pi)+0.5)*(2*pi);'
energy_function += 'dtheta = theta - theta0;'
force = mm.CustomTorsionForce(energy_function)
force.addPerTorsionParameter('k') force.addPerTorsionParameter('k')
force.addPerTorsionParameter('theta0') force.addPerTorsionParameter('theta0')
force.setForceGroup(self.IMPROPER_FORCE_GROUP) force.setForceGroup(self.IMPROPER_FORCE_GROUP)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment