Skip to content
Snippets Groups Projects
Commit d27e3c0f authored by Gareth Tribello's avatar Gareth Tribello
Browse files

Small fix to convertToFes where ceil was used instead of round

parent 63993a81
No related branches found
No related tags found
No related merge requests found
...@@ -97,7 +97,7 @@ void GridVessel::setBounds( const std::vector<std::string>& smin, const std::vec ...@@ -97,7 +97,7 @@ void GridVessel::setBounds( const std::vector<std::string>& smin, const std::vec
if( spacing.size()==dimension && binsin.size()==dimension ) { if( spacing.size()==dimension && binsin.size()==dimension ) {
if( spacing[i]==0 ) nbin[i] = binsin[i]; if( spacing[i]==0 ) nbin[i] = binsin[i];
else { else {
double range = max[i] - min[i]; nbin[i] = std::ceil( range / spacing[i]); double range = max[i] - min[i]; nbin[i] = std::round( range / spacing[i]);
// This check ensures that nbins is set correctly if spacing is set the same as the number of bins // This check ensures that nbins is set correctly if spacing is set the same as the number of bins
if( nbin[i]!=binsin[i] ) plumed_merror("mismatch between input spacing and input number of bins"); if( nbin[i]!=binsin[i] ) plumed_merror("mismatch between input spacing and input number of bins");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment