#include <colvarbias_meta.h>
Public Member Functions | |
| hill (cvm::real const &W_in, std::vector< colvar * > &cv, cvm::real const &hill_width, std::string const &replica_in="") | |
| Runtime constructor: data are read directly from collective variables. | |
| hill (size_t const &it_in, cvm::real const &W_in, std::vector< colvarvalue > const ¢ers_in, std::vector< cvm::real > const &widths_in, std::string const &replica_in="") | |
| General constructor: all data are explicitly passed as arguments (used for instance when reading hills saved on a file). | |
| hill (colvarbias_meta::hill const &h) | |
| Copy constructor. | |
| ~hill () | |
| Destructor. | |
| cvm::real | energy () |
| Get the energy. | |
| cvm::real | energy (cvm::real const &new_weight) |
| Get the energy using another hill weight. | |
| cvm::real const & | value () |
| Get the current hill value. | |
| void | value (cvm::real const &new_value) |
| Set the hill value as specified. | |
| cvm::real | weight () |
| Get the weight. | |
| void | scale (cvm::real const &new_scale_fac) |
| Scale the weight with this factor (by default 1.0 is used). | |
| std::vector< colvarvalue > & | center () |
| Get the center of the hill. | |
| colvarvalue & | center (size_t const &i) |
| Get the i-th component of the center. | |
| std::string | output_traj () |
| Represent the hill ina string suitable for a trajectory file. | |
Public Attributes | |
| size_t | it |
| Time step at which this hill was added. | |
| std::string | replica |
| Identity of the replica who added this hill (only in multiple replica simulations). | |
Protected Attributes | |
| cvm::real | hill_value |
| Value of the hill function (ranges between 0 and 1). | |
| cvm::real | sW |
| Scale factor, which could be modified at runtime (default: 1). | |
| cvm::real | W |
| Maximum height in energy of the hill. | |
| std::vector< colvarvalue > | centers |
| Center of the hill in the collective variable space. | |
| std::vector< cvm::real > | widths |
| Widths of the hill in the collective variable space. | |
Friends | |
| class | colvarbias_meta |
| bool | operator< (hill const &h1, hill const &h2) |
| Comparison operator. | |
| bool | operator<= (hill const &h1, hill const &h2) |
| Comparison operator. | |
| bool | operator> (hill const &h1, hill const &h2) |
| Comparison operator. | |
| bool | operator>= (hill const &h1, hill const &h2) |
| Comparison operator. | |
| bool | operator== (hill const &h1, hill const &h2) |
| Comparison operator. | |
| std::ostream & | operator<< (std::ostream &os, hill const &h) |
| Write the hill to an output stream. | |
Definition at line 234 of file colvarbias_meta.h.
|
||||||||||||||||||||
|
Runtime constructor: data are read directly from collective variables.
Definition at line 268 of file colvarbias_meta.h. References cvm, colvarmodule::debug(), colvarmodule::log(), and colvarmodule::to_str(). 00272 : sW (1.0), 00273 W (W_in), 00274 centers (cv.size()), 00275 widths (cv.size()), 00276 it (cvm::it), 00277 replica (replica_in) 00278 { 00279 for (size_t i = 0; i < cv.size(); i++) { 00280 centers[i].type (cv[i]->type()); 00281 centers[i] = cv[i]->value(); 00282 widths[i] = cv[i]->width * hill_width; 00283 } 00284 if (cvm::debug()) 00285 cvm::log ("New hill, applied to "+cvm::to_str (cv.size())+ 00286 " collective variables, with centers "+ 00287 cvm::to_str (centers)+", widths "+ 00288 cvm::to_str (widths)+" and weight "+ 00289 cvm::to_str (W)+".\n"); 00290 }
|
|
||||||||||||||||||||||||
|
General constructor: all data are explicitly passed as arguments (used for instance when reading hills saved on a file).
Definition at line 298 of file colvarbias_meta.h. 00303 : sW (1.0), 00304 W (W_in), 00305 centers (centers_in), 00306 widths (widths_in), 00307 it (it_in), 00308 replica (replica_in) 00309 {}
|
|
|
Copy constructor.
Definition at line 312 of file colvarbias_meta.h. 00313 : sW (1.0), 00314 W (h.W), 00315 centers (h.centers), 00316 widths (h.widths), 00317 it (h.it), 00318 replica (h.replica) 00319 {}
|
|
|
Destructor.
Definition at line 322 of file colvarbias_meta.h. 00323 {}
|
|
|
Get the i-th component of the center.
Definition at line 368 of file colvarbias_meta.h. 00369 {
00370 return centers[i];
00371 }
|
|
|
Get the center of the hill.
Definition at line 362 of file colvarbias_meta.h. 00363 {
00364 return centers;
00365 }
|
|
|
Get the energy using another hill weight.
Definition at line 332 of file colvarbias_meta.h. 00333 {
00334 return new_weight * sW * hill_value;
00335 }
|
|
|
Get the energy.
Definition at line 326 of file colvarbias_meta.h.
|
|
|
Represent the hill ina string suitable for a trajectory file.
Definition at line 1612 of file colvarbias_meta.C. References centers, it, W, and widths. 01613 {
01614 std::ostringstream os;
01615 os.setf (std::ios::fixed, std::ios::floatfield);
01616 os << std::setw (cvm::it_width) << it << " ";
01617
01618 os.setf (std::ios::scientific, std::ios::floatfield);
01619
01620 os << " ";
01621 for (size_t i = 0; i < centers.size(); i++) {
01622 os << " ";
01623 os << std::setprecision (cvm::cv_prec)
01624 << std::setw (cvm::cv_width) << centers[i];
01625 }
01626
01627 os << " ";
01628 for (size_t i = 0; i < widths.size(); i++) {
01629 os << " ";
01630 os << std::setprecision (cvm::cv_prec)
01631 << std::setw (cvm::cv_width) << widths[i];
01632 }
01633
01634 os << " ";
01635 os << std::setprecision (cvm::en_prec)
01636 << std::setw (cvm::en_width) << W << "\n";
01637
01638 return os.str();
01639 }
|
|
|
Scale the weight with this factor (by default 1.0 is used).
Definition at line 356 of file colvarbias_meta.h. 00357 {
00358 sW = new_scale_fac;
00359 }
|
|
|
Set the hill value as specified.
Definition at line 344 of file colvarbias_meta.h. 00345 {
00346 hill_value = new_value;
00347 }
|
|
|
Get the current hill value.
Definition at line 338 of file colvarbias_meta.h. 00339 {
00340 return hill_value;
00341 }
|
|
|
Get the weight.
Definition at line 350 of file colvarbias_meta.h. 00351 {
00352 return W * sW;
00353 }
|
|
|
Definition at line 255 of file colvarbias_meta.h. |
|
||||||||||||
|
Comparison operator.
Definition at line 374 of file colvarbias_meta.h. 00375 {
00376 if (h1.it < h2.it) return true;
00377 else return false;
00378 }
|
|
||||||||||||
|
Write the hill to an output stream.
Definition at line 1642 of file colvarbias_meta.C. 01643 {
01644 os.setf (std::ios::scientific, std::ios::floatfield);
01645
01646 os << "hill {\n";
01647 os << " step " << std::setw (cvm::it_width) << h.it << "\n";
01648 os << " weight "
01649 << std::setprecision (cvm::en_prec)
01650 << std::setw (cvm::en_width)
01651 << h.W << "\n";
01652
01653 if (h.replica.size())
01654 os << " replicaID " << h.replica << "\n";
01655
01656 os << " centers ";
01657 for (size_t i = 0; i < (h.centers).size(); i++) {
01658 os << " "
01659 << std::setprecision (cvm::cv_prec)
01660 << std::setw (cvm::cv_width)
01661 << h.centers[i];
01662 }
01663 os << "\n";
01664
01665 os << " widths ";
01666 for (size_t i = 0; i < (h.widths).size(); i++) {
01667 os << " "
01668 << std::setprecision (cvm::cv_prec)
01669 << std::setw (cvm::cv_width)
01670 << h.widths[i];
01671 }
01672 os << "\n";
01673
01674 os << "}\n";
01675
01676 return os;
01677 }
|
|
||||||||||||
|
Comparison operator.
Definition at line 381 of file colvarbias_meta.h. 00382 {
00383 if (h1.it <= h2.it) return true;
00384 else return false;
00385 }
|
|
||||||||||||
|
Comparison operator.
Definition at line 402 of file colvarbias_meta.h. 00403 {
00404 if ( (h1.it >= h2.it) && (h1.replica == h2.replica) ) return true;
00405 else return false;
00406 }
|
|
||||||||||||
|
Comparison operator.
Definition at line 388 of file colvarbias_meta.h. 00389 {
00390 if (h1.it > h2.it) return true;
00391 else return false;
00392 }
|
|
||||||||||||
|
Comparison operator.
Definition at line 395 of file colvarbias_meta.h. 00396 {
00397 if (h1.it >= h2.it) return true;
00398 else return false;
00399 }
|
|
|
Center of the hill in the collective variable space.
Definition at line 248 of file colvarbias_meta.h. Referenced by colvarbias_meta::create_hill(), operator<<(), and output_traj(). |
|
|
Value of the hill function (ranges between 0 and 1).
Definition at line 239 of file colvarbias_meta.h. |
|
|
Time step at which this hill was added.
Definition at line 258 of file colvarbias_meta.h. Referenced by operator<<(), and output_traj(). |
|
|
Identity of the replica who added this hill (only in multiple replica simulations).
Definition at line 261 of file colvarbias_meta.h. Referenced by operator<<(). |
|
|
Scale factor, which could be modified at runtime (default: 1).
Definition at line 242 of file colvarbias_meta.h. |
|
|
Maximum height in energy of the hill.
Definition at line 245 of file colvarbias_meta.h. Referenced by operator<<(), and output_traj(). |
|
|
Widths of the hill in the collective variable space.
Definition at line 251 of file colvarbias_meta.h. Referenced by operator<<(), and output_traj(). |
1.3.9.1