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

[WIP] Solvent-solute splitting #439

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add tests (currently failing!)
test_split_nb_using_exceptions is failing with: Exception: Maximum allowable relative force error exceeded (was 0.02369251; allowed 0.00000100).

test_split_nb_using_subtraction is failing with: Exception: Maximum allowable relative force error exceeded (was 0.00001687; allowed 0.00000100)
  • Loading branch information
maxentile committed Sep 20, 2019
commit b503ebf365770265c816f9d32388ed1c022f81c7
22 changes: 22 additions & 0 deletions openmmtools/tests/test_forcefactories.py
Original file line number Diff line number Diff line change
@@ -196,3 +196,25 @@ def test_replace_reaction_field():
name=test_name, platform=platform)
f.description = "Testing replace_reaction_field on system {} with shifted=True".format(test_name)
yield f


def check_force_group_decomposition_valid(testsystem, force_group_splitter):
"""force_group_splitter(system, md_topology) returns a copy of system that
splits system's forces in some convenient way.

Check that the copy describes the same system overall, by checking whether it
produces identical forces as the original on a slightly randomized configuration.
"""
new_system = force_group_splitter(testsystem.system, testsystem.mdtraj_topology)
positions = generate_new_positions(testsystem.system, testsystem.positions, nsteps=5)
compare_system_forces(testsystem.system, new_system, positions)


def test_split_nb_using_exceptions():
testsystem = testsystems.AlanineDipeptideExplicit()
check_force_group_decomposition_valid(testsystem, split_nb_using_exceptions)


def test_split_nb_using_subtraction():
testsystem = testsystems.AlanineDipeptideExplicit()
check_force_group_decomposition_valid(testsystem, split_nb_using_subtraction)