Commit 28a5f81b authored by Christopher Bruns's avatar Christopher Bruns
Browse files

Use AndersenThermostat instead of LangevinIntegrator for thermostat in HelloWaterBox.cpp

parent 3f5d98a5
...@@ -100,6 +100,10 @@ static void simulateWaterBox() { ...@@ -100,6 +100,10 @@ static void simulateWaterBox() {
OpenMM::HarmonicAngleForce& bondBend = *new OpenMM::HarmonicAngleForce(); OpenMM::HarmonicAngleForce& bondBend = *new OpenMM::HarmonicAngleForce();
system.addForce(&bondBend); system.addForce(&bondBend);
OpenMM::AndersenThermostat& thermostat = *new OpenMM::AndersenThermostat(
300, // temperature in kelvins
91.0); // collision frequency in 1/picoseconds
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Specify the atoms and their properties: // Specify the atoms and their properties:
// (1) System needs to know the masses. // (1) System needs to know the masses.
...@@ -206,10 +210,7 @@ static void simulateWaterBox() { ...@@ -206,10 +210,7 @@ static void simulateWaterBox() {
// positions we collected above. Initial velocities will be zero. // positions we collected above. Initial velocities will be zero.
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Use LangevinIntegrator to maintain temperature OpenMM::VerletIntegrator integrator(
OpenMM::LangevinIntegrator integrator(
300, // temperature in kelvins
0.01099, // collision interval in picoseconds (1/91)
StepSizeInFs * OpenMM::PsPerFs); StepSizeInFs * OpenMM::PsPerFs);
OpenMM::OpenMMContext context(system, integrator); OpenMM::OpenMMContext context(system, integrator);
context.setPositions(initialPositions); context.setPositions(initialPositions);
......
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