From 17915cf139140b6c3c0aafd86b1812520d070091 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 26 Sep 2024 15:02:08 +0100 Subject: [PATCH 1/4] Proper length of the custom_clj_params used for positional restraint ghost atoms --- wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp index 684b9a58b..60228871a 100644 --- a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp +++ b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp @@ -315,7 +315,8 @@ void _add_positional_restraints(const SireMM::PositionalRestraints &restraints, auto ghost_nonghostff = lambda_lever.getForce("ghost/non-ghost", system); std::vector custom_params = {1.0, 0.0, 0.0}; - std::vector custom_clj_params = {0.0, 0.0, 0.0, 0.0}; + // Define null parameters used to add these particles to the ghost forces (5 total) + std::vector custom_clj_params = {0.0, 0.0, 0.0, 0.0, 0.0}; // we need to add all of the positions as anchor particles for (const auto &restraint : atom_restraints) From 0a7fe8de5e7f17f978f08ddd2793c1124da11e48 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 26 Sep 2024 15:06:23 +0100 Subject: [PATCH 2/4] Updates changelog --- doc/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 915311990..e400d02ec 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -26,6 +26,7 @@ organisation on `GitHub `__. * Add support for boresch restraints to PME. * Port SOMD torsion fix to PME code. * Fix issues with ``atomtype`` and ``atom`` records for dummy atoms in GROMACS topology files. +* Fix issues with positionally restrainted atoms in perturbable systems. `2024.2.0 `__ - June 2024 From b8c23a330d0498732f54656cdefe7110ef1b0536 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 27 Sep 2024 14:25:53 +0100 Subject: [PATCH 3/4] Adds test for positional restraints on perturbed molecules --- tests/convert/test_openmm_restraints.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/convert/test_openmm_restraints.py b/tests/convert/test_openmm_restraints.py index 7f2b5ee2e..c7dcd8bf7 100644 --- a/tests/convert/test_openmm_restraints.py +++ b/tests/convert/test_openmm_restraints.py @@ -6,8 +6,12 @@ "openmm" not in sr.convert.supported_formats(), reason="openmm support is not available", ) -def test_openmm_positional_restraints(kigaki_mols, openmm_platform): - mols = kigaki_mols +@pytest.mark.parametrize("molecules", ["kigaki_mols", "merged_ethane_methanol"]) +def test_openmm_positional_restraints(molecules, openmm_platform, request): + mols = request.getfixturevalue(molecules) + + if mols[0].is_perturbable(): + mols = sr.morph.link_to_reference(mols) mol = mols[0] From e699235571b0831828882082d505eb83d801af2c Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 27 Sep 2024 14:27:32 +0100 Subject: [PATCH 4/4] Fixed typo in changelog --- doc/source/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index e400d02ec..8f0c435ae 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -26,7 +26,7 @@ organisation on `GitHub `__. * Add support for boresch restraints to PME. * Port SOMD torsion fix to PME code. * Fix issues with ``atomtype`` and ``atom`` records for dummy atoms in GROMACS topology files. -* Fix issues with positionally restrainted atoms in perturbable systems. +* Fix issues with positionally restrained atoms in perturbable systems. `2024.2.0 `__ - June 2024