version 1.14 | version 1.15 |
---|
| |
/// -*- c++ -*- | // -*- c++ -*- |
| |
#ifndef COLVARBIAS_H | #ifndef COLVARBIAS_H |
#define COLVARBIAS_H | #define COLVARBIAS_H |
| |
#include "colvar.h" | #include "colvar.h" |
#include "colvarparse.h" | #include "colvarparse.h" |
| #include "colvardeps.h" |
| |
| |
/// \brief Collective variable bias, base class | /// \brief Collective variable bias, base class |
class colvarbias : public colvarparse { | class colvarbias : public colvarparse, public colvardeps { |
public: | public: |
| |
/// Name of this bias | /// Name of this bias |
std::string name; | std::string name; |
| |
| /// Type of this bias |
| std::string bias_type; |
| |
| /// If there is more than one bias of this type, record its rank |
| int rank; |
| |
/// Add a new collective variable to this bias | /// Add a new collective variable to this bias |
void add_colvar(std::string const &cv_name); | int add_colvar(std::string const &cv_name); |
| |
/// Retrieve colvar values and calculate their biasing forces | /// Retrieve colvar values and calculate their biasing forces |
/// Return bias energy | /// Return bias energy |
virtual cvm::real update(); | virtual int update(); |
| |
// TODO: move update_bias here (share with metadynamics) | // TODO: move update_bias here (share with metadynamics) |
| |
| |
void communicate_forces(); | void communicate_forces(); |
| |
/// \brief Constructor | /// \brief Constructor |
colvarbias(std::string const &conf, char const *key); | colvarbias(char const *key); |
| |
| /// \brief Parse config string and (re)initialize |
| virtual int init(std::string const &conf); |
| |
| /// \brief Set to zero all mutable data |
| virtual int reset(); |
| |
| protected: |
| |
/// Default constructor | /// Default constructor |
colvarbias(); | colvarbias(); |
| |
| private: |
| |
| /// Copy constructor |
| colvarbias(colvarbias &); |
| |
| public: |
| |
| /// \brief Delete everything |
| virtual int clear(); |
| |
/// Destructor | /// Destructor |
virtual ~colvarbias(); | virtual ~colvarbias(); |
| |
| |
inline cvm::real get_energy() { | inline cvm::real get_energy() { |
return bias_energy; | return bias_energy; |
} | } |
| |
| /// \brief Implementation of the feature list for colvarbias |
| static std::vector<feature *> cvb_features; |
| |
| /// \brief Implementation of the feature list accessor for colvarbias |
| virtual std::vector<feature *> &features() { |
| return cvb_features; |
| } |
protected: | protected: |
| |
/// \brief Pointers to collective variables to which the bias is | /// \brief Pointers to collective variables to which the bias is |
| |
bool b_output_energy; | bool b_output_energy; |
| |
/// \brief Whether this bias has already accumulated information | /// \brief Whether this bias has already accumulated information |
/// (when relevant) | /// (for history-dependent biases) |
bool has_data; | bool has_data; |
| |
}; | }; |