Skip to content

Commit

Permalink
Introdiced error if reflection limits are explicity specified out of …
Browse files Browse the repository at this point in the history
…grid boundaries
  • Loading branch information
fabsugar authored and giacomofiorin committed Apr 19, 2023
1 parent f0d355d commit 59c0047
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/colvarbias_meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ int colvarbias_meta::init_reflection_params(std::string const &conf)
if (use_grids) {
ii=reflection_llimit_cv[i];
cvm:: real bound=hills_energy->lower_boundaries[ii].real_value;
if (reflection_llimit[i] < bound) {
cvm::log("Warning: you are using hills reflection with lower limit smaller than grid lower boundary for CV"+cvm::to_str(ii)+" \n");
if (reflection_llimit[i] != bound && reflection_llimit[i] < bound+variables(ii)->width) {
cvm::error("Error: please set lower reflection limit for CV "+cvm::to_str(ii)+" either at grid lower boundary ("+cvm::to_str(bound)+") or well above it (above "+cvm::to_str(bound+variables(ii)->width)+").\n", COLVARS_INPUT_ERROR);
}
}
}
Expand All @@ -464,8 +464,8 @@ int colvarbias_meta::init_reflection_params(std::string const &conf)
if (use_grids) {
ii=reflection_ulimit_cv[i];
cvm:: real bound=hills_energy->upper_boundaries[ii].real_value;
if (reflection_ulimit[i] > bound) {
cvm::log("Warning: you are using hills reflection with upper limit larger than grid upper boundary for CV"+cvm::to_str(ii)+" \n");
if (reflection_ulimit[i] != bound && reflection_ulimit[i] > bound-variables(ii)->width) {
cvm::error("Error: please set upper reflection limit for CV "+cvm::to_str(ii)+" either at grid upper boundary ("+cvm::to_str(bound)+") or well below it (below "+cvm::to_str(bound-variables(ii)->width)+").\n", COLVARS_INPUT_ERROR);
}
}
}
Expand Down

0 comments on commit 59c0047

Please sign in to comment.