Collective Variables Module - Developer Documentation
Loading...
Searching...
No Matches
colvarbias_alb.h
1// -*- c++ -*-
2
3// This file is part of the Collective Variables module (Colvars).
4// The original version of Colvars and its updates are located at:
5// https://github.com/Colvars/colvars
6// Please update all Colvars source files before making any changes.
7// If you wish to distribute your changes, please submit them to the
8// Colvars repository at GitHub.
9
10#ifndef COLVARBIAS_ALB_H
11#define COLVARBIAS_ALB_H
12
13#include "colvar.h"
14#include "colvarbias.h"
15
16
17class colvarbias_alb : public colvarbias {
18
19public:
20 colvarbias_alb(colvarmodule *cvmodule_in, char const *key);
21 virtual ~colvarbias_alb();
22 virtual int init(std::string const &conf);
23 virtual int update();
24
25 virtual std::string const get_state_params() const;
26 virtual int set_state_params(std::string const &conf);
27 virtual std::ostream & write_traj_label(std::ostream &os);
28 virtual std::ostream & write_traj(std::ostream &os);
29
30protected:
31
33 std::vector<colvarvalue> colvar_centers;
34
36 std::vector<cvm::real> means;
37 std::vector<cvm::real> ssd; // SSD = sum of squares of differences from mean
38 int update_calls;
39
42
44 std::vector<cvm::real> max_coupling_range;
45
46 //\brief Estimated max for how quickly the rate can change in kT / time
47 std::vector<cvm::real> max_coupling_rate;
48
50 std::vector<cvm::real> coupling_accum;
51
53 std::vector<cvm::real> set_coupling;
54
56 std::vector<cvm::real> current_coupling;
57
59 std::vector<cvm::real> coupling_rate;
60
61 // \brief if we're equilibrating our estimates or collecting data
62 bool b_equilibration;
63
64 // \brief If the coupling range should be increased
65 bool b_hard_coupling_range;
66
67
70
73
76
77 cvm::real restraint_potential(cvm::real k, const colvar* x, const colvarvalue& xcenter) const;
78
80 colvarvalue restraint_force(cvm::real k, const colvar* x, const colvarvalue& xcenter) const;
81
83 cvm::real restraint_convert_k(cvm::real k, cvm::real dist_measure) const;
84
85};
86
87#endif
A collective variable (main class); to be defined, it needs at least one object of a derived class of...
Definition: colvar.h:53
Definition: colvarbias_alb.h:17
std::vector< cvm::real > current_coupling
current coupling constant, which is ramped up during equilibration to coupling
Definition: colvarbias_alb.h:56
std::vector< cvm::real > means
colvar parameters, used for calculating the gradient/variance
Definition: colvarbias_alb.h:36
std::vector< cvm::real > coupling_accum
accumated couping force; used in stochastic online gradient descent algorithm
Definition: colvarbias_alb.h:50
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias_alb.cpp:39
int update_freq
how often to update coupling constant
Definition: colvarbias_alb.h:41
std::vector< colvarvalue > colvar_centers
Restraint centers.
Definition: colvarbias_alb.h:33
bool b_output_grad
flag for outputting current gradient
Definition: colvarbias_alb.h:72
virtual int set_state_params(std::string const &conf)
Read the values of specific mutable properties from a string.
Definition: colvarbias_alb.cpp:272
virtual int update()
Definition: colvarbias_alb.cpp:162
virtual std::ostream & write_traj(std::ostream &os)
Output quantities such as the bias energy to the trajectory file.
Definition: colvarbias_alb.cpp:392
std::vector< cvm::real > coupling_rate
how quickly to change the coupling constant
Definition: colvarbias_alb.h:59
bool b_output_centers
flag for outputting colvar centers
Definition: colvarbias_alb.h:69
virtual std::ostream & write_traj_label(std::ostream &os)
Write a label to the trajectory file (comment line)
Definition: colvarbias_alb.cpp:360
colvarvalue restraint_force(cvm::real k, const colvar *x, const colvarvalue &xcenter) const
Force function.
Definition: colvarbias_alb.cpp:436
cvm::real restraint_convert_k(cvm::real k, cvm::real dist_measure) const
Unit scaling.
Definition: colvarbias_alb.cpp:444
std::vector< cvm::real > set_coupling
coupling constant
Definition: colvarbias_alb.h:53
std::vector< cvm::real > max_coupling_range
Estimated range of coupling constant values in kT.
Definition: colvarbias_alb.h:44
bool b_output_coupling
flag for outputting coupling constant
Definition: colvarbias_alb.h:75
virtual std::string const get_state_params() const
Write the values of specific mutable properties to a string.
Definition: colvarbias_alb.cpp:311
Collective variable bias, base class.
Definition: colvarbias.h:23
Collective variables module (main class)
Definition: colvarmodule.h:72
double real
Defining an abstract real number allows to switch precision.
Definition: colvarmodule.h:99
Value of a collective variable: this is a metatype which can be set at runtime. By default it is set ...
Definition: colvarvalue.h:43