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:
@ -148,7 +148,7 @@ void colvar::distance_vec::apply_force(colvarvalue const &force)
|
||||
cvm::real colvar::distance_vec::dist2(colvarvalue const &x1,
|
||||
colvarvalue const &x2) const
|
||||
{
|
||||
return cvm::position_dist2(x1.rvector_value, x2.rvector_value);
|
||||
return (cvm::position_distance(x1.rvector_value, x2.rvector_value)).norm2();
|
||||
}
|
||||
|
||||
|
||||
@ -192,7 +192,7 @@ colvar::distance_z::distance_z(std::string const &conf)
|
||||
// this group is optional
|
||||
ref2 = parse_group(conf, "ref2", true);
|
||||
|
||||
if (ref2 && ref2->size()) {
|
||||
if ( ref2 ) {
|
||||
cvm::log("Using axis joining the centers of mass of groups \"ref\" and \"ref2\"");
|
||||
fixed_axis = false;
|
||||
if (key_lookup(conf, "axis"))
|
||||
@ -306,7 +306,7 @@ void colvar::distance_z::apply_force(colvarvalue const &force)
|
||||
if (!ref1->noforce)
|
||||
ref1->apply_colvar_force(force.real_value);
|
||||
|
||||
if (ref2 && ref2->size() && !ref2->noforce)
|
||||
if (ref2 && !ref2->noforce)
|
||||
ref2->apply_colvar_force(force.real_value);
|
||||
|
||||
if (!main->noforce)
|
||||
@ -464,7 +464,7 @@ void colvar::distance_xy::apply_force(colvarvalue const &force)
|
||||
if (!ref1->noforce)
|
||||
ref1->apply_colvar_force(force.real_value);
|
||||
|
||||
if (ref2 && ref2->size() && !ref2->noforce)
|
||||
if (ref2 && !ref2->noforce)
|
||||
ref2->apply_colvar_force(force.real_value);
|
||||
|
||||
if (!main->noforce)
|
||||
@ -979,14 +979,12 @@ colvar::rmsd::rmsd(std::string const &conf)
|
||||
"if provided, must be non-zero.\n");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// if not, rely on existing atom indices for the group
|
||||
atoms->create_sorted_ids();
|
||||
ref_pos.resize(atoms->size());
|
||||
}
|
||||
|
||||
cvm::load_coords(ref_pos_file.c_str(), ref_pos, atoms->sorted_ids,
|
||||
ref_pos_col, ref_pos_col_value);
|
||||
ref_pos.resize(atoms->size());
|
||||
|
||||
cvm::load_coords(ref_pos_file.c_str(), &ref_pos, atoms,
|
||||
ref_pos_col, ref_pos_col_value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1172,13 +1170,11 @@ colvar::eigenvector::eigenvector(std::string const &conf)
|
||||
"if provided, must be non-zero.\n");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// if not, use atom indices
|
||||
atoms->create_sorted_ids();
|
||||
}
|
||||
|
||||
ref_pos.resize(atoms->size());
|
||||
cvm::load_coords(file_name.c_str(), ref_pos, atoms->sorted_ids, file_col, file_col_value);
|
||||
cvm::load_coords(file_name.c_str(), &ref_pos, atoms,
|
||||
file_col, file_col_value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1249,13 +1245,11 @@ colvar::eigenvector::eigenvector(std::string const &conf)
|
||||
cvm::error("Error: vectorColValue, if provided, must be non-zero.\n");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// if not, use atom indices
|
||||
atoms->create_sorted_ids();
|
||||
}
|
||||
|
||||
eigenvec.resize(atoms->size());
|
||||
cvm::load_coords(file_name.c_str(), eigenvec, atoms->sorted_ids, file_col, file_col_value);
|
||||
cvm::load_coords(file_name.c_str(), &eigenvec, atoms,
|
||||
file_col, file_col_value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user