Skip to content

Commit

Permalink
Added >= to check values out of upper boundary just to be extra precise
Browse files Browse the repository at this point in the history
  • Loading branch information
fabsugar authored and giacomofiorin committed Apr 19, 2023
1 parent 82b4b2c commit f0d355d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/colvarbias_meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ int colvarbias_meta::calc_energy(std::vector<colvarvalue> 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){
Expand Down Expand Up @@ -1338,7 +1338,7 @@ int colvarbias_meta::calc_forces(std::vector<colvarvalue> 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){
Expand Down

0 comments on commit f0d355d

Please sign in to comment.