"vscode:/vscode.git/clone" did not exist on "3050314abd5317aed4b444ab382b1d53074ebe7a"
Commit 8be6e843 authored by Kyle Beauchamp's avatar Kyle Beauchamp
Browse files

Fix more integrators

parent a2438509
...@@ -72,6 +72,8 @@ double BrownianIntegrator::computeKineticEnergy() { ...@@ -72,6 +72,8 @@ double BrownianIntegrator::computeKineticEnergy() {
} }
void BrownianIntegrator::step(int steps) { void BrownianIntegrator::step(int steps) {
if (context == NULL)
throw OpenMMException("This Integrator is not bound to a context!");
for (int i = 0; i < steps; ++i) { for (int i = 0; i < steps; ++i) {
context->updateContextState(); context->updateContextState();
context->calcForcesAndEnergy(true, false); context->calcForcesAndEnergy(true, false);
......
...@@ -89,6 +89,8 @@ double DrudeLangevinIntegrator::computeKineticEnergy() { ...@@ -89,6 +89,8 @@ double DrudeLangevinIntegrator::computeKineticEnergy() {
} }
void DrudeLangevinIntegrator::step(int steps) { void DrudeLangevinIntegrator::step(int steps) {
if (context == NULL)
throw OpenMMException("This Integrator is not bound to a context!");
for (int i = 0; i < steps; ++i) { for (int i = 0; i < steps; ++i) {
context->updateContextState(); context->updateContextState();
context->calcForcesAndEnergy(true, false); context->calcForcesAndEnergy(true, false);
......
...@@ -86,6 +86,8 @@ double DrudeSCFIntegrator::computeKineticEnergy() { ...@@ -86,6 +86,8 @@ double DrudeSCFIntegrator::computeKineticEnergy() {
} }
void DrudeSCFIntegrator::step(int steps) { void DrudeSCFIntegrator::step(int steps) {
if (context == NULL)
throw OpenMMException("This Integrator is not bound to a context!");
for (int i = 0; i < steps; ++i) { for (int i = 0; i < steps; ++i) {
context->updateContextState(); context->updateContextState();
context->calcForcesAndEnergy(true, false); context->calcForcesAndEnergy(true, false);
......
...@@ -168,6 +168,8 @@ double RPMDIntegrator::computeKineticEnergy() { ...@@ -168,6 +168,8 @@ double RPMDIntegrator::computeKineticEnergy() {
} }
void RPMDIntegrator::step(int steps) { void RPMDIntegrator::step(int steps) {
if (context == NULL)
throw OpenMMException("This Integrator is not bound to a context!");
if (!hasSetPosition) { if (!hasSetPosition) {
// Initialize the positions from the context. // Initialize the positions from the context.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment