Commit 7b5ba521 authored by Christopher Bruns's avatar Christopher Bruns
Browse files

No commit message

No commit message
parent c97d87d0
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
#include "OpenMM.h" #include "OpenMM.h"
#include <cstdio> #include <cstdio>
// Forward declaration of subroutine for printing atomic coordinates, // Forward declaration of writePdb() subroutine for printing atomic
// defined later in this source file. // coordinates, defined later in this source file.
void writePdb(const OpenMM::OpenMMContext& context); void writePdb(const OpenMM::OpenMMContext& context);
// simulation is performed within simulateArgon() subroutine // simulateArgon() subroutine
void simulateArgon() void simulateArgon()
{ {
// Load any shared libraries containing GPU implementations // Load any shared libraries containing GPU implementations
...@@ -31,12 +31,12 @@ void simulateArgon() ...@@ -31,12 +31,12 @@ void simulateArgon()
std::vector<OpenMM::Vec3> initialPositions(3); std::vector<OpenMM::Vec3> initialPositions(3);
for (int a = 0; a < 3; ++a) for (int a = 0; a < 3; ++a)
{ {
system.addParticle(39.95); // mass system.addParticle(39.95); // mass, grams per mole
// charge, sigma, well depth // charge, sigma, well depth
nonbond->addParticle(0.0, 0.3350, 0.001603); nonbond->addParticle(0.0, 0.3350, 0.001603);
initialPositions[a] = OpenMM::Vec3(0.5*a,0,0); // location initialPositions[a] = OpenMM::Vec3(0.5*a,0,0); // location, nanometers
} }
OpenMM::VerletIntegrator integrator(0.020); // step size in picoseconds OpenMM::VerletIntegrator integrator(0.020); // step size in picoseconds
...@@ -88,7 +88,7 @@ void writePdb(const OpenMM::OpenMMContext& context) ...@@ -88,7 +88,7 @@ void writePdb(const OpenMM::OpenMMContext& context)
{ {
printf("ATOM %5d AR AR 1 ", a+1); // atom number printf("ATOM %5d AR AR 1 ", a+1); // atom number
printf("%8.3f%8.3f%8.3f 1.00 0.00 AR\n", // coordinates printf("%8.3f%8.3f%8.3f 1.00 0.00 AR\n", // coordinates
// notice "*10" converts nanometers to Angstroms // "*10" converts nanometers to Angstroms
pos[a][0]*10, pos[a][1]*10, pos[a][2]*10); pos[a][0]*10, pos[a][1]*10, pos[a][2]*10);
} }
printf("ENDMDL\n"); // end of frame printf("ENDMDL\n"); // end of frame
......
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