Unverified Commit fd1cfdd6 authored by Peter Eastman's avatar Peter Eastman Committed by GitHub
Browse files

Removed more unnecessarily restrictive parameter checks (#3326)

parent 0993868a
......@@ -64,8 +64,6 @@ void HarmonicAngleForceImpl::initialize(ContextImpl& context) {
}
if (angle < 0 || angle > M_PI*1.000001)
throw OpenMMException("HarmonicAngleForce: angle must be between 0 and pi");
if (k < 0)
throw OpenMMException("HarmonicAngleForce: force constant cannot be negative");
}
kernel = context.getPlatform().createKernel(CalcHarmonicAngleForceKernel::Name(), context);
kernel.getAs<CalcHarmonicAngleForceKernel>().initialize(context.getSystem(), owner);
......
......@@ -93,8 +93,8 @@ void NonbondedForceImpl::initialize(ContextImpl& context) {
}
exceptions[particle[0]].insert(particle[1]);
exceptions[particle[1]].insert(particle[0]);
if (sigma <= 0)
throw OpenMMException("NonbondedForce: sigma for an exception must be positive");
if (sigma < 0)
throw OpenMMException("NonbondedForce: sigma for an exception cannot be negative");
if (epsilon < 0)
throw OpenMMException("NonbondedForce: epsilon for an exception cannot be negative");
}
......@@ -121,10 +121,6 @@ void NonbondedForceImpl::initialize(ContextImpl& context) {
msg << exceptionIndex;
throw OpenMMException(msg.str());
}
if (sigmaScale < 0)
throw OpenMMException("NonbondedForce: sigma scale for a particle parameter offset cannot be negative");
if (epsilonScale < 0)
throw OpenMMException("NonbondedForce: epsilon scale for a particle parameter offset cannot be negative");
}
if (owner.getNonbondedMethod() != NonbondedForce::NoCutoff && owner.getNonbondedMethod() != NonbondedForce::CutoffNonPeriodic) {
Vec3 boxVectors[3];
......
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