Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restraint forces #336

Merged
merged 29 commits into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3ad37a1
Utility function to find subclasses
andrrizzi Mar 8, 2018
15b0e80
Move test_forces.py to test_forcefactories.py
andrrizzi Mar 9, 2018
b935330
Add generic class to restore OpenMM custom integrators/forces
andrrizzi Mar 12, 2018
f5325ba
Add configurable tolerance to is_quantity_close
andrrizzi Mar 12, 2018
7c26300
Add support for copying Python attributes in CustomIntegrators
andrrizzi Mar 12, 2018
0c2b40d
Fix reference to old RestorableIntegrator
andrrizzi Mar 12, 2018
f2ee287
Remove duplicated method
andrrizzi Mar 12, 2018
25be064
Allow computing system volume even in NPT ensemble
andrrizzi Mar 12, 2018
13e700e
Add harmonic and flatbottom restraint custom forces
andrrizzi Mar 12, 2018
a3f4db0
Fix #335: Fix doctest after OpenMM update
andrrizzi Mar 12, 2018
8c4dbb8
Add utility function to find force by class/name
andrrizzi Mar 13, 2018
d9850f0
Substitute find_nonbonded_force with more general find_forces
andrrizzi Mar 13, 2018
7936812
Add example to docstring
andrrizzi Mar 13, 2018
b31427c
Refactor _find_barostat/thermostat to remove duplication
andrrizzi Mar 13, 2018
cb0fff8
Update release history
andrrizzi Mar 13, 2018
32a9030
Fix for loop
andrrizzi Mar 13, 2018
7d6f17d
Fix tests
andrrizzi Mar 13, 2018
29a8299
Attempt to fix weird Travis error
andrrizzi Mar 13, 2018
6a6c463
Add function for analytical determination of restraint distance
andrrizzi Mar 14, 2018
0c613c0
Raise ValueError when flat-bottom distance cannot be determined
andrrizzi Mar 14, 2018
85d28a0
Attempt regenerating the hash table on miss
andrrizzi Mar 14, 2018
1b9e057
Fix test Python2 compatibility
andrrizzi Mar 14, 2018
89e4599
Work around weird nosetests generator python2 problem
andrrizzi Mar 14, 2018
a1ffc94
Add testcase
andrrizzi Mar 14, 2018
a82bd52
Fix possible segfault in tests
andrrizzi Mar 14, 2018
f0662b7
Fix context creation with both restorable integrator and force
andrrizzi Mar 16, 2018
35f944d
Fix find subclass forces in systems without parent class
andrrizzi Mar 16, 2018
b21d1e2
Inherit from base MCMCMove class to allow subclass search
andrrizzi Mar 19, 2018
c0f14e3
Fix error message
andrrizzi Mar 19, 2018
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
2 changes: 2 additions & 0 deletions docs/releasehistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Release History

Development snapshot
====================
- Add radially-symmetric restraint custom forces (`#336 <https://github.com/choderalab/openmmtools/pull/336>`_).
- Copy Python attributes of integrators on ``deepcopy()`` (`#336 <https://github.com/choderalab/openmmtools/pull/336>`_).


0.14.0 - Exact treatment of alchemical PME electrostatics, water cluster test system, optimizations
Expand Down
1 change: 1 addition & 0 deletions openmmtools/alchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ def __setstate__(self, serialization):
"""Set the state from a dictionary representation."""
parameters = serialization['parameters']
alchemical_variables = serialization['alchemical_variables']
# New attribute in OpenMMTools 0.14.0.
update_alchemical_charges = serialization.get('update_alchemical_charges', True)
alchemical_functions = dict()

Expand Down
2 changes: 1 addition & 1 deletion openmmtools/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def _standardize_integrator(cls, integrator):

"""
standard_integrator = copy.deepcopy(integrator)
integrators.RestorableIntegrator.restore_interface(standard_integrator)
integrators.ThermostatedIntegrator.restore_interface(standard_integrator)
for attribute, std_value in cls.COMPATIBLE_INTEGRATOR_ATTRIBUTES.items():
try: # setter
getattr(standard_integrator, 'set' + attribute)(std_value)
Expand Down
4 changes: 4 additions & 0 deletions openmmtools/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
# (openmm/platforms/reference/include/SimTKOpenMMRealType.h)
# TODO: Replace this with an import from simtk.openmm.constants once available
ONE_4PI_EPS0 = 138.935456

# Standard-state volume for a single molecule in a box of size (1 L) / (avogadros number).
LITER = 1000.0 * u.centimeters**3
STANDARD_STATE_VOLUME = LITER / (u.AVOGADRO_CONSTANT_NA*u.mole)
2 changes: 1 addition & 1 deletion openmmtools/forcefactories.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def replace_reaction_field(reference_system, switch_width=1.0*unit.angstrom,
force_constructor = getattr(forces, 'UnshiftedReactionFieldForce')

# Add an reaction field for each CutoffPeriodic NonbondedForce.
for reference_force in forces.iterate_nonbonded_forces(system):
for reference_force in forces.find_forces(system, openmm.NonbondedForce).values():
if reference_force.getNonbondedMethod() == openmm.NonbondedForce.CutoffPeriodic:
reaction_field_force = force_constructor.from_nonbonded_force(reference_force, switch_width=switch_width)
system.addForce(reaction_field_force)
Expand Down
Loading