Small fixes to Colvars library

Primarily a list of small fixes, combined with cosmetic changes and cleanups
in several files.

6d0c917 2018-04-29 Fix missing deallocation of output stream object (reported by HanatoK) [Giacomo Fiorin]
c92d369 2018-04-17 Do not test for atom group size [Jérôme Hénin]
431e52a 2018-04-06 Allow scripted/custom colvars to be periodic [Jérôme Hénin]
81d391f 2018-04-05 Split colvarcomp constructor into POD constructor + init() function [Giacomo Fiorin]
9b85d5f 2018-03-13 Fix issue with out-of-order atom selections; clarify format for ref positions [Giacomo Fiorin]
0e0ed37 2018-03-07 Support triclinic unit cells in VMD, clean up PBC functions [Giacomo Fiorin]
eed97c9 2018-02-24 Obtain integer version number from version string [Giacomo Fiorin]
c17f3cd 2018-02-23 Write trajectory labels only when needed [Giacomo Fiorin]
This commit is contained in:
Giacomo Fiorin
2018-05-02 14:57:41 -04:00
parent d5ec76290b
commit 0c005f5cb0
21 changed files with 605 additions and 452 deletions

View File

@ -21,6 +21,9 @@ colvar::cvc::cvc()
b_try_scalable(true)
{
init_cvc_requires();
sup_coeff = 1.0;
period = 0.0;
wrap_center = 0.0;
}
@ -30,40 +33,47 @@ colvar::cvc::cvc(std::string const &conf)
b_periodic(false),
b_try_scalable(true)
{
init_cvc_requires();
sup_coeff = 1.0;
period = 0.0;
wrap_center = 0.0;
init(conf);
}
int colvar::cvc::init(std::string const &conf)
{
int error_code = COLVARS_OK;
if (cvm::debug())
cvm::log("Initializing cvc base object.\n");
init_cvc_requires();
if (get_keyval(conf, "name", this->name, std::string(""), parse_silent)) {
get_keyval(conf, "name", this->name, this->name);
if (name.size() > 0) {
// Temporary description until child object is initialized
description = "cvc " + name;
} else {
description = "uninitialized cvc";
}
get_keyval(conf, "componentCoeff", sup_coeff, 1.0);
get_keyval(conf, "componentExp", sup_np, 1);
get_keyval(conf, "componentCoeff", sup_coeff, sup_coeff);
get_keyval(conf, "componentExp", sup_np, sup_np);
get_keyval(conf, "period", period, 0.0);
get_keyval(conf, "wrapAround", wrap_center, 0.0);
get_keyval(conf, "period", period, period);
get_keyval(conf, "wrapAround", wrap_center, wrap_center);
get_keyval_feature((colvarparse *)this, conf, "debugGradients",
get_keyval_feature(dynamic_cast<colvarparse *>(this), conf, "debugGradients",
f_cvc_debug_gradient, false, parse_silent);
{
bool b_no_PBC = false;
get_keyval(conf, "forceNoPBC", b_no_PBC, false);
if (b_no_PBC) {
disable(f_cvc_pbc_minimum_image);
} else {
enable(f_cvc_pbc_minimum_image);
}
// this does not use get_keyval_feature() only for backward compatibility
bool b_no_PBC = !is_enabled(f_cvc_pbc_minimum_image); // Enabled by default
get_keyval(conf, "forceNoPBC", b_no_PBC, b_no_PBC);
if (b_no_PBC) {
disable(f_cvc_pbc_minimum_image);
} else {
enable(f_cvc_pbc_minimum_image);
}
// Attempt scalable calculations when in parallel? (By default yes, if available)
get_keyval(conf, "scalable", b_try_scalable, true);
get_keyval(conf, "scalable", b_try_scalable, b_try_scalable);
if (cvm::debug())
cvm::log("Done initializing cvc base object.\n");