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

colvarbias_reweightaMD Class Reference

Reweighted histogram for accelerated molecular dynamics (aMD) or Gaussian aMD (GaMD). More...

#include <colvarbias_histogram_reweight_amd.h>

Inheritance diagram for colvarbias_reweightaMD:

colvarbias_histogram colvarbias colvarparse colvardeps colvarparams List of all members.

Public Methods

 colvarbias_reweightaMD (char const *key)
virtual ~colvarbias_reweightaMD ()
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...

void hist_to_pmf (colvar_grid_scalar *hist, const colvar_grid_scalar *hist_count) const
 @brief convert histogram to PMF by taking logarithm and multiplying it with -1/beta
am[in,out] hist the origin histogram and also the output PMF @param[in] hist_count the sampling or biased
histogram.
More...


void compute_cumulant_expansion_factor (const colvar_grid_scalar *hist_dV, const colvar_grid_scalar *hist_dV_square, const colvar_grid_scalar *hist_count, colvar_grid_scalar *cumulant_expansion_factor) const
 @brief calculate the cumulant expansion to second order
am[in] hist_dV the histogram of the boosting potential, ΔV(ξ) @param[in] hist_dV_square the histogram of the square of boosting potential @param[in] hist_count the sampling or biased histogram @param[out] cumulant_expansion_factor the factor of the cumulant expansion to second
order.
More...


virtual int write_exponential_reweighted_pmf (const std::string &p_output_prefix, bool keep_open=false)
 @brief output the PMF by the exponential average estimator
am[in] p_output_prefix the prefix of the output file @param[in] keep_open Allow writing the history of the
PMF.
More...


virtual int write_cumulant_expansion_pmf (const std::string &p_output_prefix, bool keep_open=false)
 @brief output the PMF by the cumulant expansion estimator
am[in] p_output_prefix the prefix of the output file @param[in] keep_open Allow writing the history of the
expansion.
More...


virtual int write_count (const std::string &p_output_prefix, bool keep_open=false)
 @brief output the biased sampling
am[in] p_output_prefix the prefix of the output file @param[in] keep_open Allow writing the history of the
samples.
More...



Protected Methods

virtual std::istream & read_state_data (std::istream &is)
 save and restore. More...

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


Protected Attributes

std::vector< int > previous_bin
 Current accelMD factor is the from previous frame. More...

colvarmodule::step_number start_after_steps
 Start collecting samples after N steps. More...

bool b_use_cumulant_expansion
 Use cumulant expansion to second order? More...

colvar_grid_scalargrid_count
colvar_grid_scalargrid_dV
colvar_grid_scalargrid_dV_square
size_t history_freq
 Number of timesteps between recording data in history files (if non-zero). More...

bool b_history_files
bool b_write_gradients
 Write gradients of the PMF? More...


Detailed Description

Reweighted histogram for accelerated molecular dynamics (aMD) or Gaussian aMD (GaMD).

Definition at line 17 of file colvarbias_histogram_reweight_amd.h.


Constructor & Destructor Documentation

colvarbias_reweightaMD::colvarbias_reweightaMD char const *    key
 

Definition at line 13 of file colvarbias_histogram_reweight_amd.C.

References NULL.

colvarbias_reweightaMD::~colvarbias_reweightaMD   [virtual]
 

Definition at line 20 of file colvarbias_histogram_reweight_amd.C.

References grid_count, grid_dV, grid_dV_square, and NULL.


Member Function Documentation

void colvarbias_reweightaMD::compute_cumulant_expansion_factor const colvar_grid_scalar   hist_dV,
const colvar_grid_scalar   hist_dV_square,
const colvar_grid_scalar   hist_count,
colvar_grid_scalar   cumulant_expansion_factor
const
 

@brief calculate the cumulant expansion to second order

am[in] hist_dV the histogram of the boosting potential, ΔV(ξ) @param[in] hist_dV_square the histogram of the square of boosting potential @param[in] hist_count the sampling or biased histogram @param[out] cumulant_expansion_factor the factor of the cumulant expansion to second
order.

Definition at line 326 of file colvarbias_histogram_reweight_amd.C.

References colvarproxy_system::boltzmann, colvarmodule::exp, colvarmodule::main, colvarmodule::proxy, colvar_grid< cvm::real >::raw_data_num, colvar_grid< cvm::real >::set_value, colvarproxy_system::target_temperature, and colvar_grid< cvm::real >::value.

Referenced by write_cumulant_expansion_pmf.

void colvarbias_reweightaMD::hist_to_pmf colvar_grid_scalar   hist,
const colvar_grid_scalar   hist_count
const
 

@brief convert histogram to PMF by taking logarithm and multiplying it with -1/beta

am[in,out] hist the origin histogram and also the output PMF @param[in] hist_count the sampling or biased
histogram.

Definition at line 275 of file colvarbias_histogram_reweight_amd.C.

References colvarproxy_system::boltzmann, colvarmodule::logn, colvarmodule::main, colvarmodule::proxy, colvar_grid< cvm::real >::raw_data_num, colvar_grid< cvm::real >::set_value, colvarproxy_system::target_temperature, and colvar_grid< cvm::real >::value.

Referenced by write_cumulant_expansion_pmf, and write_exponential_reweighted_pmf.

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

\brief Parse config string and (re)initialize.

Reimplemented from colvarbias_histogram.

Definition at line 51 of file colvarbias_histogram_reweight_amd.C.

References b_history_files, b_use_cumulant_expansion, b_write_gradients, colvarmodule::cite_feature, colvarbias::colvars, COLVARS_INPUT_ERROR, conf, colvarmodule::error, colvarparse::get_keyval, colvarbias_histogram::grid, grid_count, grid_dV, grid_dV_square, history_freq, colvarbias_histogram::init, colvarmodule::main, colvarbias::num_variables, previous_bin, colvar_grid< cvm::real >::request_actual_value, and start_after_steps.

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

save and restore.

Reimplemented from colvarbias_histogram.

Definition at line 362 of file colvarbias_histogram_reweight_amd.C.

References colvarbias_histogram::grid, grid_count, grid_dV, grid_dV_square, colvar_grid< cvm::real >::read_raw, and colvarbias::read_state_data_key.

int colvarbias_reweightaMD::update   [virtual]
 

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

Reimplemented from colvarbias_histogram.

Definition at line 83 of file colvarbias_histogram_reweight_amd.C.

References colvar_grid_scalar::acc_value, colvarbias_histogram::bin, colvarproxy_system::boltzmann, colvarbias_histogram::colvar_array_size, colvar_grid< cvm::real >::current_bin_scalar, colvarmodule::debug, colvarmodule::get_error, colvarbias_histogram::grid, grid_count, grid_dV, grid_dV_square, colvar_grid< cvm::real >::index_ok, colvarmodule::log, colvarmodule::logn, colvarmodule::main, colvarbias::num_variables, previous_bin, colvarmodule::proxy, start_after_steps, colvarmodule::step_relative, colvarproxy_system::target_temperature, and colvarbias::update.

int colvarbias_reweightaMD::write_count const std::string   p_output_prefix,
bool    keep_open = false
[virtual]
 

@brief output the biased sampling

am[in] p_output_prefix the prefix of the output file @param[in] keep_open Allow writing the history of the
samples.

Definition at line 261 of file colvarbias_histogram_reweight_amd.C.

References COLVARS_FILE_ERROR, grid_count, colvarmodule::log, and colvar_grid_scalar::write_multicol.

Referenced by write_output_files.

int colvarbias_reweightaMD::write_cumulant_expansion_pmf const std::string   p_output_prefix,
bool    keep_open = false
[virtual]
 

@brief output the PMF by the cumulant expansion estimator

am[in] p_output_prefix the prefix of the output file @param[in] keep_open Allow writing the history of the
expansion.

Definition at line 225 of file colvarbias_histogram_reweight_amd.C.

References COLVARS_FILE_ERROR, compute_cumulant_expansion_factor, colvar_grid_scalar::gradient_finite_diff, grid_count, grid_dV, grid_dV_square, hist_to_pmf, colvar_grid< cvm::real >::incr, colvar_grid< cvm::real >::index_ok, colvarmodule::log, colvar_grid< cvm::real >::multiplicity, n, colvar_grid< cvm::real >::new_index, colvar_grid< cvm::real >::set_value, colvar_grid_gradient::write_multicol, and colvar_grid_scalar::write_multicol.

Referenced by write_output_files.

int colvarbias_reweightaMD::write_exponential_reweighted_pmf const std::string   p_output_prefix,
bool    keep_open = false
[virtual]
 

@brief output the PMF by the exponential average estimator

am[in] p_output_prefix the prefix of the output file @param[in] keep_open Allow writing the history of the
PMF.

Definition at line 177 of file colvarbias_histogram_reweight_amd.C.

References COLVARS_FILE_ERROR, colvar_grid< cvm::real >::copy_grid, colvar_grid_scalar::gradient_finite_diff, colvarbias_histogram::grid, grid_count, hist_to_pmf, colvar_grid< cvm::real >::incr, colvar_grid< cvm::real >::index_ok, colvarmodule::log, colvar_grid< cvm::real >::multiplicity, n, colvar_grid< cvm::real >::new_index, colvar_grid< cvm::real >::raw_data_num, colvar_grid< cvm::real >::set_value, colvar_grid< cvm::real >::value, colvar_grid_gradient::write_multicol, and colvar_grid_scalar::write_multicol.

Referenced by write_output_files.

int colvarbias_reweightaMD::write_output_files   [virtual]
 

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

Reimplemented from colvarbias_histogram.

Definition at line 147 of file colvarbias_histogram_reweight_amd.C.

References b_history_files, colvarmodule::get_error, history_freq, colvarbias::name, colvarmodule::output_prefix, colvarmodule::step_absolute, write_count, write_cumulant_expansion_pmf, and write_exponential_reweighted_pmf.

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

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

Reimplemented from colvarbias_histogram.

Definition at line 346 of file colvarbias_histogram_reweight_amd.C.

References colvarbias_histogram::grid, grid_count, grid_dV, grid_dV_square, and colvar_grid< cvm::real >::write_raw.


Member Data Documentation

bool colvarbias_reweightaMD::b_history_files [protected]
 

Definition at line 83 of file colvarbias_histogram_reweight_amd.h.

Referenced by init, and write_output_files.

bool colvarbias_reweightaMD::b_use_cumulant_expansion [protected]
 

Use cumulant expansion to second order?

Definition at line 76 of file colvarbias_histogram_reweight_amd.h.

Referenced by init.

bool colvarbias_reweightaMD::b_write_gradients [protected]
 

Write gradients of the PMF?

Definition at line 86 of file colvarbias_histogram_reweight_amd.h.

Referenced by init.

colvar_grid_scalar* colvarbias_reweightaMD::grid_count [protected]
 

Definition at line 77 of file colvarbias_histogram_reweight_amd.h.

Referenced by init, read_state_data, update, write_count, write_cumulant_expansion_pmf, write_exponential_reweighted_pmf, write_state_data, and ~colvarbias_reweightaMD.

colvar_grid_scalar* colvarbias_reweightaMD::grid_dV [protected]
 

Definition at line 78 of file colvarbias_histogram_reweight_amd.h.

Referenced by init, read_state_data, update, write_cumulant_expansion_pmf, write_state_data, and ~colvarbias_reweightaMD.

colvar_grid_scalar* colvarbias_reweightaMD::grid_dV_square [protected]
 

Definition at line 79 of file colvarbias_histogram_reweight_amd.h.

Referenced by init, read_state_data, update, write_cumulant_expansion_pmf, write_state_data, and ~colvarbias_reweightaMD.

size_t colvarbias_reweightaMD::history_freq [protected]
 

Number of timesteps between recording data in history files (if non-zero).

Definition at line 82 of file colvarbias_histogram_reweight_amd.h.

Referenced by init, and write_output_files.

std::vector<int> colvarbias_reweightaMD::previous_bin [protected]
 

Current accelMD factor is the from previous frame.

Definition at line 71 of file colvarbias_histogram_reweight_amd.h.

Referenced by init, and update.

colvarmodule::step_number colvarbias_reweightaMD::start_after_steps [protected]
 

Start collecting samples after N steps.

Definition at line 73 of file colvarbias_histogram_reweight_amd.h.

Referenced by init, and update.


The documentation for this class was generated from the following files:
Generated on Wed Dec 4 02:45:53 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002