diff --git a/CHANGES/v2.0.txt b/CHANGES/v2.0.txt index fd0399275d30424cb4106d243e25a97688b0042c..54ba4606daecd834585eedd6b96a0fd7e7ea33e2 100644 --- a/CHANGES/v2.0.txt +++ b/CHANGES/v2.0.txt @@ -18,11 +18,15 @@ In addition, it is now much easier to contribute new functionality to the code b - Developer and user documentation Version 2.0.1 (unpublised yet, check out branch v2.0 on git repository) + For users: - Several small fixes in documentation and log file +- Fixed a bug in HISTOGRAM with REWEIGHT_BIAS. Reweighting was only done when also temperature-reweighing was enabled. - Added message when "plumed simpled" is used on a non-existing file + For developers: - Several small fixes in documentation - Added possibility to setup replica exchange from MD codes in fortran (commands "GREX setMPIFIntercomm" and "GREX setMPIFIntracomm") +- cmd("setStopFlag") should now be called after PLUMED initialization. */ diff --git a/regtest/analysis/rt0/Makefile b/regtest/analysis/rt0/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..3703b27cea227aa053fb6d1d73f861e4384dbcee --- /dev/null +++ b/regtest/analysis/rt0/Makefile @@ -0,0 +1 @@ +include ../../scripts/test.make diff --git a/regtest/analysis/rt0/config b/regtest/analysis/rt0/config new file mode 100644 index 0000000000000000000000000000000000000000..f93ec1a97465724691bf162d4735f5ea3648bbb4 --- /dev/null +++ b/regtest/analysis/rt0/config @@ -0,0 +1,3 @@ +type=driver +# this is to test a different name +arg="--plumed plumed.dat --ixyz trajectory.xyz" diff --git a/regtest/analysis/rt0/histoA.reference b/regtest/analysis/rt0/histoA.reference new file mode 100644 index 0000000000000000000000000000000000000000..11425019a9f1aa584941f61388daf5301c3fbaac --- /dev/null +++ b/regtest/analysis/rt0/histoA.reference @@ -0,0 +1,106 @@ +#! FIELDS x probs +#! SET min_x 0.0 +#! SET max_x 3.0 +#! SET nbins_x 101 +#! SET periodic_x false + 0.0000 0.0000 + 0.0300 0.0000 + 0.0600 0.0000 + 0.0900 0.0000 + 0.1200 0.0000 + 0.1500 0.0000 + 0.1800 0.0000 + 0.2100 0.0000 + 0.2400 0.0000 + 0.2700 0.0000 + 0.3000 0.0000 + 0.3300 0.0000 + 0.3600 0.0000 + 0.3900 0.0000 + 0.4200 0.0000 + 0.4500 0.0000 + 0.4800 0.0000 + 0.5100 0.0000 + 0.5400 0.0000 + 0.5700 0.0000 + 0.6000 0.0000 + 0.6300 0.0000 + 0.6600 0.0000 + 0.6900 0.0000 + 0.7200 0.0000 + 0.7500 0.0000 + 0.7800 0.0000 + 0.8100 0.0000 + 0.8400 0.0000 + 0.8700 0.0000 + 0.9000 0.0000 + 0.9300 0.0000 + 0.9600 0.0000 + 0.9900 0.0000 + 1.0200 0.0000 + 1.0500 0.0000 + 1.0800 0.0000 + 1.1100 0.0000 + 1.1400 0.0031 + 1.1700 0.0086 + 1.2000 0.0221 + 1.2300 0.0521 + 1.2600 0.1119 + 1.2900 0.2199 + 1.3200 0.3947 + 1.3500 0.6476 + 1.3800 0.9709 + 1.4100 1.3304 + 1.4400 1.6661 + 1.4700 1.9069 + 1.5000 1.9947 + 1.5300 1.9069 + 1.5600 1.6661 + 1.5900 1.3304 + 1.6200 0.9724 + 1.6500 0.6520 + 1.6800 0.4067 + 1.7100 0.2497 + 1.7400 0.1799 + 1.7700 0.1937 + 1.8000 0.2921 + 1.8300 0.4788 + 1.8600 0.7517 + 1.8900 1.0893 + 1.9200 1.4485 + 1.9500 1.7603 + 1.9800 1.9552 + 2.0100 1.9848 + 2.0400 1.8414 + 2.0700 1.5613 + 2.1000 1.2099 + 2.1300 0.8568 + 2.1600 0.5546 + 2.1900 0.3281 + 2.2200 0.1774 + 2.2500 0.0876 + 2.2800 0.0396 + 2.3100 0.0163 + 2.3400 0.0062 + 2.3700 0.0000 + 2.4000 0.0000 + 2.4300 0.0000 + 2.4600 0.0000 + 2.4900 0.0000 + 2.5200 0.0000 + 2.5500 0.0000 + 2.5800 0.0000 + 2.6100 0.0000 + 2.6400 0.0000 + 2.6700 0.0000 + 2.7000 0.0000 + 2.7300 0.0000 + 2.7600 0.0000 + 2.7900 0.0000 + 2.8200 0.0000 + 2.8500 0.0000 + 2.8800 0.0000 + 2.9100 0.0000 + 2.9400 0.0000 + 2.9700 0.0000 + 3.0000 0.0000 diff --git a/regtest/analysis/rt0/histoB.reference b/regtest/analysis/rt0/histoB.reference new file mode 100644 index 0000000000000000000000000000000000000000..0facce1f608dbfad4d6f637ce120bf88ab7d1794 --- /dev/null +++ b/regtest/analysis/rt0/histoB.reference @@ -0,0 +1,106 @@ +#! FIELDS x probs +#! SET min_x 0.0 +#! SET max_x 3.0 +#! SET nbins_x 101 +#! SET periodic_x false + 0.0000 0.0000 + 0.0300 0.0000 + 0.0600 0.0000 + 0.0900 0.0000 + 0.1200 0.0000 + 0.1500 0.0000 + 0.1800 0.0000 + 0.2100 0.0000 + 0.2400 0.0000 + 0.2700 0.0000 + 0.3000 0.0000 + 0.3300 0.0000 + 0.3600 0.0000 + 0.3900 0.0000 + 0.4200 0.0000 + 0.4500 0.0000 + 0.4800 0.0000 + 0.5100 0.0000 + 0.5400 0.0000 + 0.5700 0.0000 + 0.6000 0.0000 + 0.6300 0.0000 + 0.6600 0.0000 + 0.6900 0.0000 + 0.7200 0.0000 + 0.7500 0.0000 + 0.7800 0.0000 + 0.8100 0.0000 + 0.8400 0.0000 + 0.8700 0.0000 + 0.9000 0.0000 + 0.9300 0.0000 + 0.9600 0.0000 + 0.9900 0.0000 + 1.0200 0.0000 + 1.0500 0.0000 + 1.0800 0.0000 + 1.1100 0.0000 + 1.1400 0.0027 + 1.1700 0.0077 + 1.2000 0.0199 + 1.2300 0.0469 + 1.2600 0.1008 + 1.2900 0.1979 + 1.3200 0.3553 + 1.3500 0.5829 + 1.3800 0.8740 + 1.4100 1.1975 + 1.4400 1.4997 + 1.4700 1.7165 + 1.5000 1.7954 + 1.5300 1.7165 + 1.5600 1.4997 + 1.5900 1.1975 + 1.6200 0.8756 + 1.6500 0.5877 + 1.6800 0.3684 + 1.7100 0.2307 + 1.7400 0.1755 + 1.7700 0.2027 + 1.8000 0.3169 + 1.8300 0.5250 + 1.8600 0.8262 + 1.8900 1.1981 + 1.9200 1.5931 + 1.9500 1.9362 + 1.9800 2.1505 + 2.0100 2.1830 + 2.0400 2.0253 + 2.0700 1.7172 + 2.1000 1.3307 + 2.1300 0.9424 + 2.1600 0.6100 + 2.1900 0.3609 + 2.2200 0.1951 + 2.2500 0.0964 + 2.2800 0.0435 + 2.3100 0.0180 + 2.3400 0.0068 + 2.3700 0.0000 + 2.4000 0.0000 + 2.4300 0.0000 + 2.4600 0.0000 + 2.4900 0.0000 + 2.5200 0.0000 + 2.5500 0.0000 + 2.5800 0.0000 + 2.6100 0.0000 + 2.6400 0.0000 + 2.6700 0.0000 + 2.7000 0.0000 + 2.7300 0.0000 + 2.7600 0.0000 + 2.7900 0.0000 + 2.8200 0.0000 + 2.8500 0.0000 + 2.8800 0.0000 + 2.9100 0.0000 + 2.9400 0.0000 + 2.9700 0.0000 + 3.0000 0.0000 diff --git a/regtest/analysis/rt0/plumed.dat b/regtest/analysis/rt0/plumed.dat new file mode 100755 index 0000000000000000000000000000000000000000..e7911eceaebf9144adf44cccb3d30c3a4ffa8610 --- /dev/null +++ b/regtest/analysis/rt0/plumed.dat @@ -0,0 +1,31 @@ +x: DISTANCE ATOMS=1,2 + +RESTRAINT ARG=x SLOPE=1.0 AT=0.0 + +HISTOGRAM ... + ARG=x + TEMP=300 + GRID_MIN=0.0 + GRID_MAX=3.0 + GRID_BIN=100 + BANDWIDTH=0.1 + GRID_WFILE=histoA + FMT=%8.4f + RUN=1 +... HISTOGRAM + +HISTOGRAM ... + ARG=x + TEMP=300 + GRID_MIN=0.0 + GRID_MAX=3.0 + GRID_BIN=100 + BANDWIDTH=0.1 + GRID_WFILE=histoB + FMT=%8.4f + REWEIGHT_BIAS + RUN=1 +... HISTOGRAM + + + diff --git a/regtest/analysis/rt0/trajectory.xyz b/regtest/analysis/rt0/trajectory.xyz new file mode 100644 index 0000000000000000000000000000000000000000..c910ae5c6fda2241cfe5be857f9b8493db430ed3 --- /dev/null +++ b/regtest/analysis/rt0/trajectory.xyz @@ -0,0 +1,12 @@ +2 +0 0 0 +X 0 0 0 +X 0 0 1 +2 +0 0 0 +X 0 0 0 +X 0 0 1.5 +2 +0 0 0 +X 0 0 0 +X 0 0 2 diff --git a/src/analysis/Analysis.cpp b/src/analysis/Analysis.cpp index 15e0e0936c8437427ce5ba0d1eac43dcc372c7a5..d78a42337e5af3aeb763070849742d665a6604ed 100644 --- a/src/analysis/Analysis.cpp +++ b/src/analysis/Analysis.cpp @@ -222,9 +222,9 @@ void Analysis::calculate(){ double energy=plumed.getAtoms().getEnergy()+bias; // Reweighting because of temperature difference ww=-( (1.0/rtemp) - (1.0/simtemp) )*(energy+bias) / plumed.getAtoms().getKBoltzmann(); - // Reweighting because of biases - if( !biases.empty() ) ww += bias/( plumed.getAtoms().getKBoltzmann()*simtemp ); } + // Reweighting because of biases + if( !biases.empty() ) ww += bias/( plumed.getAtoms().getKBoltzmann()*simtemp ); if(single_run){ // Get the arguments and store them in a vector of vectors diff --git a/src/cltools/Driver.cpp b/src/cltools/Driver.cpp index 639dfb99ca325871f21ad0bd6713bf87f3f26dc3..74b0a0e6f031b6a1c718bb527885455ad40b3a3d 100644 --- a/src/cltools/Driver.cpp +++ b/src/cltools/Driver.cpp @@ -256,8 +256,6 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc){ int rr=sizeof(real); p.cmd("setRealPrecision",&rr); int checknatoms=-1; - int plumedStopCondition=0; - p.cmd("setStopFlag",&plumedStopCondition); int step=0; if(Communicator::initialized()){ if(multi){ @@ -327,7 +325,7 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc){ while(true){ if(!noatoms){ if(!Tools::getline(fp,line)) break; - } else if ( plumedStopCondition ) break; + } int natoms; bool first_step=false; @@ -421,7 +419,9 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc){ } } + int plumedStopCondition=0; p.cmd("setStep",&step); + p.cmd("setStopFlag",&plumedStopCondition); if(!noatoms){ if(trajectory_fmt=="xyz"){ if(!Tools::getline(fp,line)) error("premature end of trajectory file"); @@ -559,6 +559,8 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc){ fprintf(fp_forces,fmt.c_str(),forces[3*i],forces[3*i+1],forces[3*i+2]); } + if(noatoms && plumedStopCondition) break; + step+=stride; } p.cmd("runFinalJobs"); diff --git a/src/core/PlumedMain.cpp b/src/core/PlumedMain.cpp index db21f28601dbba4b076ea41a4aa0b41c61948648..b33cd6fe739d189c310de890fc377b4b60681f1d 100644 --- a/src/core/PlumedMain.cpp +++ b/src/core/PlumedMain.cpp @@ -289,11 +289,11 @@ void PlumedMain::cmd(const std::string & word,void*val){ CHECK_NOTINIT(initialized,word); CHECK_NULL(val,word); log.open(static_cast<char*>(val),"w"); +// other commands that should be used after initialization: } else if(word=="setStopFlag"){ - CHECK_NOTINIT(initialized,word); + CHECK_INIT(initialized,word); CHECK_NULL(val,word); stopFlag=static_cast<int*>(val); -// other commands that should be used after initialization: } else if(word=="getExchangesFlag"){ CHECK_INIT(initialized,word); CHECK_NULL(val,word); diff --git a/user-doc/Installation.txt b/user-doc/Installation.txt index 883c8c0fb61962fb0a2a2763079265f355f01685..da5a75ccda03b5575ee9efadc37d4c191013fa73 100644 --- a/user-doc/Installation.txt +++ b/user-doc/Installation.txt @@ -7,7 +7,7 @@ PLUMED does not yet have any automatic configuration procedure and most of the decisions should be taken by the user. As a first step configure with the command: \verbatim -> ./configure +> ./configure.sh \endverbatim You will have to choose among a set of available preconfigured files.