Unverified Commit f2cdf70a authored by zhang-ivy's avatar zhang-ivy Committed by GitHub
Browse files

Fix barostat frequency check (#3411)

* fix barostat frequency check

* fix other barostats

* fix error messages
parent 6eabb453
......@@ -49,8 +49,8 @@ void MonteCarloAnisotropicBarostat::setDefaultPressure(const Vec3& pressure) {
}
void MonteCarloAnisotropicBarostat::setFrequency(int freq) {
if (freq <= 0)
throw OpenMMException("Frequency must be positive");
if (freq < 0)
throw OpenMMException("Frequency cannot be negative");
frequency = freq;
}
......
......@@ -50,8 +50,8 @@ void MonteCarloBarostat::setDefaultPressure(double pressure) {
}
void MonteCarloBarostat::setFrequency(int freq) {
if (freq <= 0)
throw OpenMMException("Frequency must be positive");
if (freq < 0)
throw OpenMMException("Frequency cannot be negative");
frequency = freq;
}
......
......@@ -49,8 +49,8 @@ void MonteCarloFlexibleBarostat::setDefaultPressure(double pressure) {
}
void MonteCarloFlexibleBarostat::setFrequency(int freq) {
if (freq <= 0)
throw OpenMMException("Frequency must be positive");
if (freq < 0)
throw OpenMMException("Frequency cannot be negative");
frequency = freq;
}
......
......@@ -56,8 +56,8 @@ void MonteCarloMembraneBarostat::setDefaultSurfaceTension(double surfaceTension)
}
void MonteCarloMembraneBarostat::setFrequency(int freq) {
if (freq <= 0)
throw OpenMMException("Frequency must be positive");
if (freq < 0)
throw OpenMMException("Frequency cannot be negative");
frequency = freq;
}
......
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