Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

colvarbias_histogram Class Reference

Histogram "bias" (does as the name says). More...

#include <colvarbias_histogram.h>

Inheritance diagram for colvarbias_histogram:

colvarbias colvarparse colvardeps colvarparams colvarbias_reweightaMD List of all members.

Public Methods

 colvarbias_histogram (char const *key)
 ~colvarbias_histogram ()
virtual int init (std::string const &conf)
 \brief Parse config string and (re)initialize. More...

virtual int update ()
 Retrieve colvar values and calculate their biasing forces Some implementations may use calc_energy() and calc_forces(). More...

virtual int write_output_files ()
 Write any output files that this bias may have (e.g. PMF files). More...


Protected Methods

virtual std::istream & read_state_data (std::istream &is)
 Read all mutable data not already set by set_state_params(). More...

virtual std::ostream & write_state_data (std::ostream &os)
 Write all mutable data not already written by get_state_params(). More...


Protected Attributes

colvar_grid_scalargrid
 n-dim histogram. More...

std::vector< int > bin
std::string out_name
std::string out_name_dx
size_t colvar_array_size
 If one or more of the variables are colvarvalue::type_vector, treat them as arrays of this length. More...

std::vector< cvm::realweights
 If colvar_array_size is larger than 1, weigh each one by this number before accumulating the histogram. More...


Detailed Description

Histogram "bias" (does as the name says).

Definition at line 22 of file colvarbias_histogram.h.


Constructor & Destructor Documentation

colvarbias_histogram::colvarbias_histogram char const *    key
 

Definition at line 16 of file colvarbias_histogram.C.

References colvardeps::f_cvb_bypass_ext_lagrangian, NULL, and colvardeps::provide.

colvarbias_histogram::~colvarbias_histogram  
 

Definition at line 106 of file colvarbias_histogram.C.

References grid, and NULL.


Member Function Documentation

int colvarbias_histogram::init std::string const &    conf [virtual]
 

\brief Parse config string and (re)initialize.

Reimplemented from colvarbias.

Reimplemented in colvarbias_reweightaMD.

Definition at line 24 of file colvarbias_histogram.C.

References colvarparse::check_keywords, colvarmodule::cite_feature, colvar_array_size, colvarbias::colvars, COLVARS_INPUT_ERROR, conf, colvardeps::enable, colvarmodule::error, colvardeps::f_cv_grid, colvardeps::f_cvb_bypass_ext_lagrangian, colvardeps::f_cvb_history_dependent, colvardeps::f_cvb_scalar_variables, colvarparse::get_keyval, grid, colvarbias::init, colvar_grid< cvm::real >::init_from_colvars, colvardeps::is_enabled, colvarparse::key_lookup, colvarmodule::main, colvarbias::num_variables, out_name, out_name_dx, colvar_grid< cvm::real >::parse_params, colvar_grid< cvm::real >::request_actual_value, colvarvalue::type_scalar, colvarvalue::type_vector, and weights.

Referenced by colvarbias_reweightaMD::init.

std::istream & colvarbias_histogram::read_state_data std::istream &    is [protected, virtual]
 

Read all mutable data not already set by set_state_params().

Reimplemented from colvarbias.

Reimplemented in colvarbias_reweightaMD.

Definition at line 198 of file colvarbias_histogram.C.

References grid, colvar_grid< cvm::real >::read_raw, and colvarbias::read_state_data_key.

int colvarbias_histogram::update   [virtual]
 

Retrieve colvar values and calculate their biasing forces Some implementations may use calc_energy() and calc_forces().

Reimplemented from colvarbias.

Reimplemented in colvarbias_reweightaMD.

Definition at line 115 of file colvarbias_histogram.C.

References colvar_grid_scalar::acc_value, bin, colvarbias::can_accumulate_data, colvar_array_size, colvar_grid< cvm::real >::current_bin_scalar, colvarmodule::debug, colvarmodule::get_error, grid, colvar_grid< cvm::real >::index_ok, colvarmodule::log, colvarbias::name, colvarbias::num_variables, out_name, out_name_dx, colvarmodule::output_prefix, colvarmodule::step_relative, colvarbias::update, and weights.

int colvarbias_histogram::write_output_files   [virtual]
 

Write any output files that this bias may have (e.g. PMF files).

Reimplemented from colvarbias.

Reimplemented in colvarbias_reweightaMD.

Definition at line 175 of file colvarbias_histogram.C.

References grid, colvarbias::has_data, colvarmodule::log, out_name, out_name_dx, colvar_grid_scalar::write_multicol, and colvar_grid_scalar::write_opendx.

std::ostream & colvarbias_histogram::write_state_data std::ostream &    os [protected, virtual]
 

Write all mutable data not already written by get_state_params().

Reimplemented from colvarbias.

Reimplemented in colvarbias_reweightaMD.

Definition at line 211 of file colvarbias_histogram.C.

References grid, and colvar_grid< cvm::real >::write_raw.


Member Data Documentation

std::vector<int> colvarbias_histogram::bin [protected]
 

Definition at line 36 of file colvarbias_histogram.h.

Referenced by colvarbias_reweightaMD::update, and update.

size_t colvarbias_histogram::colvar_array_size [protected]
 

If one or more of the variables are colvarvalue::type_vector, treat them as arrays of this length.

Definition at line 40 of file colvarbias_histogram.h.

Referenced by init, colvarbias_reweightaMD::update, and update.

colvar_grid_scalar* colvarbias_histogram::grid [protected]
 

n-dim histogram.

Definition at line 35 of file colvarbias_histogram.h.

Referenced by colvarbias_reweightaMD::init, init, colvarbias_reweightaMD::read_state_data, read_state_data, colvarbias_reweightaMD::update, update, colvarbias_reweightaMD::write_exponential_reweighted_pmf, write_output_files, colvarbias_reweightaMD::write_state_data, write_state_data, and ~colvarbias_histogram.

std::string colvarbias_histogram::out_name [protected]
 

Definition at line 37 of file colvarbias_histogram.h.

Referenced by init, update, and write_output_files.

std::string colvarbias_histogram::out_name_dx [protected]
 

Definition at line 37 of file colvarbias_histogram.h.

Referenced by init, update, and write_output_files.

std::vector<cvm::real> colvarbias_histogram::weights [protected]
 

If colvar_array_size is larger than 1, weigh each one by this number before accumulating the histogram.

Definition at line 42 of file colvarbias_histogram.h.

Referenced by init, and update.


The documentation for this class was generated from the following files:
Generated on Sat Apr 20 02:44:56 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002