00001 // -*- c++ -*- 00002 00003 // This file is part of the Collective Variables module (Colvars). 00004 // The original version of Colvars and its updates are located at: 00005 // https://github.com/Colvars/colvars 00006 // Please update all Colvars source files before making any changes. 00007 // If you wish to distribute your changes, please submit them to the 00008 // Colvars repository at GitHub. 00009 00010 #ifndef COLVARBIAS_ALB_H 00011 #define COLVARBIAS_ALB_H 00012 00013 #include "colvar.h" 00014 #include "colvarbias.h" 00015 00016 00017 class colvarbias_alb : public colvarbias { 00018 00019 public: 00020 00021 colvarbias_alb(char const *key); 00022 virtual ~colvarbias_alb(); 00023 virtual int init(std::string const &conf); 00024 virtual int update(); 00025 00026 virtual std::string const get_state_params() const; 00027 virtual int set_state_params(std::string const &conf); 00028 virtual std::ostream & write_traj_label(std::ostream &os); 00029 virtual std::ostream & write_traj(std::ostream &os); 00030 00031 protected: 00032 00034 std::vector<colvarvalue> colvar_centers; 00035 00037 std::vector<cvm::real> means; 00038 std::vector<cvm::real> ssd; // SSD = sum of squares of differences from mean 00039 int update_calls; 00040 00042 int update_freq; 00043 00045 std::vector<cvm::real> max_coupling_range; 00046 00047 //\brief Estimated max for how quickly the rate can change in kT / time 00048 std::vector<cvm::real> max_coupling_rate; 00049 00051 std::vector<cvm::real> coupling_accum; 00052 00054 std::vector<cvm::real> set_coupling; 00055 00057 std::vector<cvm::real> current_coupling; 00058 00060 std::vector<cvm::real> coupling_rate; 00061 00062 // \brief if we're equilibrating our estimates or collecting data 00063 bool b_equilibration; 00064 00065 // \brief If the coupling range should be increased 00066 bool b_hard_coupling_range; 00067 00068 00070 bool b_output_centers; 00071 00073 bool b_output_grad; 00074 00076 bool b_output_coupling; 00077 00078 cvm::real restraint_potential(cvm::real k, const colvar* x, const colvarvalue& xcenter) const; 00079 00081 colvarvalue restraint_force(cvm::real k, const colvar* x, const colvarvalue& xcenter) const; 00082 00084 cvm::real restraint_convert_k(cvm::real k, cvm::real dist_measure) const; 00085 00086 }; 00087 00088 #endif