From f0d355dca31c42f101fb18a28e20cc2c462c2201 Mon Sep 17 00:00:00 2001 From: fabsugar Date: Fri, 4 Nov 2022 13:06:43 -0400 Subject: [PATCH] Added >= to check values out of upper boundary just to be extra precise --- src/colvarbias_meta.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/colvarbias_meta.cpp b/src/colvarbias_meta.cpp index 59102017d..d3578f87f 100644 --- a/src/colvarbias_meta.cpp +++ b/src/colvarbias_meta.cpp @@ -1235,7 +1235,7 @@ int colvarbias_meta::calc_energy(std::vector const *values) curr_values[i]=interval_llimit[ii]; } ii=which_int_ulimit_cv[i]; - if (ii>-1 && curr_values[i]>interval_ulimit[ii] ) { + if (ii>-1 && curr_values[i]>=interval_ulimit[ii] ) { // check if upper border is out of the grid otherwise put it back on the grid up_bound_bin_value=hills_energy->lower_boundaries[i].real_value+variables(i)->width*(0.5+cvm::floor((interval_ulimit[ii]-hills_energy->lower_boundaries[i].real_value)/variables(i)->width)); //if (interval_ulimit[ii]==hills_energy->upper_boundaries[i].real_value){ @@ -1338,7 +1338,7 @@ int colvarbias_meta::calc_forces(std::vector const *values) } ii=which_int_ulimit_cv[ic]; if (ii>-1) { - if ( curr_values[ic]>interval_ulimit[ii] ) { + if ( curr_values[ic]>=interval_ulimit[ii] ) { add_force[ic]=false; up_bound_bin_value=hills_energy->lower_boundaries[ic].real_value+variables(ic)->width*(0.5+cvm::floor((interval_ulimit[ii]-hills_energy->lower_boundaries[ic].real_value)/variables(ic)->width)); //if (interval_ulimit[ii]==hills_energy->upper_boundaries[ic].real_value){