Commit 8217295b authored by Peter Eastman's avatar Peter Eastman
Browse files

Throw an exception if RPMDIntegrator is used with constraints

parent c9bb9746
...@@ -53,6 +53,8 @@ RPMDIntegrator::RPMDIntegrator(int numCopies, double temperature, double frictio ...@@ -53,6 +53,8 @@ RPMDIntegrator::RPMDIntegrator(int numCopies, double temperature, double frictio
void RPMDIntegrator::initialize(ContextImpl& contextRef) { void RPMDIntegrator::initialize(ContextImpl& contextRef) {
if (owner != NULL && &contextRef.getOwner() != owner) if (owner != NULL && &contextRef.getOwner() != owner)
throw OpenMMException("This Integrator is already bound to a context"); throw OpenMMException("This Integrator is already bound to a context");
if (contextRef.getSystem().getNumConstraints() > 0)
throw OpenMMException("RPMDIntegrator cannot be used with Systems that include constraints");
context = &contextRef; context = &contextRef;
owner = &contextRef.getOwner(); owner = &contextRef.getOwner();
kernel = context->getPlatform().createKernel(IntegrateRPMDStepKernel::Name(), contextRef); kernel = context->getPlatform().createKernel(IntegrateRPMDStepKernel::Name(), contextRef);
......
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