version 1.20 | version 1.21 |
---|
| |
colvarvalue colvar::distance_dir::dist2_lgrad(colvarvalue const &x1, | colvarvalue colvar::distance_dir::dist2_lgrad(colvarvalue const &x1, |
colvarvalue const &x2) const | colvarvalue const &x2) const |
{ | { |
return colvarvalue((x1.rvector_value - x2.rvector_value), colvarvalue::type_unit3vector); | return colvarvalue((x1.rvector_value - x2.rvector_value), colvarvalue::type_unit3vectorderiv); |
} | } |
| |
| |
colvarvalue colvar::distance_dir::dist2_rgrad(colvarvalue const &x1, | colvarvalue colvar::distance_dir::dist2_rgrad(colvarvalue const &x1, |
colvarvalue const &x2) const | colvarvalue const &x2) const |
{ | { |
return colvarvalue((x2.rvector_value - x1.rvector_value), colvarvalue::type_unit3vector); | return colvarvalue((x2.rvector_value - x1.rvector_value), colvarvalue::type_unit3vectorderiv); |
} | } |
| |
| |
| |
colvar::distance_inv::distance_inv(std::string const &conf) | colvar::distance_inv::distance_inv(std::string const &conf) |
: distance(conf) | : cvc(conf) |
{ | { |
function_type = "distance_inv"; | function_type = "distance_inv"; |
| |
| group1 = parse_group(conf, "group1"); |
| group2 = parse_group(conf, "group2"); |
| |
| if (get_keyval(conf, "forceNoPBC", b_no_PBC, false)) { |
| cvm::log("Computing distance using absolute positions (not minimal-image)"); |
| } |
| |
get_keyval(conf, "exponent", exponent, 6); | get_keyval(conf, "exponent", exponent, 6); |
if (exponent%2) { | if (exponent%2) { |
cvm::error("Error: odd exponent provided, can only use even ones.\n"); | cvm::error("Error: odd exponent provided, can only use even ones.\n"); |
| |
| |
cvm::log("This is a standard minimum RMSD, derivatives of the optimal rotation " | cvm::log("This is a standard minimum RMSD, derivatives of the optimal rotation " |
"will not be computed as they cancel out in the gradients."); | "will not be computed as they cancel out in the gradients."); |
atoms->b_fit_gradients = false; | atoms->disable(f_ag_fit_gradients); |
| |
// request the calculation of the derivatives of the rotation defined by the atom group | // request the calculation of the derivatives of the rotation defined by the atom group |
atoms->rot.request_group1_gradients(atoms->size()); | atoms->rot.request_group1_gradients(atoms->size()); |
| |
atoms->b_rotate = true; | atoms->b_rotate = true; |
atoms->ref_pos = ref_pos; | atoms->ref_pos = ref_pos; |
atoms->center_ref_pos(); | atoms->center_ref_pos(); |
atoms->b_fit_gradients = false; // cancel out if group is fitted on itself | atoms->disable(f_ag_fit_gradients); // cancel out if group is fitted on itself |
// and cvc is translationally invariant | // and cvc is translationally invariant |
| |
// request the calculation of the derivatives of the rotation defined by the atom group | // request the calculation of the derivatives of the rotation defined by the atom group |