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
7cbeb289
Commit
7cbeb289
authored
Jun 11, 2009
by
Peter Eastman
Browse files
Added some missing imports in examples
parent
b1b4e547
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
examples/HelloWaterBox.cpp
examples/HelloWaterBox.cpp
+11
-10
examples/wrappers/OpenMM_CWrapper.cpp
examples/wrappers/OpenMM_CWrapper.cpp
+1
-0
No files found.
examples/HelloWaterBox.cpp
View file @
7cbeb289
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include "OpenMM.h"
#include "OpenMM.h"
#include <cstdio>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <string>
#include <vector>
#include <vector>
#include <utility>
#include <utility>
...
@@ -46,8 +47,8 @@ int main() {
...
@@ -46,8 +47,8 @@ int main() {
// ALWAYS enclose all OpenMM calls with a try/catch block to make sure that
// ALWAYS enclose all OpenMM calls with a try/catch block to make sure that
// usage and runtime errors are caught and reported.
// usage and runtime errors are caught and reported.
try
{
try
{
// Load all available OpenMM plugins from their default location.
// Load all available OpenMM plugins from their default location.
OpenMM
::
Platform
::
loadPluginsFromDirectory
OpenMM
::
Platform
::
loadPluginsFromDirectory
(
OpenMM
::
Platform
::
getDefaultPluginsDirectory
());
(
OpenMM
::
Platform
::
getDefaultPluginsDirectory
());
simulateWaterBox
();
simulateWaterBox
();
...
@@ -121,11 +122,11 @@ static void simulateWaterBox() {
...
@@ -121,11 +122,11 @@ static void simulateWaterBox() {
double
boxEdgeLength
=
waterSize
*
watersPerEdge
;
double
boxEdgeLength
=
waterSize
*
watersPerEdge
;
// Create periodic box
// Create periodic box
nonbond
.
setNonbondedMethod
(
OpenMM
::
NonbondedForce
::
CutoffPeriodic
);
nonbond
.
setNonbondedMethod
(
OpenMM
::
NonbondedForce
::
CutoffPeriodic
);
nonbond
.
setCutoffDistance
(
2
);
nonbond
.
setCutoffDistance
(
2
);
nonbond
.
setPeriodicBoxVectors
(
Vec3
(
boxEdgeLength
,
0
,
0
),
Vec3
(
0
,
boxEdgeLength
,
0
),
Vec3
(
0
,
0
,
boxEdgeLength
));
nonbond
.
setPeriodicBoxVectors
(
Vec3
(
boxEdgeLength
,
0
,
0
),
Vec3
(
0
,
boxEdgeLength
,
0
),
Vec3
(
0
,
0
,
boxEdgeLength
));
// Create data structures to hold lists of initial positions and bonds
// Create data structures to hold lists of initial positions and bonds
std
::
vector
<
Vec3
>
initialPositions
;
std
::
vector
<
Vec3
>
initialPositions
;
std
::
vector
<
std
::
pair
<
int
,
int
>
>
bondPairs
;
std
::
vector
<
std
::
pair
<
int
,
int
>
>
bondPairs
;
...
@@ -239,9 +240,9 @@ static void simulateWaterBox() {
...
@@ -239,9 +240,9 @@ static void simulateWaterBox() {
static
void
static
void
writePDB
(
const
OpenMM
::
OpenMMContext
&
context
)
{
writePDB
(
const
OpenMM
::
OpenMMContext
&
context
)
{
// We don't calculate energy in this example because it would take most of the time
// We don't calculate energy in this example because it would take most of the time
const
OpenMM
::
State
state
=
context
.
getState
(
OpenMM
::
State
::
Positions
);
const
OpenMM
::
State
state
=
context
.
getState
(
OpenMM
::
State
::
Positions
);
const
std
::
vector
<
Vec3
>&
positions
=
state
.
getPositions
();
const
std
::
vector
<
Vec3
>&
positions
=
state
.
getPositions
();
static
int
modelFrameNumber
=
0
;
// numbering for MODEL records in pdb output
static
int
modelFrameNumber
=
0
;
// numbering for MODEL records in pdb output
modelFrameNumber
++
;
modelFrameNumber
++
;
printf
(
"MODEL %d
\n
"
,
modelFrameNumber
);
printf
(
"MODEL %d
\n
"
,
modelFrameNumber
);
...
...
examples/wrappers/OpenMM_CWrapper.cpp
View file @
7cbeb289
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
#include "OpenMM_CWrapper.h"
#include "OpenMM_CWrapper.h"
#include <cstring>
// Suppress irrelevant warnings from Microsoft's compiler.
// Suppress irrelevant warnings from Microsoft's compiler.
#ifdef _MSC_VER
#ifdef _MSC_VER
...
...
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