Update Colvars to version 2017-10-11
Notable features are the umbrella-integration based free energy estimator for eABF, and the traditional thermodynamic integration estimator now available for umbrella sampling, SMD, metadynamics. Also included are several small fixes. Below is a list of relevant commits in the Colvars repository since the last update. 321d06a 2017-10-10 Add macros to manage colvarscript commands [Giacomo Fiorin] 26c3bec 2017-10-09 Document coming availability of Lepton in LAMMPS [Giacomo Fiorin] cc8f249 2017-10-04 Clarify that SMP depends on code build [Giacomo Fiorin] 0b2ffac 2017-10-04 Summarize colvar definition options, clarify some details [Giacomo Fiorin] 28002e0 2017-10-01 Separate writing of restart file from other output (e.g. PMFs) [Giacomo Fiorin] 92f7c1d 2017-10-01 Deprecate colvarsTrajAppend [Giacomo Fiorin] 12a707f 2017-09-26 Accurate Jacobian calculation for RMSD variants [Jérôme Hénin] fe389c9 2017-09-21 Allow subtractAppliedForce with extended-L again [Jérôme Hénin] c050ce0 2017-09-18 Silence compiler warnings, remove Tabs [Giacomo Fiorin] cb41905 2017-01-11 Add base class for TI estimator in other biases than ABF [Giacomo Fiorin] a1bc676 2017-09-14 Avoid writing to unopened traj file [Jérôme Hénin] b58d8cd 2017-09-08 Function to check for overlapping groups [Jérôme Hénin] 1e5efec 2017-09-07 Check for overlapping groups in coordNum [Jérôme Hénin] 03a61a4 2017-04-06 Add UI-based estimator [fhh2626] ae43754 2017-08-17 Fix outputCenters parsing [Josh Vermaas] 1619e0e 2017-08-14 Delete static feature arrays in cvm destructor [Jérôme Hénin]
This commit is contained in:
@ -14,6 +14,8 @@
|
||||
|
||||
colvarbias_abf::colvarbias_abf(char const *key)
|
||||
: colvarbias(key),
|
||||
b_UI_estimator(false),
|
||||
b_CZAR_estimator(false),
|
||||
system_force(NULL),
|
||||
gradients(NULL),
|
||||
samples(NULL),
|
||||
@ -159,6 +161,7 @@ int colvarbias_abf::init(std::string const &conf)
|
||||
|
||||
// Data for eABF z-based estimator
|
||||
if (b_extended) {
|
||||
get_keyval(conf, "CZARestimator", b_CZAR_estimator, true);
|
||||
// CZAR output files for stratified eABF
|
||||
get_keyval(conf, "writeCZARwindowFile", b_czar_window_file, false,
|
||||
colvarparse::parse_silent);
|
||||
@ -187,8 +190,38 @@ int colvarbias_abf::init(std::string const &conf)
|
||||
read_gradients_samples();
|
||||
}
|
||||
|
||||
cvm::log("Finished ABF setup.\n");
|
||||
// if extendedLangrangian is on, then call UI estimator
|
||||
if (b_extended) {
|
||||
get_keyval(conf, "UIestimator", b_UI_estimator, false);
|
||||
|
||||
if (b_UI_estimator) {
|
||||
std::vector<double> UI_lowerboundary;
|
||||
std::vector<double> UI_upperboundary;
|
||||
std::vector<double> UI_width;
|
||||
std::vector<double> UI_krestr;
|
||||
|
||||
bool UI_restart = (input_prefix.size() > 0);
|
||||
|
||||
for (size_t i = 0; i < colvars.size(); i++)
|
||||
{
|
||||
UI_lowerboundary.push_back(colvars[i]->lower_boundary);
|
||||
UI_upperboundary.push_back(colvars[i]->upper_boundary);
|
||||
UI_width.push_back(colvars[i]->width);
|
||||
UI_krestr.push_back(colvars[i]->force_constant());
|
||||
}
|
||||
eabf_UI = UIestimator::UIestimator(UI_lowerboundary,
|
||||
UI_upperboundary,
|
||||
UI_width,
|
||||
UI_krestr, // force constant in eABF
|
||||
output_prefix, // the prefix of output files
|
||||
cvm::restart_out_freq,
|
||||
UI_restart, // whether restart from a .count and a .grad file
|
||||
input_prefix, // the prefixes of input files
|
||||
cvm::temperature());
|
||||
}
|
||||
}
|
||||
|
||||
cvm::log("Finished ABF setup.\n");
|
||||
return COLVARS_OK;
|
||||
}
|
||||
|
||||
@ -332,7 +365,7 @@ int colvarbias_abf::update()
|
||||
}
|
||||
|
||||
// update the output prefix; TODO: move later to setup_output() function
|
||||
if (cvm::num_biases_feature(colvardeps::f_cvb_calc_pmf) == 1) {
|
||||
if (cvm::main()->num_biases_feature(colvardeps::f_cvb_calc_pmf) == 1) {
|
||||
// This is the only bias computing PMFs
|
||||
output_prefix = cvm::output_prefix();
|
||||
} else {
|
||||
@ -364,6 +397,20 @@ int colvarbias_abf::update()
|
||||
cvm::log("Prepared sample and gradient buffers at step "+cvm::to_str(cvm::step_absolute())+".");
|
||||
}
|
||||
|
||||
// update UI estimator every step
|
||||
if (b_UI_estimator)
|
||||
{
|
||||
std::vector<double> x(colvars.size(),0);
|
||||
std::vector<double> y(colvars.size(),0);
|
||||
for (size_t i = 0; i < colvars.size(); i++)
|
||||
{
|
||||
x[i] = colvars[i]->actual_value();
|
||||
y[i] = colvars[i]->value();
|
||||
}
|
||||
eabf_UI.update_output_filename(output_prefix);
|
||||
eabf_UI.update(cvm::step_absolute(), x, y);
|
||||
}
|
||||
|
||||
return COLVARS_OK;
|
||||
}
|
||||
|
||||
@ -479,8 +526,8 @@ void colvarbias_abf::write_gradients_samples(const std::string &prefix, bool app
|
||||
cvm::proxy->close_output_stream(pmf_out_name);
|
||||
}
|
||||
|
||||
if (z_gradients) {
|
||||
// Write eABF-related quantities
|
||||
if (b_CZAR_estimator) {
|
||||
// Write eABF CZAR-related quantities
|
||||
|
||||
std::string z_samples_out_name = prefix + ".zcount";
|
||||
|
||||
@ -588,7 +635,7 @@ void colvarbias_abf::read_gradients_samples()
|
||||
is.close();
|
||||
}
|
||||
|
||||
if (z_gradients) {
|
||||
if (b_CZAR_estimator) {
|
||||
// Read eABF z-averaged data for CZAR
|
||||
cvm::log("Reading z-histogram from " + z_samples_in_name + " and z-gradient from " + z_gradients_in_name);
|
||||
|
||||
@ -621,7 +668,7 @@ std::ostream & colvarbias_abf::write_state_data(std::ostream& os)
|
||||
os << "\ngradient\n";
|
||||
gradients->write_raw(os, 8);
|
||||
|
||||
if (z_gradients) {
|
||||
if (b_CZAR_estimator) {
|
||||
os.setf(std::ios::fmtflags(0), std::ios::floatfield); // default floating-point format
|
||||
os << "\nz_samples\n";
|
||||
z_samples->write_raw(os, 8);
|
||||
@ -655,7 +702,7 @@ std::istream & colvarbias_abf::read_state_data(std::istream& is)
|
||||
return is;
|
||||
}
|
||||
|
||||
if (z_gradients) {
|
||||
if (b_CZAR_estimator) {
|
||||
|
||||
if (! read_state_data_key(is, "z_samples")) {
|
||||
return is;
|
||||
|
||||
Reference in New Issue
Block a user