Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
7b5ba521
Commit
7b5ba521
authored
Jun 11, 2009
by
Christopher Bruns
Browse files
No commit message
No commit message
parent
c97d87d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
examples/HelloArgon.cpp
examples/HelloArgon.cpp
+6
-6
No files found.
examples/HelloArgon.cpp
View file @
7b5ba521
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment