Commit 7f367d00 authored by Peter Eastman's avatar Peter Eastman
Browse files

Setting update frequency to 0 disables MonteCarloBarostat

parent 2ef05285
......@@ -75,13 +75,15 @@ public:
return defaultPressure;
}
/**
* Get the frequency (in time steps) at which Monte Carlo pressure changes should be attempted.
* Get the frequency (in time steps) at which Monte Carlo pressure changes should be attempted. If this is set to
* 0, the barostat is disabled.
*/
int getFrequency() const {
return frequency;
}
/**
* Set the frequency (in time steps) at which Monte Carlo pressure changes should be attempted.
* Set the frequency (in time steps) at which Monte Carlo pressure changes should be attempted. If this is set to
* 0, the barostat is disabled.
*/
void setFrequency(int freq) {
frequency = freq;
......
......@@ -61,7 +61,7 @@ void MonteCarloBarostatImpl::initialize(ContextImpl& context) {
}
void MonteCarloBarostatImpl::updateContextState(ContextImpl& context) {
if (++step < owner.getFrequency())
if (++step < owner.getFrequency() || owner.getFrequency() == 0)
return;
step = 0;
......
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