Skip to content

Commit

Permalink
Backport fix from PR #266. [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Dec 13, 2024
1 parent 7921fe3 commit 28e8eba
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 24 deletions.
12 changes: 7 additions & 5 deletions corelib/src/libs/SireMove/openmmfrenergydt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,9 +1228,9 @@ void OpenMMFrEnergyDT::integrate(IntegratorWorkspace &workspace, const Symbol &n

// Set Periodic Box Condition

context_openmm.setPeriodicBoxVectors(OpenMM::Vec3(Box_x_Edge_Length, 0, 0),
OpenMM::Vec3(0, Box_y_Edge_Length, 0),
OpenMM::Vec3(0, 0, Box_z_Edge_Length));
system_openmm->setDefaultPeriodicBoxVectors(OpenMM::Vec3(Box_x_Edge_Length, 0, 0),
OpenMM::Vec3(0, Box_y_Edge_Length, 0),
OpenMM::Vec3(0, 0, Box_z_Edge_Length));
}
// TriclinicBox.
else if (ptr_sys.property(space_property).isA<TriclinicBox>())
Expand All @@ -1253,9 +1253,11 @@ void OpenMMFrEnergyDT::integrate(IntegratorWorkspace &workspace, const Symbol &n
const double zy = v2.y() * OpenMM::NmPerAngstrom;
const double zz = v2.z() * OpenMM::NmPerAngstrom;

context_openmm.setPeriodicBoxVectors(OpenMM::Vec3(xx, xy, xz), OpenMM::Vec3(yx, yy, yz),
OpenMM::Vec3(zx, zy, zz));
system_openmm->setDefaultPeriodicBoxVectors(OpenMM::Vec3(xx, xy, xz), OpenMM::Vec3(yx, yy, yz),
OpenMM::Vec3(zx, zy, zz));
}

context_openmm.reinitialize();
}

if (Debug)
Expand Down
7 changes: 0 additions & 7 deletions corelib/src/libs/SireMove/openmmfrenergyst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3450,10 +3450,6 @@ void OpenMMFrEnergyST::createContext(IntegratorWorkspace &workspace, SireUnits::
system_openmm->setDefaultPeriodicBoxVectors(OpenMM::Vec3(Box_x_Edge_Length, 0, 0),
OpenMM::Vec3(0, Box_y_Edge_Length, 0),
OpenMM::Vec3(0, 0, Box_z_Edge_Length));

openmm_context->setPeriodicBoxVectors(OpenMM::Vec3(Box_x_Edge_Length, 0, 0),
OpenMM::Vec3(0, Box_y_Edge_Length, 0),
OpenMM::Vec3(0, 0, Box_z_Edge_Length));
}
// TriclinicBox.
else if (ptr_sys.property(space_property).isA<TriclinicBox>())
Expand All @@ -3478,9 +3474,6 @@ void OpenMMFrEnergyST::createContext(IntegratorWorkspace &workspace, SireUnits::

system_openmm->setDefaultPeriodicBoxVectors(OpenMM::Vec3(xx, xy, xz), OpenMM::Vec3(yx, yy, yz),
OpenMM::Vec3(zx, zy, zz));

openmm_context->setPeriodicBoxVectors(OpenMM::Vec3(xx, xy, xz), OpenMM::Vec3(yx, yy, yz),
OpenMM::Vec3(zx, zy, zz));
}

openmm_context->reinitialize();
Expand Down
11 changes: 6 additions & 5 deletions corelib/src/libs/SireMove/openmmmdintegrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1157,9 +1157,9 @@ void OpenMMMDIntegrator::createContext(IntegratorWorkspace &workspace, SireUnits

// Set Periodic Box Condition

openmm_context->setPeriodicBoxVectors(OpenMM::Vec3(Box_x_Edge_Length, 0, 0),
OpenMM::Vec3(0, Box_y_Edge_Length, 0),
OpenMM::Vec3(0, 0, Box_z_Edge_Length));
system_openmm->setDefaultPeriodicBoxVectors(OpenMM::Vec3(Box_x_Edge_Length, 0, 0),
OpenMM::Vec3(0, Box_y_Edge_Length, 0),
OpenMM::Vec3(0, 0, Box_z_Edge_Length));
}
// TriclinicBox.
else if (ptr_sys.property(space_property).isA<TriclinicBox>())
Expand All @@ -1182,11 +1182,12 @@ void OpenMMMDIntegrator::createContext(IntegratorWorkspace &workspace, SireUnits
const double zy = v2.y() * OpenMM::NmPerAngstrom;
const double zz = v2.z() * OpenMM::NmPerAngstrom;

openmm_context->setPeriodicBoxVectors(OpenMM::Vec3(xx, xy, xz), OpenMM::Vec3(yx, yy, yz),
OpenMM::Vec3(zx, zy, zz));
system_openmm->setDefaultPeriodicBoxVectors(OpenMM::Vec3(xx, xy, xz), OpenMM::Vec3(yx, yy, yz),
OpenMM::Vec3(zx, zy, zz));
}

is_periodic = true;
openmm_context->reinitialize();
}

double AKMAPerPs = 0.04888821;
Expand Down
7 changes: 0 additions & 7 deletions corelib/src/libs/SireMove/openmmpmefep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2954,10 +2954,6 @@ void OpenMMPMEFEP::createContext(IntegratorWorkspace &workspace, SireUnits::Dime
system_openmm->setDefaultPeriodicBoxVectors(OpenMM::Vec3(Box_x_Edge_Length, 0, 0),
OpenMM::Vec3(0, Box_y_Edge_Length, 0),
OpenMM::Vec3(0, 0, Box_z_Edge_Length));

openmm_context->setPeriodicBoxVectors(OpenMM::Vec3(Box_x_Edge_Length, 0, 0),
OpenMM::Vec3(0, Box_y_Edge_Length, 0),
OpenMM::Vec3(0, 0, Box_z_Edge_Length));
}
// TriclinicBox
else if (ptr_sys.property(space_property).isA<TriclinicBox>())
Expand All @@ -2983,9 +2979,6 @@ void OpenMMPMEFEP::createContext(IntegratorWorkspace &workspace, SireUnits::Dime

system_openmm->setDefaultPeriodicBoxVectors(OpenMM::Vec3(xx, xy, xz), OpenMM::Vec3(yx, yy, yz),
OpenMM::Vec3(zx, zy, zz));

openmm_context->setPeriodicBoxVectors(OpenMM::Vec3(xx, xy, xz), OpenMM::Vec3(yx, yy, yz),
OpenMM::Vec3(zx, zy, zz));
}

openmm_context->reinitialize();
Expand Down
7 changes: 7 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ Development was migrated into the
`OpenBioSim <https://github.com/openbiosim>`__
organisation on `GitHub <https://github.com/openbiosim/sire>`__.

`2024.4.0 <https://github.com/openbiosim/sire/compare/2024.3.1...2024.4.0>`__ - December 2024
--------------------------------------------------------------------------------------------

* Please add an item to this CHANGELOG for any new features or bug fixes when creating a PR.

* Fixed update of triclinic box vectors in ``SOMD`` following ``OpenMM`` bug fix.

`2024.3.1 <https://github.com/openbiosim/sire/compare/2024.3.0...2024.3.1>`__ - December 2024
---------------------------------------------------------------------------------------------

Expand Down

0 comments on commit 28e8eba

Please sign in to comment.