Collective Variables Module - Developer Documentation
colvarbias_alb.h
1 // -*- c++ -*-
2 
3 #ifndef COLVARBIAS_ALB_H
4 #define COLVARBIAS_ALB_H
5 
6 #include "colvar.h"
7 #include "colvarbias.h"
8 
9 
10 class colvarbias_alb : public colvarbias {
11 
12 public:
13 
14  colvarbias_alb(char const *key);
15  virtual ~colvarbias_alb();
16  virtual int init(std::string const &conf);
17  virtual int update();
18 
19  virtual std::string const get_state_params() const;
20  virtual int set_state_params(std::string const &conf);
21  virtual std::ostream & write_traj_label(std::ostream &os);
22  virtual std::ostream & write_traj(std::ostream &os);
23 
24 protected:
25 
27  std::vector<colvarvalue> colvar_centers;
28 
30  std::vector<cvm::real> means;
31  std::vector<cvm::real> ssd; // SSD = sum of squares of differences from mean
32  int update_calls;
33 
36 
38  std::vector<cvm::real> max_coupling_range;
39 
40  //\brief Estimated max for how quickly the rate can change in kT / time
41  std::vector<cvm::real> max_coupling_rate;
42 
44  std::vector<cvm::real> coupling_accum;
45 
47  std::vector<cvm::real> set_coupling;
48 
50  std::vector<cvm::real> current_coupling;
51 
53  std::vector<cvm::real> coupling_rate;
54 
55  // \brief if we're equilibrating our estimates or collecting data
56  bool b_equilibration;
57 
58  // \brief If the coupling range should be increased
59  bool b_hard_coupling_range;
60 
61 
64 
67 
70 
71  cvm::real restraint_potential(cvm::real k, const colvar* x, const colvarvalue& xcenter) const;
72 
74  colvarvalue restraint_force(cvm::real k, const colvar* x, const colvarvalue& xcenter) const;
75 
77  cvm::real restraint_convert_k(cvm::real k, cvm::real dist_measure) const;
78 
79 };
80 
81 #endif
int update_freq
how often to update coupling constant
Definition: colvarbias_alb.h:35
virtual std::ostream & write_traj(std::ostream &os)
Output quantities such as the bias energy to the trajectory file.
Definition: colvarbias_alb.cpp:354
std::vector< cvm::real > current_coupling
current coupling constant, which is ramped up during equilibration to coupling
Definition: colvarbias_alb.h:50
bool b_output_grad
flag for outputting current gradient
Definition: colvarbias_alb.h:66
std::vector< cvm::real > coupling_accum
accumated couping force; used in stochastic online gradient descent algorithm
Definition: colvarbias_alb.h:44
virtual std::ostream & write_traj_label(std::ostream &os)
Write a label to the trajectory file (comment line)
Definition: colvarbias_alb.cpp:322
bool b_output_coupling
flag for outputting coupling constant
Definition: colvarbias_alb.h:69
double real
Defining an abstract real number allows to switch precision.
Definition: colvarmodule.h:76
colvarvalue restraint_force(cvm::real k, const colvar *x, const colvarvalue &xcenter) const
Force function.
Definition: colvarbias_alb.cpp:398
Collective variable bias, base class.
Definition: colvarbias.h:12
std::vector< cvm::real > coupling_rate
how quickly to change the coupling constant
Definition: colvarbias_alb.h:53
Value of a collective variable: this is a metatype which can be set at runtime. By default it is set ...
Definition: colvarvalue.h:34
std::vector< colvarvalue > colvar_centers
Restraint centers.
Definition: colvarbias_alb.h:27
virtual int update()
Definition: colvarbias_alb.cpp:130
std::vector< cvm::real > set_coupling
coupling constant
Definition: colvarbias_alb.h:47
std::vector< cvm::real > means
colvar parameters, used for calculating the gradient/variance
Definition: colvarbias_alb.h:30
A collective variable (main class); to be defined, it needs at least one object of a derived class of...
Definition: colvar.h:42
virtual int set_state_params(std::string const &conf)
Read the values of specific mutable properties from a string.
Definition: colvarbias_alb.cpp:238
std::vector< cvm::real > max_coupling_range
Estimated range of coupling constant values in kT.
Definition: colvarbias_alb.h:38
virtual std::string const get_state_params() const
Write the values of specific mutable properties to a string.
Definition: colvarbias_alb.cpp:273
bool b_output_centers
flag for outputting colvar centers
Definition: colvarbias_alb.h:63
void init()
Set the object ready to parse a new configuration string.
Definition: colvarparse.h:61
cvm::real restraint_convert_k(cvm::real k, cvm::real dist_measure) const
Unit scaling.
Definition: colvarbias_alb.cpp:406
Definition: colvarbias_alb.h:10