Commit 3f5d98a5 authored by Michael Sherman's avatar Michael Sherman
Browse files

Thanks to Chris, we now know that the Langevin friction parameter is in ONE...

Thanks to Chris, we now know that the Langevin friction parameter is in ONE OVER picoseconds, NOT picoseconds!!
parent 804ffc62
...@@ -24,7 +24,7 @@ using std::printf; ...@@ -24,7 +24,7 @@ using std::printf;
// MODELING AND SIMULATION PARAMETERS // MODELING AND SIMULATION PARAMETERS
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
static const double Temperature = 300; // Kelvins static const double Temperature = 300; // Kelvins
static const double FrictionInPs = 1./91.; // picoseconds between collisions static const double FrictionInPerPs = 91.; // collisions per picosecond
static const double SolventDielectric = 80.; // typical for water static const double SolventDielectric = 80.; // typical for water
static const double SoluteDielectric = 2.; // typical for protein static const double SoluteDielectric = 2.; // typical for protein
...@@ -119,7 +119,7 @@ int main() { ...@@ -119,7 +119,7 @@ int main() {
std::string platformName; std::string platformName;
// Set up OpenMM data structures; returns OpenMM Platform name. // Set up OpenMM data structures; returns OpenMM Platform name.
MyOpenMMData* omm = myInitializeOpenMM(atoms, Temperature, FrictionInPs, MyOpenMMData* omm = myInitializeOpenMM(atoms, Temperature, FrictionInPerPs,
SolventDielectric, SoluteDielectric, SolventDielectric, SoluteDielectric,
StepSizeInFs, platformName); StepSizeInFs, platformName);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
* MODELING AND SIMULATION PARAMETERS * MODELING AND SIMULATION PARAMETERS
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
static const double Temperature = 300; /*Kelvins */ static const double Temperature = 300; /*Kelvins */
static const double FrictionInPs = 1./91.; /*ps between collisions*/ static const double FrictionInPerPs = 91.; /*collisions per ps*/
static const double SolventDielectric = 80.; /*typical for water */ static const double SolventDielectric = 80.; /*typical for water */
static const double SoluteDielectric = 2.; /*typical for protein */ static const double SoluteDielectric = 2.; /*typical for protein */
...@@ -124,7 +124,7 @@ int main() { ...@@ -124,7 +124,7 @@ int main() {
const char* platformName; const char* platformName;
// Set up OpenMM data structures; returns OpenMM Platform name. // Set up OpenMM data structures; returns OpenMM Platform name.
MyOpenMMData* omm = myInitializeOpenMM(atoms, Temperature, FrictionInPs, MyOpenMMData* omm = myInitializeOpenMM(atoms, Temperature, FrictionInPerPs,
SolventDielectric, SoluteDielectric, SolventDielectric, SoluteDielectric,
StepSizeInFs, &platformName); StepSizeInFs, &platformName);
...@@ -187,7 +187,7 @@ struct MyOpenMMData_s { ...@@ -187,7 +187,7 @@ struct MyOpenMMData_s {
static MyOpenMMData* static MyOpenMMData*
myInitializeOpenMM( const MyAtomInfo atoms[], myInitializeOpenMM( const MyAtomInfo atoms[],
double temperature, double temperature,
double frictionInPs, double frictionInPerPs,
double solventDielectric, double solventDielectric,
double soluteDielectric, double soluteDielectric,
double stepSizeInFs, double stepSizeInFs,
...@@ -252,7 +252,7 @@ myInitializeOpenMM( const MyAtomInfo atoms[], ...@@ -252,7 +252,7 @@ myInitializeOpenMM( const MyAtomInfo atoms[],
* positions we collected above. Initial velocities will be zero but could * positions we collected above. Initial velocities will be zero but could
* have been set here. */ * have been set here. */
omm->integrator = (OpenMM_Integrator*)OpenMM_LangevinIntegrator_create( omm->integrator = (OpenMM_Integrator*)OpenMM_LangevinIntegrator_create(
temperature, frictionInPs, temperature, frictionInPerPs,
stepSizeInFs * OpenMM_PsPerFs); stepSizeInFs * OpenMM_PsPerFs);
omm->context = OpenMM_Context_create(omm->system, omm->integrator); omm->context = OpenMM_Context_create(omm->system, omm->integrator);
OpenMM_Context_setPositions(omm->context, initialPosInNm); OpenMM_Context_setPositions(omm->context, initialPosInNm);
......
...@@ -33,7 +33,7 @@ static AtomInfo atoms[] = { ...@@ -33,7 +33,7 @@ static AtomInfo atoms[] = {
}; };
static const double Temperature = 100; // Kelvins static const double Temperature = 100; // Kelvins
static const double Friction = 1./91.; // picoseconds between collisions static const double FrictionInPerPs = 91.; // collisions per ps
static const double StepSizeFs = 2; // femtoseconds static const double StepSizeFs = 2; // femtoseconds
static const double ReportIntervalFs = 1000; static const double ReportIntervalFs = 1000;
static const double SimulationTimePs = 1000; // total simulation time (ps) static const double SimulationTimePs = 1000; // total simulation time (ps)
......
...@@ -333,10 +333,10 @@ void openmm_verletintegrator_step_(OpenMM_VerletIntegrator* const& verlet, int& ...@@ -333,10 +333,10 @@ void openmm_verletintegrator_step_(OpenMM_VerletIntegrator* const& verlet, int&
// OpenMM::LangevinIntegrator // OpenMM::LangevinIntegrator
OpenMM_LangevinIntegrator* OpenMM_LangevinIntegrator_create(double temperature, double frictionInPs, double stepSzInPs) OpenMM_LangevinIntegrator* OpenMM_LangevinIntegrator_create(double temperature, double frictionInPerPs, double stepSzInPs)
{ return (OpenMM_LangevinIntegrator*)new LangevinIntegrator(temperature, frictionInPs, stepSzInPs); } { return (OpenMM_LangevinIntegrator*)new LangevinIntegrator(temperature, frictionInPerPs, stepSzInPs); }
void openmm_langevinintegrator_create_(OpenMM_LangevinIntegrator*& langevin, double& temperature, double& frictionInPs, double& stepSzInPs) void openmm_langevinintegrator_create_(OpenMM_LangevinIntegrator*& langevin, double& temperature, double& frictionInPerPs, double& stepSzInPs)
{ langevin = OpenMM_LangevinIntegrator_create(temperature, frictionInPs, stepSzInPs); } { langevin = OpenMM_LangevinIntegrator_create(temperature, frictionInPerPs, stepSzInPs); }
void OpenMM_LangevinIntegrator_destroy(OpenMM_LangevinIntegrator* doomed) void OpenMM_LangevinIntegrator_destroy(OpenMM_LangevinIntegrator* doomed)
{ delete (LangevinIntegrator*)doomed; } { delete (LangevinIntegrator*)doomed; }
......
// ----------------------------------------------------------------------------- /* --------------------------------------------------------------------------
// OpenMM(tm) example C wrapper function declarations (June 2009) * OpenMM(tm) example C wrapper function declarations (June 2009)
// ----------------------------------------------------------------------------- * --------------------------------------------------------------------------
// This header should be included by a C main program that would like to * This header should be included by a C main program that would like to
// access the OpenMM API through the C wrappers. Please note that this is not * access the OpenMM API through the C wrappers. Please note that this is not
// an official part of OpenMM; it is just an example of how the C++ API can be * an official part of OpenMM; it is just an example of how the C++ API can
// wrapped for access from C. * be wrapped for access from C.
// ----------------------------------------------------------------------------- *
* Note: this header must be includable in both ANSI C and C++ code, because
#ifndef OPENMM_CWRAPPER_H * the function declarations must be common to both the users and the
#define OPENMM_CWRAPPER_H * implementing code, which is in C++.
* -------------------------------------------------------------------------- */
#if defined(__cplusplus)
#include <cmath> #ifndef OPENMM_CWRAPPER_H_
#else #define OPENMM_CWRAPPER_H_
#include <math.h>
#endif //#if defined(__cplusplus)
// #include <cmath>
/* //#else
* This header file is intended to be included in a C compilation unit so must // #include <math.h>
* not use any C++ features that are not also present in ANSI C. //#endif
*/
/* These incomplete types are declared so we can have unique pointer types. */ /* These incomplete types are declared so we can have unique pointer types. */
typedef struct OpenMM_System_s OpenMM_System; typedef struct OpenMM_System_s OpenMM_System;
...@@ -168,7 +167,7 @@ extern OpenMM_VerletIntegrator* OpenMM_VerletIntegrator_create(double stepSzInPs ...@@ -168,7 +167,7 @@ extern OpenMM_VerletIntegrator* OpenMM_VerletIntegrator_create(double stepSzInPs
extern void OpenMM_VerletIntegrator_destroy(OpenMM_VerletIntegrator*); extern void OpenMM_VerletIntegrator_destroy(OpenMM_VerletIntegrator*);
extern void OpenMM_VerletIntegrator_step(OpenMM_VerletIntegrator*, int numSteps); extern void OpenMM_VerletIntegrator_step(OpenMM_VerletIntegrator*, int numSteps);
/* OpenMM::LangevinIntegrator */ /* OpenMM::LangevinIntegrator */
extern OpenMM_LangevinIntegrator* OpenMM_LangevinIntegrator_create(double temperature, double frictionInPs, double stepSzInPs); extern OpenMM_LangevinIntegrator* OpenMM_LangevinIntegrator_create(double temperature, double frictionInPerPs, double stepSzInPs);
extern void OpenMM_VLangevinIntegrator_destroy(OpenMM_LangevinIntegrator*); extern void OpenMM_VLangevinIntegrator_destroy(OpenMM_LangevinIntegrator*);
extern void OpenMM_LangevinIntegrator_step(OpenMM_LangevinIntegrator*, int numSteps); extern void OpenMM_LangevinIntegrator_step(OpenMM_LangevinIntegrator*, int numSteps);
...@@ -204,7 +203,7 @@ static void OpenMM_Vec3_set(double x, double y, double z, OpenMM_Vec3 out) { ...@@ -204,7 +203,7 @@ static void OpenMM_Vec3_set(double x, double y, double z, OpenMM_Vec3 out) {
} }
#endif /*OPENMM_CWRAPPER_H*/ #endif /*OPENMM_CWRAPPER_H_*/
......
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