#include <colvarcomp.h>
Inheritance diagram for colvar::alpha_dihedrals:

Public Member Functions | |
| alpha_dihedrals (std::string const &conf) | |
| alpha_dihedrals () | |
| virtual | ~alpha_dihedrals () |
| virtual void | calc_value () |
| Calculate the variable. | |
| virtual void | calc_gradients () |
| Calculate the atomic gradients, to be reused later in order to apply forces. | |
| virtual void | apply_force (colvarvalue const &force) |
| Apply the collective variable force, by communicating the atomic forces to the simulation program (Note: the member is not altered by this function). | |
| virtual cvm::real | dist2 (colvarvalue const &x1, colvarvalue const &x2) const |
| Square distance between x1 and x2 (can be redefined to transparently implement constraints, symmetries and periodicities). | |
| virtual colvarvalue | dist2_lgrad (colvarvalue const &x1, colvarvalue const &x2) const |
| Gradient (with respect to x1) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities). | |
| virtual colvarvalue | dist2_rgrad (colvarvalue const &x1, colvarvalue const &x2) const |
| Gradient (with respect to x2) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities). | |
| virtual cvm::real | compare (colvarvalue const &x1, colvarvalue const &x2) const |
| Return a positive number if x2>x1, zero if x2==x1, negative otherwise (can be redefined to transparently implement constraints, symmetries and periodicities) Note: it only works with scalar variables, otherwise raises an error. | |
Protected Attributes | |
| cvm::real | phi_ref |
| Alpha-helical reference phi value. | |
| cvm::real | psi_ref |
| Alpha-helical reference psi value. | |
| std::vector< dihedral * > | phi |
| List of phi dihedral angles. | |
| std::vector< dihedral * > | psi |
| List of psi dihedral angles. | |
| std::vector< h_bond * > | hb |
| List of hydrogen bonds. | |
Definition at line 746 of file colvarcomp.h.
|
|
Definition at line 219 of file colvarcomp_protein.C. References colvarmodule::debug(), colvarmodule::fatal_error(), hb, colvarmodule::log(), phi, phi_ref, psi, psi_ref, and colvarvalue::type(). 00220 : cvc (conf) 00221 { 00222 if (cvm::debug()) 00223 cvm::log ("Initializing alpha_dihedrals object.\n"); 00224 00225 function_type = "alpha_dihedrals"; 00226 x.type (colvarvalue::type_scalar); 00227 00228 std::vector<int> residues; 00229 00230 get_keyval (conf, "residues", residues, std::vector<int>()); 00231 00232 phi.reserve (residues.size()); 00233 psi.reserve (residues.size()); 00234 hb.reserve (residues.size()); 00235 00236 get_keyval (conf, "phi_ref", phi_ref, -57.8, parse_silent); 00237 get_keyval (conf, "psi_ref", psi_ref, -47.0, parse_silent); 00238 00239 if (residues.size() < 5) { 00240 cvm::fatal_error ("Error: not enough residues defined.\n"); 00241 } 00242 00243 std::string segment_id; 00244 get_keyval (conf, "segment_id", segment_id, std::string ("MAIN")); 00245 00246 std::string const &sid = segment_id; 00247 std::vector<int> const &r = residues; 00248 for (size_t i = 0; i < residues.size()-1; i++) { 00249 00250 phi.push_back (new colvar::dihedral (cvm::atom (r[i ], "C", sid), 00251 cvm::atom (r[i+1], "N", sid), 00252 cvm::atom (r[i+1], "CA", sid), 00253 cvm::atom (r[i+1], "C", sid))); 00254 00255 psi.push_back (new colvar::dihedral (cvm::atom (r[i ], "N", sid), 00256 cvm::atom (r[i ], "CA", sid), 00257 cvm::atom (r[i ], "C", sid), 00258 cvm::atom (r[i+1], "N", sid))); 00259 } 00260 00261 for (size_t i = 0; i < residues.size()-4; i++) { 00262 hb.push_back (new colvar::h_bond (cvm::atom (r[i ], "O", sid), 00263 cvm::atom (r[i+4], "N", sid), 00264 3.3 * cvm::unit_angstrom(), 00265 6, 8)); 00266 } 00267 00268 if (cvm::debug()) 00269 cvm::log ("Done initializing alpha_dihedrals object.\n"); 00270 }
|
|
|
Definition at line 273 of file colvarcomp_protein.C. References colvarvalue::type(). 00274 : cvc () 00275 { 00276 function_type = "alpha_dihedrals"; 00277 x.type (colvarvalue::type_scalar); 00278 }
|
|
|
Definition at line 770 of file colvarcomp.h. 00770 {}
|
|
|
Apply the collective variable force, by communicating the atomic forces to the simulation program (Note: the member is not altered by this function). Note: multiple calls to this function within the same simulation step will add the forces altogether
Implements colvar::cvc. Definition at line 330 of file colvarcomp_protein.C. References dih_deriv(), dih_func(), hb, phi, phi_ref, psi, psi_ref, colvarvalue::real_value, and colvar::cvc::value(). 00331 {
00332 for (size_t i = 0; i < phi.size(); i++) {
00333
00334 (phi[i])->apply_force ( 0.5 *
00335 dih_func (((psi[i])->value()).real_value, psi_ref) *
00336 dih_deriv (((phi[i])->value()).real_value, phi_ref) *
00337 force.real_value );
00338
00339 (psi[i])->apply_force ( 0.5 *
00340 dih_func (((phi[i])->value()).real_value, phi_ref) *
00341 dih_deriv (((psi[i])->value()).real_value, psi_ref) *
00342 force.real_value );
00343 }
00344
00345 for (size_t i = 0; i < hb.size(); i++) {
00346 (hb[i])->apply_force (0.5 * force.real_value);
00347 }
00348 }
|
|
|
Calculate the atomic gradients, to be reused later in order to apply forces.
Implements colvar::cvc. Definition at line 318 of file colvarcomp_protein.C. 00319 {
00320 for (size_t i = 0; i < phi.size(); i++) {
00321 (phi[i])->calc_gradients();
00322 (psi[i])->calc_gradients();
00323 }
00324 for (size_t i = 0; i < hb.size(); i++) {
00325 (hb[i])->calc_gradients();
00326 }
00327 }
|
|
|
Calculate the variable.
Implements colvar::cvc. Definition at line 281 of file colvarcomp_protein.C. References colvarmodule::debug(), dih_func(), hb, colvarmodule::log(), phi, phi_ref, psi, psi_ref, colvarvalue::real_value, and colvar::cvc::value(). 00282 {
00283 x.real_value = 0.0;
00284
00285 for (size_t i = 0; i < phi.size(); i++) {
00286
00287 (phi[i])->calc_value();
00288 (psi[i])->calc_value();
00289
00290 x.real_value += 0.5 *
00291 dih_func (((phi[i])->value()).real_value, phi_ref) *
00292 dih_func (((psi[i])->value()).real_value, psi_ref);
00293
00294 if (cvm::debug())
00295 cvm::log ("Phi dihedral no. "+cvm::to_str (i+1)+" in \""+
00296 this->name+"\" has a value of "+
00297 (cvm::to_str ((phi[i])->value().real_value))+
00298 " degrees.\n");
00299
00300 if (cvm::debug())
00301 cvm::log ("Psi dihedral no. "+cvm::to_str (i+1)+" in \""+
00302 this->name+"\" has a value of "+
00303 (cvm::to_str ((psi[i])->value().real_value))+
00304 " degrees.\n");
00305 }
00306
00307 for (size_t i = 0; i < hb.size(); i++) {
00308 (hb[i])->calc_value();
00309 x.real_value += 0.5 * (hb[i])->value().real_value;
00310 if (cvm::debug())
00311 cvm::log ("Hydrogen bond no. "+cvm::to_str (i+1)+" in \""+
00312 this->name+"\" has a value of "+
00313 (cvm::to_str ((hb[i])->value().real_value))+".\n");
00314 }
00315 }
|
|
||||||||||||
|
Return a positive number if x2>x1, zero if x2==x1, negative otherwise (can be redefined to transparently implement constraints, symmetries and periodicities) Note: it only works with scalar variables, otherwise raises an error.
Reimplemented from colvar::cvc. |
|
||||||||||||
|
Square distance between x1 and x2 (can be redefined to transparently implement constraints, symmetries and periodicities). colvar::cvc::dist2() and the related functions are declared as "const" functions, but not "static", because additional parameters defining the metrics (e.g. the periodicity) may be specific to each colvar::cvc object. If symmetries or periodicities are present, the colvar::cvc::dist2() should be redefined to return the "closest distance" value and colvar::cvc::dist2_lgrad(), colvar::cvc::dist2_rgrad() to return its gradients. If constraints are present (and not already implemented by any of the types), the colvar::cvc::dist2_lgrad() and colvar::cvc::dist2_rgrad() functions should be redefined to provide a gradient which is compatible with the constraint, i.e. already deprived of its component normal to the constraint hypersurface. Finally, another useful application, if you are performing very many operations with these functions, could be to override the member functions and access directly its member data. For instance: to define dist2(x1,x2) as (x2.real_value-x1.real_value)*(x2.real_value-x1.real_value) in case of a scalar type. Reimplemented from colvar::cvc. |
|
||||||||||||
|
Gradient (with respect to x1) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities).
Reimplemented from colvar::cvc. |
|
||||||||||||
|
Gradient (with respect to x2) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities).
Reimplemented from colvar::cvc. |
|
|
List of hydrogen bonds.
Definition at line 764 of file colvarcomp.h. Referenced by alpha_dihedrals(), apply_force(), calc_gradients(), and calc_value(). |
|
|
List of phi dihedral angles.
Definition at line 758 of file colvarcomp.h. Referenced by alpha_dihedrals(), apply_force(), calc_gradients(), and calc_value(). |
|
|
Alpha-helical reference phi value.
Definition at line 752 of file colvarcomp.h. Referenced by alpha_dihedrals(), apply_force(), and calc_value(). |
|
|
List of psi dihedral angles.
Definition at line 761 of file colvarcomp.h. Referenced by alpha_dihedrals(), apply_force(), calc_gradients(), and calc_value(). |
|
|
Alpha-helical reference psi value.
Definition at line 755 of file colvarcomp.h. Referenced by alpha_dihedrals(), apply_force(), and calc_value(). |
1.3.9.1