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
35f0c21c
Commit
35f0c21c
authored
Jun 18, 2009
by
Michael Sherman
Browse files
Reorganized the HelloWaterBox example to look like a clone of the HelloEthane example.
parent
2763eed1
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
310 additions
and
189 deletions
+310
-189
examples/HelloEthane.cpp
examples/HelloEthane.cpp
+6
-5
examples/HelloWaterBox.cpp
examples/HelloWaterBox.cpp
+304
-184
No files found.
examples/HelloEthane.cpp
View file @
35f0c21c
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
#include <cstdio>
#include <cstdio>
#include <string>
#include <string>
#include <vector>
#include <vector>
#include <utility>
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// MOCK MD CODE
// MOCK MD CODE
...
@@ -40,8 +39,6 @@ const double SimulationTimeInPs = 100; // total simulation time (ps)
...
@@ -40,8 +39,6 @@ const double SimulationTimeInPs = 100; // total simulation time (ps)
static
const
bool
WantEnergy
=
true
;
static
const
bool
WantEnergy
=
true
;
// FORCE FIELD DATA
// FORCE FIELD DATA
// These data structures are not part of OpenMM; they are a model of the kinds
// of data structures an MD code uses to hold a set of force field parameters.
// For this example we're using a tiny subset of the Amber99 force field.
// For this example we're using a tiny subset of the Amber99 force field.
// We want to keep the data in the original unit system to avoid conversion
// We want to keep the data in the original unit system to avoid conversion
// bugs; this requires conversion on the way in and out of OpenMM.
// bugs; this requires conversion on the way in and out of OpenMM.
...
@@ -220,12 +217,16 @@ namespace OpenMM {
...
@@ -220,12 +217,16 @@ namespace OpenMM {
static
const
double
SigmaPerVdwRadius
=
1.78179743628068
;
static
const
double
SigmaPerVdwRadius
=
1.78179743628068
;
}
}
// This is our opaque "handle" class containing all the OpenMM objects that
// must persist from call to call during a simulation. The main program gets
// a pointer to one of these but sees it as essentially a void* since it
// doesn't know the definition of this class.
struct
MyOpenMMData
{
struct
MyOpenMMData
{
MyOpenMMData
()
:
system
(
0
),
context
(
0
),
integrator
(
0
)
{}
MyOpenMMData
()
:
system
(
0
),
context
(
0
),
integrator
(
0
)
{}
~
MyOpenMMData
()
{
delete
system
;
delete
context
;
delete
integrator
;}
~
MyOpenMMData
()
{
delete
context
;
delete
integrator
;
delete
system
;
}
OpenMM
::
System
*
system
;
OpenMM
::
System
*
system
;
OpenMM
::
OpenMMContext
*
context
;
OpenMM
::
Integrator
*
integrator
;
OpenMM
::
Integrator
*
integrator
;
OpenMM
::
OpenMMContext
*
context
;
};
};
...
...
examples/HelloWaterBox.cpp
View file @
35f0c21c
This diff is collapsed.
Click to expand it.
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