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
77866475
"libraries/vscode:/vscode.git/clone" did not exist on "3bcccc3d65d55153fdc7141ea908f3295a7003c4"
Commit
77866475
authored
Jun 11, 2008
by
Christopher Bruns
Browse files
Debugged memory corruption in TestFindExclusions
parent
f1c16534
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
openmmapi/include/Force.h
openmmapi/include/Force.h
+5
-0
openmmapi/include/OpenMMContext.h
openmmapi/include/OpenMMContext.h
+1
-0
openmmapi/src/OpenMMContext.cpp
openmmapi/src/OpenMMContext.cpp
+4
-0
tests/TestFindExclusions.cpp
tests/TestFindExclusions.cpp
+10
-3
No files found.
openmmapi/include/Force.h
View file @
77866475
...
...
@@ -53,6 +53,7 @@ class ForceImpl;
class
Force
{
public:
Force
()
{}
virtual
~
Force
()
{
}
protected:
...
...
@@ -63,6 +64,10 @@ protected:
* The ForceImpl will be deleted automatically when the OpenMMContext is deleted.
*/
virtual
ForceImpl
*
createImpl
()
=
0
;
private:
Force
&
operator
=
(
const
Force
&
rhs
);
Force
(
const
Force
&
rhs
);
};
}
// namespace OpenMM
...
...
openmmapi/include/OpenMMContext.h
View file @
77866475
...
...
@@ -78,6 +78,7 @@ public:
* @param platform the Platform to use for calculations
*/
OpenMMContext
(
System
&
system
,
Integrator
&
integrator
,
Platform
&
platform
);
~
OpenMMContext
();
/**
* Get System being simulated in this context.
*/
...
...
openmmapi/src/OpenMMContext.cpp
View file @
77866475
...
...
@@ -42,6 +42,10 @@ OpenMMContext::OpenMMContext(System& system, Integrator& integrator) : impl(new
OpenMMContext
::
OpenMMContext
(
System
&
system
,
Integrator
&
integrator
,
Platform
&
platform
)
:
impl
(
new
OpenMMContextImpl
(
*
this
,
system
,
integrator
,
&
platform
))
{
}
OpenMMContext
::~
OpenMMContext
()
{
delete
impl
;
}
const
System
&
OpenMMContext
::
getSystem
()
const
{
return
impl
->
getSystem
();
...
...
tests/TestFindExclusions.cpp
View file @
77866475
...
...
@@ -236,11 +236,18 @@ int main() {
System
system
(
NUM_ATOMS
,
0
);
VerletIntegrator
integrator
(
0.01
);
StandardMMForceField
*
forces
=
new
StandardMMForceField
(
NUM_ATOMS
,
NUM_ATOMS
-
1
,
0
,
0
,
0
);
for
(
int
i
=
0
;
i
<
NUM_ATOMS
;
i
+=
2
)
{
// loop over all main-chain atoms (even numbered atoms)
for
(
int
i
=
0
;
i
<
NUM_ATOMS
-
1
;
i
+=
2
)
{
// side-chain bonds
forces
->
setBondParameters
(
i
,
i
,
i
+
1
,
1.0
,
1.0
);
if
(
i
<
NUM_ATOMS
-
1
)
// main-chain bonds
if
(
i
<
NUM_ATOMS
-
2
)
// penultimate atom (NUM_ATOMS-2) has no subsequent main-chain atom
forces
->
setBondParameters
(
i
+
1
,
i
,
i
+
2
,
1.0
,
1.0
);
}
system
.
addForce
(
forces
);
OpenMMContext
context
(
system
,
integrator
,
platform
);
}
...
...
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