From 59c0047fc18fa70e968fc6dbe24aaa6cf73e3820 Mon Sep 17 00:00:00 2001 From: fabsugar Date: Fri, 4 Nov 2022 17:12:54 -0400 Subject: [PATCH] Introdiced error if reflection limits are explicity specified out of grid boundaries --- src/colvarbias_meta.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/colvarbias_meta.cpp b/src/colvarbias_meta.cpp index d3578f87f..f766f0501 100644 --- a/src/colvarbias_meta.cpp +++ b/src/colvarbias_meta.cpp @@ -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); } } } @@ -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); } } }