"examples/cpp-examples/HelloWaterBox.cpp" did not exist on "c5329db5348cb1a6c8e747d3813bc3f3d40c05f5"
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) { ...@@ -49,8 +49,8 @@ void MonteCarloAnisotropicBarostat::setDefaultPressure(const Vec3& pressure) {
} }
void MonteCarloAnisotropicBarostat::setFrequency(int freq) { void MonteCarloAnisotropicBarostat::setFrequency(int freq) {
if (freq <= 0) if (freq < 0)
throw OpenMMException("Frequency must be positive"); throw OpenMMException("Frequency cannot be negative");
frequency = freq; frequency = freq;
} }
......
...@@ -50,8 +50,8 @@ void MonteCarloBarostat::setDefaultPressure(double pressure) { ...@@ -50,8 +50,8 @@ void MonteCarloBarostat::setDefaultPressure(double pressure) {
} }
void MonteCarloBarostat::setFrequency(int freq) { void MonteCarloBarostat::setFrequency(int freq) {
if (freq <= 0) if (freq < 0)
throw OpenMMException("Frequency must be positive"); throw OpenMMException("Frequency cannot be negative");
frequency = freq; frequency = freq;
} }
......
...@@ -49,8 +49,8 @@ void MonteCarloFlexibleBarostat::setDefaultPressure(double pressure) { ...@@ -49,8 +49,8 @@ void MonteCarloFlexibleBarostat::setDefaultPressure(double pressure) {
} }
void MonteCarloFlexibleBarostat::setFrequency(int freq) { void MonteCarloFlexibleBarostat::setFrequency(int freq) {
if (freq <= 0) if (freq < 0)
throw OpenMMException("Frequency must be positive"); throw OpenMMException("Frequency cannot be negative");
frequency = freq; frequency = freq;
} }
......
...@@ -56,8 +56,8 @@ void MonteCarloMembraneBarostat::setDefaultSurfaceTension(double surfaceTension) ...@@ -56,8 +56,8 @@ void MonteCarloMembraneBarostat::setDefaultSurfaceTension(double surfaceTension)
} }
void MonteCarloMembraneBarostat::setFrequency(int freq) { void MonteCarloMembraneBarostat::setFrequency(int freq) {
if (freq <= 0) if (freq < 0)
throw OpenMMException("Frequency must be positive"); throw OpenMMException("Frequency cannot be negative");
frequency = freq; 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