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
a2438509
Commit
a2438509
authored
Jun 10, 2015
by
Kyle Beauchamp
Browse files
Add check for null context inside integrator.step()
parent
d557fa41
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
0 deletions
+14
-0
openmmapi/src/CustomIntegrator.cpp
openmmapi/src/CustomIntegrator.cpp
+2
-0
openmmapi/src/LangevinIntegrator.cpp
openmmapi/src/LangevinIntegrator.cpp
+2
-0
openmmapi/src/VariableLangevinIntegrator.cpp
openmmapi/src/VariableLangevinIntegrator.cpp
+4
-0
openmmapi/src/VariableVerletIntegrator.cpp
openmmapi/src/VariableVerletIntegrator.cpp
+4
-0
openmmapi/src/VerletIntegrator.cpp
openmmapi/src/VerletIntegrator.cpp
+2
-0
No files found.
openmmapi/src/CustomIntegrator.cpp
View file @
a2438509
...
...
@@ -94,6 +94,8 @@ double CustomIntegrator::computeKineticEnergy() {
}
void
CustomIntegrator
::
step
(
int
steps
)
{
if
(
context
==
NULL
)
throw
OpenMMException
(
"This Integrator is not bound to a context!"
);
globalsAreCurrent
=
false
;
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
kernel
.
getAs
<
IntegrateCustomStepKernel
>
().
execute
(
*
context
,
*
this
,
forcesAreValid
);
...
...
openmmapi/src/LangevinIntegrator.cpp
View file @
a2438509
...
...
@@ -72,6 +72,8 @@ double LangevinIntegrator::computeKineticEnergy() {
}
void
LangevinIntegrator
::
step
(
int
steps
)
{
if
(
context
==
NULL
)
throw
OpenMMException
(
"This Integrator is not bound to a context!"
);
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
context
->
updateContextState
();
context
->
calcForcesAndEnergy
(
true
,
false
);
...
...
openmmapi/src/VariableLangevinIntegrator.cpp
View file @
a2438509
...
...
@@ -75,6 +75,8 @@ double VariableLangevinIntegrator::computeKineticEnergy() {
}
void
VariableLangevinIntegrator
::
step
(
int
steps
)
{
if
(
context
==
NULL
)
throw
OpenMMException
(
"This Integrator is not bound to a context!"
);
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
context
->
updateContextState
();
context
->
calcForcesAndEnergy
(
true
,
false
);
...
...
@@ -83,6 +85,8 @@ void VariableLangevinIntegrator::step(int steps) {
}
void
VariableLangevinIntegrator
::
stepTo
(
double
time
)
{
if
(
context
==
NULL
)
throw
OpenMMException
(
"This Integrator is not bound to a context!"
);
while
(
time
>
context
->
getTime
())
{
context
->
updateContextState
();
context
->
calcForcesAndEnergy
(
true
,
false
);
...
...
openmmapi/src/VariableVerletIntegrator.cpp
View file @
a2438509
...
...
@@ -70,6 +70,8 @@ double VariableVerletIntegrator::computeKineticEnergy() {
}
void
VariableVerletIntegrator
::
step
(
int
steps
)
{
if
(
context
==
NULL
)
throw
OpenMMException
(
"This Integrator is not bound to a context!"
);
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
context
->
updateContextState
();
context
->
calcForcesAndEnergy
(
true
,
false
);
...
...
@@ -78,6 +80,8 @@ void VariableVerletIntegrator::step(int steps) {
}
void
VariableVerletIntegrator
::
stepTo
(
double
time
)
{
if
(
context
==
NULL
)
throw
OpenMMException
(
"This Integrator is not bound to a context!"
);
while
(
time
>
context
->
getTime
())
{
context
->
updateContextState
();
context
->
calcForcesAndEnergy
(
true
,
false
);
...
...
openmmapi/src/VerletIntegrator.cpp
View file @
a2438509
...
...
@@ -69,6 +69,8 @@ double VerletIntegrator::computeKineticEnergy() {
}
void
VerletIntegrator
::
step
(
int
steps
)
{
if
(
context
==
NULL
)
throw
OpenMMException
(
"This Integrator is not bound to a context!"
);
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
context
->
updateContextState
();
context
->
calcForcesAndEnergy
(
true
,
false
);
...
...
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