From 66d8581041ab697898b82bfb7a68800cca3425e2 Mon Sep 17 00:00:00 2001 From: Davide Branduardi <davide.branduardi@gmail.com> Date: Sun, 11 Aug 2013 11:13:20 +0200 Subject: [PATCH] added a check over the sigma when diffusion --- src/bias/MetaD.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bias/MetaD.cpp b/src/bias/MetaD.cpp index 58cd3e325..ff802ee0c 100644 --- a/src/bias/MetaD.cpp +++ b/src/bias/MetaD.cpp @@ -318,6 +318,12 @@ isFirstStep(true) if(sigma0_.size()!=1){ error("If you choose ADAPTIVE you need only one sigma according to your choice of type (GEOM/DIFF)"); } + // if adaptive then the number must be an integer + if(adaptive_==FlexibleBin::diffusion){ + if(int(sigma0_[0])-sigma0_[0]>1.e-9 || int(sigma0_[0])-sigma0_[0] <-1.e-9 || int(sigma0_[0])<1 ){ + plumed_merror("In case of adaptive hills with diffusion, the sigma must be an integer which is the number of timesteps\n"); + } + } flexbin=new FlexibleBin(adaptive_,this,sigma0_[0]); } parse("HEIGHT",height0_); -- GitLab