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

colvarbias_meta Class Reference

Metadynamics bias (implementation of colvarbias). More...

#include <colvarbias_meta.h>

Inheritance diagram for colvarbias_meta:

colvarbias colvarbias_ti colvarparse colvardeps colvarbias colvarparams colvarparse colvardeps colvarparams List of all members.

Public Types

typedef std::list< hill
>::iterator 
hill_iter
enum  Communication { single_replica, multiple_replicas }
 Communication between different replicas. More...


Public Methods

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

virtual int init_replicas_params (std::string const &conf)
virtual int init_well_tempered_params (std::string const &conf)
virtual int init_ebmeta_params (std::string const &conf)
virtual int clear_state_data ()
 \brief Delete only the allocatable data (save memory). More...

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

virtual int update_grid_params ()
virtual int update_bias ()
virtual int update_grid_data ()
virtual int replica_share ()
virtual int calc_energy (std::vector< colvarvalue > const *values)
 Compute the energy of the bias Uses the vector of colvar values provided if not NULL, and the values currently cached in the bias instance otherwise. More...

virtual int calc_forces (std::vector< colvarvalue > const *values)
 Compute the forces due to the bias Uses the vector of colvar values provided if not NULL, and the values currently cached in the bias instance otherwise. More...

virtual std::string const get_state_params () const
 Write the values of specific mutable properties to a string. More...

virtual int set_state_params (std::string const &state_conf)
 Read the values of specific mutable properties from a string. More...

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

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

virtual int setup_output ()
 (Re)initialize the output files (does not write them yet). More...

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

virtual void write_pmf ()
virtual int write_state_to_replicas ()
 If this bias is communicating with other replicas through files, send it to them. More...


Public Attributes

Communication comm
 Communication between different replicas. More...


Protected Methods

std::string const hills_traj_file_name () const
 Name of the hill logfile. More...

void recount_hills_off_grid (hill_iter h_first, hill_iter h_last, colvar_grid_scalar *ge)
 Regenerate the hills_off_grid list. More...

std::istream & read_hill (std::istream &is)
 Read a hill from a file. More...

std::list< hill >::const_iterator add_hill (hill const &h)
 \brief Add a new hill; if a .hills trajectory is written, write it there; if there is more than one replica, communicate it to the others. More...

std::list< hill >::const_iterator delete_hill (hill_iter &h)
 \brief Remove a previously saved hill (returns an iterator for the next hill in the list). More...

virtual void calc_hills (hill_iter h_first, hill_iter h_last, cvm::real &energy, std::vector< colvarvalue > const *values)
 \brief Calculate the values of the hills, incrementing bias_energy. More...

virtual void calc_hills_force (size_t const &i, hill_iter h_first, hill_iter h_last, std::vector< colvarvalue > &forces, std::vector< colvarvalue > const *values)
 \brief Calculate the forces acting on the i-th colvar, incrementing colvar_forces[i]; must be called after calc_hills each time the values of the colvars are changed. More...

void project_hills (hill_iter h_first, hill_iter h_last, colvar_grid_scalar *ge, colvar_grid_gradient *gf, bool print_progress=false)
 \brief Project the selected hills onto grids. More...

virtual int update_replicas_registry ()
 \brief Read the existing replicas on registry. More...

virtual int read_replica_files ()
 \brief Read new data from replicas' files. More...

virtual int write_replica_state_file ()
 Write full state information to be read by other replicas. More...

virtual int reopen_replica_buffer_file ()
 Call this after write_replica_state_file(). More...


Protected Attributes

cvm::real hill_width
 Width of a hill in number of grid points The local width of each collective variable, multiplied by this number, provides the hill width along that direction. More...

std::vector< cvm::realcolvar_sigmas
 The sigma parameters of the Gaussian hills. More...

size_t new_hill_freq
 \brief Number of simulation steps between two hills. More...

bool b_hills_traj
 Write the hill logfile. More...

std::list< hillhills
 \brief List of hills used on this bias (total); if a grid is employed, these don't need to be updated at every time step. More...

hill_iter new_hills_begin
 \brief Iterator to the first of the "newest" hills (when using grids, those who haven't been mapped yet). More...

std::list< hillhills_off_grid
 \brief List of hills used on this bias that are on the boundary edges; these are updated regardless of whether hills are used. More...

hill_iter new_hills_off_grid_begin
 \brief Same as new_hills_begin, but for the off-grid ones. More...

cvm::real hill_weight
 Height of new hills. More...

bool use_grids
 \brief Bin the hills on grids of energy and forces, and use them to force the colvars (as opposed to deriving the hills analytically). More...

bool rebin_grids
 \brief Rebin the hills upon restarting. More...

bool expand_grids
 \brief Should the grids be expanded if necessary? More...

size_t grids_freq
 \brief How often the hills should be projected onto the grids. More...

bool keep_hills
 Keep hills in the restart file (e.g. to accurately rebin later). More...

bool restart_keep_hills
 value of keepHills saved in the most recent restart file. More...

bool dump_fes
 \brief Dump the free energy surface (.pmf file) every restartFrequency. More...

bool dump_replica_fes
 \brief Dump the free energy surface (.pmf file) every restartFrequency using only the hills from this replica (only applicable to more than one replica). More...

bool dump_fes_save
 \brief Dump the free energy surface files at different time steps, appending the step number to each file. More...

bool well_tempered
 \brief Whether to use well-tempered metadynamics. More...

cvm::real bias_temperature
 \brief Biasing temperature in well-tempered metadynamics. More...

bool ebmeta
 Ensemble-biased metadynamics (EBmeta) flag. More...

colvar_grid_scalartarget_dist
 Target distribution for EBmeta. More...

cvm::step_number ebmeta_equil_steps
 Number of equilibration steps for EBmeta. More...

bool safely_read_restart
 \brief Try to read the restart information by allocating new grids before replacing the current ones (used e.g. in multiple_replicas). More...

colvar_grid_scalarhills_energy
 Hill energy, cached on a grid. More...

colvar_grid_gradienthills_energy_gradients
 Hill forces, cached on a grid. More...

std::string replica_id
 \brief Identifier for this replica. More...

std::string replica_file_name
 \brief File containing the paths to the output files from this replica. More...

std::vector< colvarbias_meta * > replicas
 \brief Additional, "mirror" metadynamics biases, to collect info from the other replicas These are supposed to be synchronized by reading data from the other replicas, and not be modified by the "local" replica. More...

size_t replica_update_freq
 \brief Frequency at which data the "mirror" biases are updated. More...

std::string replicas_registry_file
 List of replicas (and their output list files): contents are copied into replicas_registry for convenience. More...

std::string replicas_registry
 List of replicas (and their output list files). More...

std::string replica_list_file
 List of files written by this replica. More...

std::string replica_state_file
 Hills energy and gradients written specifically for other replica (in addition to its own restart file). More...

bool replica_state_file_in_sync
 Whether a mirror bias has read the latest version of its state file. More...

size_t update_status
 If there was a failure reading one of the files (because they are not complete), this counter is incremented. More...

std::string replica_hills_file
 Explicit hills communicated between replicas This file becomes empty after replica_state_file is rewritten. More...

std::streampos replica_hills_file_pos
 Position within replica_hills_file (when reading it). More...


Detailed Description

Metadynamics bias (implementation of colvarbias).

Definition at line 21 of file colvarbias_meta.h.


Member Typedef Documentation

typedef std::list<hill>::iterator colvarbias_meta::hill_iter
 

Definition at line 69 of file colvarbias_meta.h.

Referenced by add_hill, calc_hills, calc_hills_force, delete_hill, project_hills, read_hill, read_state_data, and recount_hills_off_grid.


Member Enumeration Documentation

enum colvarbias_meta::Communication
 

Communication between different replicas.

Enumeration values:
single_replica  One replica (default).
multiple_replicas  Hills added concurrently by several replicas.

Definition at line 29 of file colvarbias_meta.h.


Constructor & Destructor Documentation

colvarbias_meta::colvarbias_meta char const *    key
 

Definition at line 35 of file colvarbias_meta.C.

References b_hills_traj, dump_fes, dump_fes_save, dump_replica_fes, ebmeta_equil_steps, grids_freq, hill_weight, hill_width, hills, hills_energy, hills_energy_gradients, keep_hills, new_hill_freq, new_hills_begin, NULL, rebin_grids, replica_id, replica_update_freq, restart_keep_hills, and use_grids.

Referenced by update_replicas_registry.

colvarbias_meta::~colvarbias_meta   [virtual]
 

Definition at line 332 of file colvarbias_meta.C.

References clear_state_data, colvarproxy_io::close_output_stream, hills_traj_file_name, colvarmodule::main, NULL, colvarmodule::proxy, replica_hills_file, and target_dist.


Member Function Documentation

std::list< colvarbias_meta::hill >::const_iterator colvarbias_meta::add_hill hill const &    h [protected]
 

\brief Add a new hill; if a .hills trajectory is written, write it there; if there is more than one replica, communicate it to the others.

Definition at line 372 of file colvarbias_meta.C.

References colvar_grid< cvm::real >::bin_distance_from_boundaries, colvarbias_meta::hill::centers, colvarmodule::floor, colvarbias::has_data, hill_iter, hill_width, hills, hills_energy, hills_off_grid, hills_traj_file_name, and new_hills_begin.

Referenced by update_bias.

int colvarbias_meta::calc_energy std::vector< colvarvalue > const *    values [virtual]
 

Compute the energy of the bias Uses the vector of colvar values provided if not NULL, and the values currently cached in the bias instance otherwise.

Reimplemented from colvarbias.

Definition at line 668 of file colvarbias_meta.C.

References colvarbias::bias_energy, calc_hills, comm, colvarmodule::debug, colvar_grid< cvm::real >::get_colvars_index, hills, hills_energy, hills_off_grid, colvar_grid< cvm::real >::index_ok, colvarmodule::log, new_hills_begin, replica_id, replicas, and single_replica.

Referenced by update.

int colvarbias_meta::calc_forces std::vector< colvarvalue > const *    values [virtual]
 

Compute the forces due to the bias Uses the vector of colvar values provided if not NULL, and the values currently cached in the bias instance otherwise.

Reimplemented from colvarbias.

Definition at line 720 of file colvarbias_meta.C.

References calc_hills_force, colvarbias::colvar_forces, comm, colvarmodule::debug, colvar_grid< cvm::real >::get_colvars_index, hills, hills_energy, hills_off_grid, colvar_grid< cvm::real >::index_ok, colvarmodule::log, new_hills_begin, colvarbias::num_variables, replica_id, replicas, and single_replica.

Referenced by update.

void colvarbias_meta::calc_hills hill_iter    h_first,
hill_iter    h_last,
cvm::real   energy,
std::vector< colvarvalue > const *    values
[protected, virtual]
 

\brief Calculate the values of the hills, incrementing bias_energy.

Definition at line 781 of file colvarbias_meta.C.

References colvarbias::colvar_values, hill_iter, colvarbias::num_variables, and colvarbias::variables.

Referenced by calc_energy, project_hills, and update_bias.

void colvarbias_meta::calc_hills_force size_t const &    i,
hill_iter    h_first,
hill_iter    h_last,
std::vector< colvarvalue > &    forces,
std::vector< colvarvalue > const *    values
[protected, virtual]
 

\brief Calculate the forces acting on the i-th colvar, incrementing colvar_forces[i]; must be called after calc_hills each time the values of the colvars are changed.

Definition at line 811 of file colvarbias_meta.C.

References colvarbias::colvar_values, hill_iter, colvarvalue::type, colvarvalue::type_3vector, colvarvalue::type_all, colvarvalue::type_notset, colvarvalue::type_quaternion, colvarvalue::type_quaternionderiv, colvarvalue::type_scalar, colvarvalue::type_unit3vector, colvarvalue::type_unit3vectorderiv, colvarvalue::type_vector, and colvarbias::variables.

Referenced by calc_forces, and project_hills.

int colvarbias_meta::clear_state_data   [virtual]
 

\brief Delete only the allocatable data (save memory).

Reimplemented from colvarbias.

Definition at line 348 of file colvarbias_meta.C.

References hills, hills_energy, hills_energy_gradients, hills_off_grid, and NULL.

Referenced by ~colvarbias_meta.

std::list< colvarbias_meta::hill >::const_iterator colvarbias_meta::delete_hill hill_iter   h [protected]
 

\brief Remove a previously saved hill (returns an iterator for the next hill in the list).

Definition at line 408 of file colvarbias_meta.C.

References comm, colvarmodule::debug, hill_iter, hills, hills_off_grid, hills_traj_file_name, colvarmodule::log, replica_id, single_replica, and use_grids.

std::string const colvarbias_meta::get_state_params   const [virtual]
 

Write the values of specific mutable properties to a string.

Reimplemented from colvarbias.

Definition at line 1747 of file colvarbias_meta.C.

References comm, colvarbias::get_state_params, replica_id, and single_replica.

std::string const colvarbias_meta::hills_traj_file_name   const [protected]
 

Name of the hill logfile.

Definition at line 1736 of file colvarbias_meta.C.

References comm, replica_id, single_replica, and string.

Referenced by add_hill, delete_hill, setup_output, and ~colvarbias_meta.

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

\brief Parse config string and (re)initialize.

Reimplemented from colvarbias.

Definition at line 66 of file colvarbias_meta.C.

References b_hills_traj, colvarmodule::cite_feature, colvar_sigmas, colvarbias::colvars, COLVARS_INPUT_ERROR, comm, conf, colvarmodule::debug, dump_fes, dump_fes_save, colvardeps::enable, colvarmodule::error, expand_grids, colvardeps::f_cv_grid, colvardeps::f_cvb_apply_force, colvardeps::f_cvb_calc_pmf, colvardeps::f_cvb_history_dependent, colvarparse::get_keyval, grids_freq, hill_weight, hill_width, hills_energy, hills_energy_gradients, colvarbias_ti::init, colvarbias::init, init_ebmeta_params, init_replicas_params, init_well_tempered_params, keep_hills, colvarmodule::log, colvarmodule::main, multiple_replicas, new_hill_freq, NULL, colvarbias::num_variables, rebin_grids, replica_id, single_replica, use_grids, and colvarbias::variables.

int colvarbias_meta::init_ebmeta_params std::string const &    conf [virtual]
 

Definition at line 268 of file colvarbias_meta.C.

References colvarmodule::cite_feature, colvarbias::colvars, COLVARS_INPUT_ERROR, conf, ebmeta, ebmeta_equil_steps, colvar_grid_scalar::entropy, colvarmodule::error, colvarmodule::exp, expand_grids, colvarparse::get_keyval, colvar_grid< cvm::real >::init_from_colvars, colvar_grid_scalar::integral, colvarmodule::log, colvarmodule::main, colvar_grid_scalar::maximum_value, colvar_grid_scalar::minimum_pos_value, colvar_grid_scalar::minimum_value, colvar_grid< cvm::real >::multiply_constant, NULL, colvar_grid_scalar::read_multicol, colvar_grid< cvm::real >::remove_small_values, target_dist, and use_grids.

Referenced by init.

int colvarbias_meta::init_replicas_params std::string const &    conf [virtual]
 

Definition at line 185 of file colvarbias_meta.C.

References COLVARS_INPUT_ERROR, comm, conf, dump_fes, dump_replica_fes, colvarmodule::error, colvarparse::get_keyval, colvarmodule::log, colvarmodule::main, colvarparse::parse_silent, colvarmodule::proxy, colvarproxy_replicas::replica_enabled, replica_id, colvarproxy_replicas::replica_index, replica_update_freq, replicas, replicas_registry_file, single_replica, and colvarmodule::to_str.

Referenced by init.

int colvarbias_meta::init_well_tempered_params std::string const &    conf [virtual]
 

Definition at line 251 of file colvarbias_meta.C.

References bias_temperature, COLVARS_INPUT_ERROR, conf, colvarmodule::error, colvarparse::get_keyval, colvarmodule::log, and well_tempered.

Referenced by init.

void colvarbias_meta::project_hills hill_iter    h_first,
hill_iter    h_last,
colvar_grid_scalar   ge,
colvar_grid_gradient   gf,
bool    print_progress = false
[protected]
 

\brief Project the selected hills onto grids.

Definition at line 886 of file colvarbias_meta.C.

References colvar_grid_gradient::acc_force, colvar_grid_scalar::acc_value, colvar_grid< cvm::real >::bin_to_value_scalar, calc_hills, calc_hills_force, COLVARS_BUG_ERROR, comm, colvarmodule::debug, colvarmodule::error, hill_iter, hills, colvar_grid< cvm::real >::incr, colvar_grid< cvm::real >::index_ok, keep_hills, colvarmodule::log, colvar_grid< cvm::real >::new_index, NULL, colvarbias::num_variables, colvar_grid< cvm::real >::number_of_points, colvarmodule::real, replica_id, and single_replica.

Referenced by read_state_data, update_grid_data, and write_state_data.

std::istream & colvarbias_meta::read_hill std::istream &    is [protected]
 

Read a hill from a file.

Definition at line 1531 of file colvarbias_meta.C.

References colvar_grid< cvm::real >::bin_distance_from_boundaries, COLVARS_INPUT_ERROR, comm, data, colvarmodule::debug, colvarmodule::error, colvarmodule::floor, colvarbias::has_data, hill_iter, hill_width, hills, hills_energy, hills_off_grid, colvarmodule::log, new_hills_begin, colvarbias::num_variables, replica_id, reset_istream, restart_keep_hills, single_replica, colvarbias::state_file_step, and colvarbias::variables.

Referenced by read_state_data.

int colvarbias_meta::read_replica_files   [protected, virtual]
 

\brief Read new data from replicas' files.

Definition at line 1135 of file colvarbias_meta.C.

References colvarmodule::debug, colvarmodule::log, new_hill_freq, replica_hills_file, replica_hills_file_pos, replica_state_file, replica_update_freq, and replicas.

Referenced by read_state_data, and replica_share.

std::istream & colvarbias_meta::read_state_data std::istream &    is [virtual]
 

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

Reimplemented from colvarbias.

Definition at line 1302 of file colvarbias_meta.C.

References colvarparse::clear, colvarbias::colvars, comm, colvarmodule::debug, colvarmodule::error, colvarbias::has_data, hill_iter, hills, hills_energy, hills_energy_gradients, hills_off_grid, colvarmodule::log, colvar_grid< cvm::real >::map_grid, new_hills_begin, NULL, project_hills, read_hill, read_replica_files, colvar_grid< cvm::real >::read_restart, colvarbias_ti::read_state_data, rebin_grids, recount_hills_off_grid, replica_id, restart_keep_hills, single_replica, string, and colvar_grid< cvm::real >::write_params.

void colvarbias_meta::recount_hills_off_grid hill_iter    h_first,
hill_iter    h_last,
colvar_grid_scalar   ge
[protected]
 

Regenerate the hills_off_grid list.

Definition at line 964 of file colvarbias_meta.C.

References colvar_grid< cvm::real >::bin_distance_from_boundaries, colvarmodule::floor, hill_iter, hill_width, hills_energy, and hills_off_grid.

Referenced by read_state_data.

int colvarbias_meta::reopen_replica_buffer_file   [protected, virtual]
 

Call this after write_replica_state_file().

Definition at line 1933 of file colvarbias_meta.C.

References colvarproxy_io::close_output_stream, COLVARS_FILE_ERROR, colvarproxy_io::output_stream, colvarproxy_io::remove_file, and replica_hills_file.

Referenced by setup_output, and write_state_to_replicas.

int colvarbias_meta::replica_share   [virtual]
 

Reimplemented from colvarbias.

Definition at line 985 of file colvarbias_meta.C.

References comm, colvarproxy_io::flush_output_stream, multiple_replicas, read_replica_files, replica_hills_file, and update_replicas_registry.

Referenced by update.

int colvarbias_meta::set_state_params std::string const &    state_conf [virtual]
 

Read the values of specific mutable properties from a string.

Reimplemented from colvarbias.

Definition at line 1264 of file colvarbias_meta.C.

References COLVARS_INPUT_ERROR, colvarmodule::error, colvarparse::get_keyval, colvarmodule::log, colvarmodule::main, colvarparse::parse_restart, replica_id, restart_keep_hills, colvarmodule::restart_version_number, and colvarbias::set_state_params.

int colvarbias_meta::setup_output   [virtual]
 

(Re)initialize the output files (does not write them yet).

Reimplemented from colvarbias.

Definition at line 1631 of file colvarbias_meta.C.

References COLVARS_BUG_ERROR, COLVARS_FILE_ERROR, comm, colvarmodule::error, colvardeps::f_cvb_calc_pmf, colvarmodule::get_error, GETCWD, hills_traj_file_name, colvarmodule::main, multiple_replicas, colvarbias::name, NULL, colvarmodule::num_biases_feature, colvarmodule::output_prefix, colvarbias::output_prefix, PATHSEP, reopen_replica_buffer_file, replica_hills_file, replica_id, replica_list_file, replica_state_file, replicas, replicas_registry_file, string, and write_replica_state_file.

int colvarbias_meta::update   [virtual]
 

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

Reimplemented from colvarbias.

Definition at line 443 of file colvarbias_meta.C.

References calc_energy, calc_forces, comm, NULL, replica_share, replica_update_freq, single_replica, colvarmodule::step_absolute, colvarbias_ti::update, colvarbias::update, update_bias, update_grid_data, and update_grid_params.

int colvarbias_meta::update_bias   [virtual]
 

Definition at line 578 of file colvarbias_meta.C.

References add_hill, bias_temperature, colvarproxy_system::boltzmann, calc_hills, colvarbias::can_accumulate_data, colvar_sigmas, colvarbias::colvar_values, COLVARS_FILE_ERROR, comm, colvarmodule::debug, ebmeta_equil_steps, colvarmodule::error, colvarmodule::exp, colvardeps::f_cvb_history_dependent, colvar_grid< cvm::real >::get_colvars_index, hill_weight, hills, hills_energy, colvardeps::is_enabled, colvarmodule::log, colvarmodule::main, multiple_replicas, new_hill_freq, new_hills_begin, NULL, colvarmodule::proxy, colvarmodule::real, replica_hills_file, replica_id, single_replica, colvarmodule::step_absolute, target_dist, and colvar_grid< cvm::real >::value.

Referenced by update.

int colvarbias_meta::update_grid_data   [virtual]
 

Definition at line 643 of file colvarbias_meta.C.

References comm, grids_freq, hills, hills_energy, hills_energy_gradients, multiple_replicas, new_hills_begin, project_hills, replicas, and colvarmodule::step_absolute.

Referenced by update.

int colvarbias_meta::update_grid_params   [virtual]
 

Definition at line 473 of file colvarbias_meta.C.

References comm, colvarmodule::debug, colvardeps::f_cv_hard_lower_boundary, colvardeps::f_cv_hard_upper_boundary, colvarmodule::floor, colvar_grid< cvm::real >::get_colvars_index, hill_width, hills_energy, hills_energy_gradients, colvarmodule::log, colvar_grid< cvm::real >::lower_boundaries, colvar_grid< cvm::real >::map_grid, colvarbias::num_variables, replica_id, colvar_grid< cvm::real >::setup, single_replica, colvar_grid< cvm::real >::sizes, colvar_grid< cvm::real >::upper_boundaries, and colvarbias::variables.

Referenced by update.

int colvarbias_meta::update_replicas_registry   [protected, virtual]
 

\brief Read the existing replicas on registry.

Definition at line 1001 of file colvarbias_meta.C.

References colvarbias::colvar_forces, colvarbias_meta, colvarbias::colvars, COLVARS_FILE_ERROR, comm, colvarmodule::debug, colvarmodule::error, colvardeps::f_cvb_calc_ti_samples, colvarparse::getline_nocomments, colvardeps::is_enabled, colvarmodule::log, multiple_replicas, colvarbias::name, replica_id, replica_list_file, replica_update_freq, replicas, replicas_registry, replicas_registry_file, single_replica, string, and use_grids.

Referenced by replica_share.

int colvarbias_meta::write_output_files   [virtual]
 

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

Reimplemented from colvarbias.

Definition at line 1813 of file colvarbias_meta.C.

References colvarbias_ti::write_output_files, and write_pmf.

void colvarbias_meta::write_pmf   [virtual]
 

Definition at line 1823 of file colvarbias_meta.C.

References colvar_grid< cvm::real >::add_constant, colvar_grid< cvm::real >::add_grid, bias_temperature, colvarproxy_system::boltzmann, comm, dump_fes_save, hills_energy, colvarmodule::logn, colvarmodule::main, colvar_grid_scalar::maximum_value, colvar_grid< cvm::real >::multiply_constant, colvar_grid< cvm::real >::number_of_points, colvarmodule::proxy, replicas, colvar_grid< cvm::real >::reset, colvar_grid< cvm::real >::set_value, colvar_grid< cvm::real >::setup, single_replica, target_dist, colvarproxy_system::target_temperature, colvar_grid< cvm::real >::value, and colvar_grid_scalar::write_multicol.

Referenced by write_output_files.

int colvarbias_meta::write_replica_state_file   [protected, virtual]
 

Write full state information to be read by other replicas.

Definition at line 1905 of file colvarbias_meta.C.

References colvarproxy_io::close_output_stream, COLVARS_FILE_ERROR, colvarmodule::debug, colvarmodule::error, colvarmodule::log, colvarbias::name, colvarproxy_io::output_stream, colvarproxy_io::remove_file, colvarproxy_io::rename_file, replica_state_file, and colvarbias::write_state.

Referenced by setup_output, and write_state_to_replicas.

std::ostream & colvarbias_meta::write_state_data std::ostream &    os [virtual]
 

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

Reimplemented from colvarbias.

Definition at line 1760 of file colvarbias_meta.C.

References hills, hills_energy, hills_energy_gradients, hills_off_grid, keep_hills, new_hills_begin, project_hills, use_grids, colvar_grid< cvm::real >::write_restart, and colvarbias_ti::write_state_data.

int colvarbias_meta::write_state_to_replicas   [virtual]
 

If this bias is communicating with other replicas through files, send it to them.

Reimplemented from colvarbias.

Definition at line 1798 of file colvarbias_meta.C.

References comm, reopen_replica_buffer_file, replicas, single_replica, and write_replica_state_file.


Member Data Documentation

bool colvarbias_meta::b_hills_traj [protected]
 

Write the hill logfile.

Definition at line 86 of file colvarbias_meta.h.

Referenced by colvarbias_meta, and init.

cvm::real colvarbias_meta::bias_temperature [protected]
 

\brief Biasing temperature in well-tempered metadynamics.

Definition at line 176 of file colvarbias_meta.h.

Referenced by init_well_tempered_params, update_bias, and write_pmf.

std::vector<cvm::real> colvarbias_meta::colvar_sigmas [protected]
 

The sigma parameters of the Gaussian hills.

Definition at line 80 of file colvarbias_meta.h.

Referenced by init, and update_bias.

Communication colvarbias_meta::comm
 

Communication between different replicas.

Definition at line 37 of file colvarbias_meta.h.

Referenced by calc_energy, calc_forces, delete_hill, get_state_params, hills_traj_file_name, init, init_replicas_params, project_hills, read_hill, read_state_data, replica_share, setup_output, update, update_bias, update_grid_data, update_grid_params, update_replicas_registry, write_pmf, and write_state_to_replicas.

bool colvarbias_meta::dump_fes [protected]
 

\brief Dump the free energy surface (.pmf file) every restartFrequency.

Definition at line 162 of file colvarbias_meta.h.

Referenced by colvarbias_meta, init, and init_replicas_params.

bool colvarbias_meta::dump_fes_save [protected]
 

\brief Dump the free energy surface files at different time steps, appending the step number to each file.

Definition at line 170 of file colvarbias_meta.h.

Referenced by colvarbias_meta, init, and write_pmf.

bool colvarbias_meta::dump_replica_fes [protected]
 

\brief Dump the free energy surface (.pmf file) every restartFrequency using only the hills from this replica (only applicable to more than one replica).

Definition at line 166 of file colvarbias_meta.h.

Referenced by colvarbias_meta, and init_replicas_params.

bool colvarbias_meta::ebmeta [protected]
 

Ensemble-biased metadynamics (EBmeta) flag.

Definition at line 179 of file colvarbias_meta.h.

Referenced by init_ebmeta_params.

cvm::step_number colvarbias_meta::ebmeta_equil_steps [protected]
 

Number of equilibration steps for EBmeta.

Definition at line 185 of file colvarbias_meta.h.

Referenced by colvarbias_meta, init_ebmeta_params, and update_bias.

bool colvarbias_meta::expand_grids [protected]
 

\brief Should the grids be expanded if necessary?

Definition at line 150 of file colvarbias_meta.h.

Referenced by init, and init_ebmeta_params.

size_t colvarbias_meta::grids_freq [protected]
 

\brief How often the hills should be projected onto the grids.

Definition at line 153 of file colvarbias_meta.h.

Referenced by colvarbias_meta, init, and update_grid_data.

cvm::real colvarbias_meta::hill_weight [protected]
 

Height of new hills.

Definition at line 140 of file colvarbias_meta.h.

Referenced by colvarbias_meta, init, and update_bias.

cvm::real colvarbias_meta::hill_width [protected]
 

Width of a hill in number of grid points The local width of each collective variable, multiplied by this number, provides the hill width along that direction.

Definition at line 77 of file colvarbias_meta.h.

Referenced by add_hill, colvarbias_meta, init, read_hill, recount_hills_off_grid, and update_grid_params.

std::list<hill> colvarbias_meta::hills [protected]
 

\brief List of hills used on this bias (total); if a grid is employed, these don't need to be updated at every time step.

Definition at line 93 of file colvarbias_meta.h.

Referenced by add_hill, calc_energy, calc_forces, clear_state_data, colvarbias_meta, delete_hill, project_hills, read_hill, read_state_data, update_bias, update_grid_data, and write_state_data.

colvar_grid_scalar* colvarbias_meta::hills_energy [protected]
 

Hill energy, cached on a grid.

Definition at line 194 of file colvarbias_meta.h.

Referenced by add_hill, calc_energy, calc_forces, clear_state_data, colvarbias_meta, init, read_hill, read_state_data, recount_hills_off_grid, update_bias, update_grid_data, update_grid_params, write_pmf, and write_state_data.

colvar_grid_gradient* colvarbias_meta::hills_energy_gradients [protected]
 

Hill forces, cached on a grid.

Definition at line 197 of file colvarbias_meta.h.

Referenced by clear_state_data, colvarbias_meta, init, read_state_data, update_grid_data, update_grid_params, and write_state_data.

std::list<hill> colvarbias_meta::hills_off_grid [protected]
 

\brief List of hills used on this bias that are on the boundary edges; these are updated regardless of whether hills are used.

Definition at line 101 of file colvarbias_meta.h.

Referenced by add_hill, calc_energy, calc_forces, clear_state_data, delete_hill, read_hill, read_state_data, recount_hills_off_grid, and write_state_data.

bool colvarbias_meta::keep_hills [protected]
 

Keep hills in the restart file (e.g. to accurately rebin later).

Definition at line 156 of file colvarbias_meta.h.

Referenced by colvarbias_meta, init, project_hills, and write_state_data.

size_t colvarbias_meta::new_hill_freq [protected]
 

\brief Number of simulation steps between two hills.

Definition at line 83 of file colvarbias_meta.h.

Referenced by colvarbias_meta, init, read_replica_files, and update_bias.

hill_iter colvarbias_meta::new_hills_begin [protected]
 

\brief Iterator to the first of the "newest" hills (when using grids, those who haven't been mapped yet).

Definition at line 97 of file colvarbias_meta.h.

Referenced by add_hill, calc_energy, calc_forces, colvarbias_meta, read_hill, read_state_data, update_bias, update_grid_data, and write_state_data.

hill_iter colvarbias_meta::new_hills_off_grid_begin [protected]
 

\brief Same as new_hills_begin, but for the off-grid ones.

Definition at line 104 of file colvarbias_meta.h.

bool colvarbias_meta::rebin_grids [protected]
 

\brief Rebin the hills upon restarting.

Definition at line 147 of file colvarbias_meta.h.

Referenced by colvarbias_meta, init, and read_state_data.

std::string colvarbias_meta::replica_file_name [protected]
 

\brief File containing the paths to the output files from this replica.

Definition at line 211 of file colvarbias_meta.h.

std::string colvarbias_meta::replica_hills_file [protected]
 

Explicit hills communicated between replicas This file becomes empty after replica_state_file is rewritten.

Definition at line 256 of file colvarbias_meta.h.

Referenced by read_replica_files, reopen_replica_buffer_file, replica_share, setup_output, update_bias, and ~colvarbias_meta.

std::streampos colvarbias_meta::replica_hills_file_pos [protected]
 

Position within replica_hills_file (when reading it).

Definition at line 259 of file colvarbias_meta.h.

Referenced by read_replica_files.

std::string colvarbias_meta::replica_id [protected]
 

\brief Identifier for this replica.

Definition at line 208 of file colvarbias_meta.h.

Referenced by calc_energy, calc_forces, colvarbias_meta, delete_hill, get_state_params, hills_traj_file_name, init, init_replicas_params, project_hills, read_hill, read_state_data, set_state_params, setup_output, update_bias, update_grid_params, and update_replicas_registry.

std::string colvarbias_meta::replica_list_file [protected]
 

List of files written by this replica.

Definition at line 241 of file colvarbias_meta.h.

Referenced by setup_output, and update_replicas_registry.

std::string colvarbias_meta::replica_state_file [protected]
 

Hills energy and gradients written specifically for other replica (in addition to its own restart file).

Definition at line 245 of file colvarbias_meta.h.

Referenced by read_replica_files, setup_output, and write_replica_state_file.

bool colvarbias_meta::replica_state_file_in_sync [protected]
 

Whether a mirror bias has read the latest version of its state file.

Definition at line 247 of file colvarbias_meta.h.

size_t colvarbias_meta::replica_update_freq [protected]
 

\brief Frequency at which data the "mirror" biases are updated.

Definition at line 233 of file colvarbias_meta.h.

Referenced by colvarbias_meta, init_replicas_params, read_replica_files, update, and update_replicas_registry.

std::vector<colvarbias_meta *> colvarbias_meta::replicas [protected]
 

\brief Additional, "mirror" metadynamics biases, to collect info from the other replicas These are supposed to be synchronized by reading data from the other replicas, and not be modified by the "local" replica.

Definition at line 230 of file colvarbias_meta.h.

Referenced by calc_energy, calc_forces, init_replicas_params, read_replica_files, setup_output, update_grid_data, update_replicas_registry, write_pmf, and write_state_to_replicas.

std::string colvarbias_meta::replicas_registry [protected]
 

List of replicas (and their output list files).

Definition at line 239 of file colvarbias_meta.h.

Referenced by update_replicas_registry.

std::string colvarbias_meta::replicas_registry_file [protected]
 

List of replicas (and their output list files): contents are copied into replicas_registry for convenience.

Definition at line 237 of file colvarbias_meta.h.

Referenced by init_replicas_params, setup_output, and update_replicas_registry.

bool colvarbias_meta::restart_keep_hills [protected]
 

value of keepHills saved in the most recent restart file.

Definition at line 159 of file colvarbias_meta.h.

Referenced by colvarbias_meta, read_hill, read_state_data, and set_state_params.

bool colvarbias_meta::safely_read_restart [protected]
 

\brief Try to read the restart information by allocating new grids before replacing the current ones (used e.g. in multiple_replicas).

Definition at line 191 of file colvarbias_meta.h.

colvar_grid_scalar* colvarbias_meta::target_dist [protected]
 

Target distribution for EBmeta.

Definition at line 182 of file colvarbias_meta.h.

Referenced by init_ebmeta_params, update_bias, write_pmf, and ~colvarbias_meta.

size_t colvarbias_meta::update_status [protected]
 

If there was a failure reading one of the files (because they are not complete), this counter is incremented.

Definition at line 251 of file colvarbias_meta.h.

bool colvarbias_meta::use_grids [protected]
 

\brief Bin the hills on grids of energy and forces, and use them to force the colvars (as opposed to deriving the hills analytically).

Definition at line 144 of file colvarbias_meta.h.

Referenced by colvarbias_meta, delete_hill, init, init_ebmeta_params, update_replicas_registry, and write_state_data.

bool colvarbias_meta::well_tempered [protected]
 

\brief Whether to use well-tempered metadynamics.

Definition at line 173 of file colvarbias_meta.h.

Referenced by init_well_tempered_params.


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