update colvars library to version 2016-06-14
This commit is contained in:
@ -68,6 +68,7 @@ cvm::atom_group *colvar::cvc::parse_group(std::string const &conf,
|
|||||||
group->key = group_key;
|
group->key = group_key;
|
||||||
|
|
||||||
if (b_try_scalable) {
|
if (b_try_scalable) {
|
||||||
|
// TODO rewrite this logic in terms of dependencies
|
||||||
if (is_available(f_cvc_scalable_com) && is_available(f_cvc_com_based)) {
|
if (is_available(f_cvc_scalable_com) && is_available(f_cvc_com_based)) {
|
||||||
enable(f_cvc_scalable_com);
|
enable(f_cvc_scalable_com);
|
||||||
enable(f_cvc_scalable);
|
enable(f_cvc_scalable);
|
||||||
@ -109,10 +110,6 @@ int colvar::cvc::setup()
|
|||||||
add_child((cvm::deps *) atom_groups[i]);
|
add_child((cvm::deps *) atom_groups[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b_try_scalable && is_available(f_cvc_scalable)) {
|
|
||||||
enable(f_cvc_scalable);
|
|
||||||
}
|
|
||||||
|
|
||||||
return COLVARS_OK;
|
return COLVARS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -293,12 +293,7 @@ inline void colvar::cvc::wrap(colvarvalue &x) const
|
|||||||
|
|
||||||
/// \brief Colvar component: distance between the centers of mass of
|
/// \brief Colvar component: distance between the centers of mass of
|
||||||
/// two groups (colvarvalue::type_scalar type, range [0:*))
|
/// two groups (colvarvalue::type_scalar type, range [0:*))
|
||||||
///
|
|
||||||
/// This class also serves as the template for many collective
|
|
||||||
/// variables with two atom groups: in this case, the
|
|
||||||
/// distance::distance() constructor should be called on the same
|
|
||||||
/// configuration string, to make the same member data and functions
|
|
||||||
/// available to the derived object
|
|
||||||
class colvar::distance
|
class colvar::distance
|
||||||
: public colvar::cvc
|
: public colvar::cvc
|
||||||
{
|
{
|
||||||
@ -315,7 +310,7 @@ protected:
|
|||||||
/// coupling to other colvars (see e.g. Ciccotti et al., 2005)
|
/// coupling to other colvars (see e.g. Ciccotti et al., 2005)
|
||||||
bool b_1site_force;
|
bool b_1site_force;
|
||||||
public:
|
public:
|
||||||
distance(std::string const &conf, bool twogroups = true);
|
distance(std::string const &conf);
|
||||||
distance();
|
distance();
|
||||||
virtual inline ~distance() {}
|
virtual inline ~distance() {}
|
||||||
virtual void calc_value();
|
virtual void calc_value();
|
||||||
@ -764,9 +759,13 @@ public:
|
|||||||
/// \brief Colvar component: coordination number between two groups
|
/// \brief Colvar component: coordination number between two groups
|
||||||
/// (colvarvalue::type_scalar type, range [0:N1*N2])
|
/// (colvarvalue::type_scalar type, range [0:N1*N2])
|
||||||
class colvar::coordnum
|
class colvar::coordnum
|
||||||
: public colvar::distance
|
: public colvar::cvc
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
/// First atom group
|
||||||
|
cvm::atom_group *group1;
|
||||||
|
/// Second atom group
|
||||||
|
cvm::atom_group *group2;
|
||||||
/// \brief "Cutoff" for isotropic calculation (default)
|
/// \brief "Cutoff" for isotropic calculation (default)
|
||||||
cvm::real r0;
|
cvm::real r0;
|
||||||
/// \brief "Cutoff vector" for anisotropic calculation
|
/// \brief "Cutoff vector" for anisotropic calculation
|
||||||
@ -819,9 +818,11 @@ public:
|
|||||||
/// \brief Colvar component: self-coordination number within a group
|
/// \brief Colvar component: self-coordination number within a group
|
||||||
/// (colvarvalue::type_scalar type, range [0:N*(N-1)/2])
|
/// (colvarvalue::type_scalar type, range [0:N*(N-1)/2])
|
||||||
class colvar::selfcoordnum
|
class colvar::selfcoordnum
|
||||||
: public colvar::distance
|
: public colvar::cvc
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
/// First atom group
|
||||||
|
cvm::atom_group *group1;
|
||||||
/// \brief "Cutoff" for isotropic calculation (default)
|
/// \brief "Cutoff" for isotropic calculation (default)
|
||||||
cvm::real r0;
|
cvm::real r0;
|
||||||
/// Integer exponent of the function numerator
|
/// Integer exponent of the function numerator
|
||||||
|
|||||||
@ -71,22 +71,18 @@ cvm::real colvar::coordnum::switching_function(cvm::rvector const &r0_vec,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
colvar::coordnum::coordnum(std::string const &conf)
|
colvar::coordnum::coordnum(std::string const &conf)
|
||||||
: distance(conf), b_anisotropic(false), b_group2_center_only(false)
|
: cvc(conf), b_anisotropic(false), b_group2_center_only(false)
|
||||||
{
|
{
|
||||||
function_type = "coordnum";
|
function_type = "coordnum";
|
||||||
x.type(colvarvalue::type_scalar);
|
x.type(colvarvalue::type_scalar);
|
||||||
|
|
||||||
// group1 and group2 are already initialized by distance()
|
group1 = parse_group(conf, "group1");
|
||||||
|
group2 = parse_group(conf, "group2");
|
||||||
|
|
||||||
if (group1->b_dummy)
|
if (group1->b_dummy)
|
||||||
cvm::fatal_error("Error: only group2 is allowed to be a dummy atom\n");
|
cvm::fatal_error("Error: only group2 is allowed to be a dummy atom\n");
|
||||||
|
|
||||||
|
|
||||||
// need to specify this explicitly because the distance() constructor
|
|
||||||
// has set it to true
|
|
||||||
feature_states[f_cvc_inv_gradient]->available = false;
|
|
||||||
|
|
||||||
bool const b_isotropic = get_keyval(conf, "cutoff", r0,
|
bool const b_isotropic = get_keyval(conf, "cutoff", r0,
|
||||||
cvm::real(4.0 * cvm::unit_angstrom()));
|
cvm::real(4.0 * cvm::unit_angstrom()));
|
||||||
|
|
||||||
@ -291,17 +287,12 @@ void colvar::h_bond::apply_force(colvarvalue const &force)
|
|||||||
|
|
||||||
|
|
||||||
colvar::selfcoordnum::selfcoordnum(std::string const &conf)
|
colvar::selfcoordnum::selfcoordnum(std::string const &conf)
|
||||||
: distance(conf, false)
|
: cvc(conf)
|
||||||
{
|
{
|
||||||
function_type = "selfcoordnum";
|
function_type = "selfcoordnum";
|
||||||
x.type(colvarvalue::type_scalar);
|
x.type(colvarvalue::type_scalar);
|
||||||
|
|
||||||
// group1 is already initialized by distance()
|
group1 = parse_group(conf, "group1");
|
||||||
|
|
||||||
// need to specify this explicitly because the distance() constructor
|
|
||||||
// has set it to true
|
|
||||||
feature_states[f_cvc_inv_gradient]->available = false;
|
|
||||||
|
|
||||||
|
|
||||||
get_keyval(conf, "cutoff", r0, cvm::real(4.0 * cvm::unit_angstrom()));
|
get_keyval(conf, "cutoff", r0, cvm::real(4.0 * cvm::unit_angstrom()));
|
||||||
get_keyval(conf, "expNumer", en, int(6) );
|
get_keyval(conf, "expNumer", en, int(6) );
|
||||||
|
|||||||
@ -10,10 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// "twogroup" flag defaults to true; set to false by selfCoordNum
|
colvar::distance::distance(std::string const &conf)
|
||||||
// (only distance-derived component based on only one group)
|
|
||||||
|
|
||||||
colvar::distance::distance(std::string const &conf, bool twogroups)
|
|
||||||
: cvc(conf)
|
: cvc(conf)
|
||||||
{
|
{
|
||||||
function_type = "distance";
|
function_type = "distance";
|
||||||
@ -24,13 +21,12 @@ colvar::distance::distance(std::string const &conf, bool twogroups)
|
|||||||
if (get_keyval(conf, "forceNoPBC", b_no_PBC, false)) {
|
if (get_keyval(conf, "forceNoPBC", b_no_PBC, false)) {
|
||||||
cvm::log("Computing distance using absolute positions (not minimal-image)");
|
cvm::log("Computing distance using absolute positions (not minimal-image)");
|
||||||
}
|
}
|
||||||
if (twogroups && get_keyval(conf, "oneSiteSystemForce", b_1site_force, false)) {
|
if (get_keyval(conf, "oneSiteSystemForce", b_1site_force, false)) {
|
||||||
cvm::log("Computing system force on group 1 only");
|
cvm::log("Computing system force on group 1 only");
|
||||||
}
|
}
|
||||||
group1 = parse_group(conf, "group1");
|
group1 = parse_group(conf, "group1");
|
||||||
if (twogroups) {
|
group2 = parse_group(conf, "group2");
|
||||||
group2 = parse_group(conf, "group2");
|
|
||||||
}
|
|
||||||
x.type(colvarvalue::type_scalar);
|
x.type(colvarvalue::type_scalar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -362,11 +362,15 @@ void cvm::deps::init_cvc_requires() {
|
|||||||
f_description(f_cvc_Jacobian, "Jacobian");
|
f_description(f_cvc_Jacobian, "Jacobian");
|
||||||
f_req_self(f_cvc_Jacobian, f_cvc_inv_gradient);
|
f_req_self(f_cvc_Jacobian, f_cvc_inv_gradient);
|
||||||
|
|
||||||
f_description(f_cvc_scalable, "scalable calculation");
|
f_description(f_cvc_com_based, "depends on group centers of mass");
|
||||||
f_description(f_cvc_scalable_com, "scalable calculation of centers of mass");
|
|
||||||
|
|
||||||
|
f_description(f_cvc_scalable, "scalable calculation");
|
||||||
f_req_self(f_cvc_scalable, f_cvc_scalable_com);
|
f_req_self(f_cvc_scalable, f_cvc_scalable_com);
|
||||||
|
|
||||||
|
f_description(f_cvc_scalable_com, "scalable calculation of centers of mass");
|
||||||
|
f_req_self(f_cvc_scalable_com, f_cvc_com_based);
|
||||||
|
|
||||||
|
|
||||||
// TODO only enable this when f_ag_scalable can be turned on for a pre-initialized group
|
// TODO only enable this when f_ag_scalable can be turned on for a pre-initialized group
|
||||||
// f_req_children(f_cvc_scalable, f_ag_scalable);
|
// f_req_children(f_cvc_scalable, f_ag_scalable);
|
||||||
// f_req_children(f_cvc_scalable_com, f_ag_scalable_com);
|
// f_req_children(f_cvc_scalable_com, f_ag_scalable_com);
|
||||||
@ -380,9 +384,9 @@ void cvm::deps::init_cvc_requires() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Features that are implemented by all cvcs by default
|
// Features that are implemented by all cvcs by default
|
||||||
|
// Each cvc specifies what other features are available
|
||||||
feature_states[f_cvc_active]->available = true;
|
feature_states[f_cvc_active]->available = true;
|
||||||
feature_states[f_cvc_gradient]->available = true;
|
feature_states[f_cvc_gradient]->available = true;
|
||||||
// Each cvc specifies what other features are available
|
|
||||||
feature_states[f_cvc_scalable_com]->available = (proxy->scalable_group_coms() == COLVARS_OK);
|
feature_states[f_cvc_scalable_com]->available = (proxy->scalable_group_coms() == COLVARS_OK);
|
||||||
feature_states[f_cvc_scalable]->available = feature_states[f_cvc_scalable_com]->available;
|
feature_states[f_cvc_scalable]->available = feature_states[f_cvc_scalable_com]->available;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#define COLVARMODULE_H
|
#define COLVARMODULE_H
|
||||||
|
|
||||||
#ifndef COLVARS_VERSION
|
#ifndef COLVARS_VERSION
|
||||||
#define COLVARS_VERSION "2016-06-09"
|
#define COLVARS_VERSION "2016-06-14"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef COLVARS_DEBUG
|
#ifndef COLVARS_DEBUG
|
||||||
|
|||||||
@ -63,8 +63,8 @@ template<typename TYPE> bool colvarparse::_get_keyval_scalar_(std::string const
|
|||||||
}
|
}
|
||||||
value = def_value;
|
value = def_value;
|
||||||
if (parse_mode != parse_silent) {
|
if (parse_mode != parse_silent) {
|
||||||
cvm::log("# "+std::string(key)+" = \""+
|
cvm::log("# "+std::string(key)+" = "+
|
||||||
cvm::to_str(def_value)+"\" [default]\n");
|
cvm::to_str(def_value)+" [default]\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,8 +114,8 @@ bool colvarparse::_get_keyval_scalar_string_(std::string const &conf,
|
|||||||
std::string(key)+"\".\n", INPUT_ERROR);
|
std::string(key)+"\".\n", INPUT_ERROR);
|
||||||
}
|
}
|
||||||
if (parse_mode != parse_silent) {
|
if (parse_mode != parse_silent) {
|
||||||
cvm::log("# "+std::string(key)+" = "+
|
cvm::log("# "+std::string(key)+" = \""+
|
||||||
cvm::to_str(value)+"\n");
|
cvm::to_str(value)+"\"\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -125,8 +125,8 @@ bool colvarparse::_get_keyval_scalar_string_(std::string const &conf,
|
|||||||
}
|
}
|
||||||
value = def_value;
|
value = def_value;
|
||||||
if (parse_mode != parse_silent) {
|
if (parse_mode != parse_silent) {
|
||||||
cvm::log("# "+std::string(key)+" = "+
|
cvm::log("# "+std::string(key)+" = \""+
|
||||||
cvm::to_str(def_value)+" [default]\n");
|
cvm::to_str(def_value)+"\" [default]\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user