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

colvarproxy Class Reference

\brief Interface between the collective variables module and the simulation or analysis program (NAMD, VMD, LAMMPS...). This is the base class: each interfaced program is supported by a derived class. More...

#include <colvarproxy.h>

Inheritance diagram for colvarproxy:

colvarproxy_io colvarproxy_tcl colvarproxy_script colvarproxy_replicas colvarproxy_smp colvarproxy_volmaps colvarproxy_atom_groups colvarproxy_atoms colvarproxy_system colvarproxy_vmd List of all members.

Public Methods

 colvarproxy ()
 Constructor. More...

virtual ~colvarproxy ()
 Destructor. More...

virtual bool io_available ()
 Ensure that we're on the main thread (derived class will do actual check). More...

virtual int request_deletion ()
 Request deallocation of the module (currently only implemented by VMD). More...

bool delete_requested ()
 Whether deallocation was requested. More...

virtual int reset ()
 \brief Reset proxy state, e.g. requested atoms. More...

virtual int parse_module_config ()
 (Re)initialize the module. More...

virtual int setup ()
 (Re)initialize required member data (called after the module). More...

bool engine_ready () const
 Whether the engine allows to fully initialize Colvars immediately. More...

void add_config (std::string const &cmd, std::string const &conf)
 Enqueue new configuration text, to be parsed as soon as possible. More...

virtual int update_input ()
 Update data required by Colvars module (e.g. read atom positions) TODO Break up colvarproxy_namd and colvarproxy_lammps function into these. More...

virtual int update_output ()
 Update data based on the results of a Colvars call (e.g. send forces). More...

int end_of_step ()
 Carry out operations needed before next simulation step is run. More...

virtual void log (std::string const &message)
 Print a message to the main log. More...

virtual void error (std::string const &message)
 Print a message to the main log and/or let the host code know about it. More...

void add_error_msg (std::string const &message)
 Record error message (used by VMD to collect them after a script call). More...

std::string const & get_error_msgs ()
 Retrieve accumulated error messages. More...

void clear_error_msgs ()
 As the name says. More...

bool simulation_running () const
 Whether a simulation is running (warn against irrecovarable errors). More...

bool simulation_continuing () const
 Is the current step a repetition of a step just executed? This is set to true when the step 0 of a new "run" command is being executed, regardless of whether a state file has been loaded. More...

int post_run ()
 Called at the end of a simulation segment (i.e. "run" command). More...

void print_input_atomic_data ()
 Print a full list of all input atomic arrays for debug purposes. More...

void print_output_atomic_data ()
 Print a full list of all applied forces for debug purposes. More...

int get_version_from_string (char const *version_string)
 Convert a version string "YYYY-MM-DD" into an integer. More...

int version_number () const
 Get the version number (higher = more recent). More...


Public Attributes

colvarmodulecolvars
 Pointer to the main object. More...


Protected Attributes

bool engine_ready_
 Whether the engine allows to fully initialize Colvars immediately. More...

std::string error_output
 Collected error messages. More...

bool b_simulation_running
 Whether a simulation is running (warn against irrecovarable errors). More...

bool b_simulation_continuing
 Is the current step a repetition of a step just executed? This is set to true when the step 0 of a new "run" command is being executed, regardless of whether a state file has been loaded. More...

bool b_delete_requested
 Whether the entire module should be deallocated by the host engine. More...

int version_int
 Integer representing the version string (allows comparisons). More...

size_t features_hash
 Track which features have been acknowledged during the last run. More...


Detailed Description

\brief Interface between the collective variables module and the simulation or analysis program (NAMD, VMD, LAMMPS...). This is the base class: each interfaced program is supported by a derived class.

Definition at line 571 of file colvarproxy.h.


Constructor & Destructor Documentation

colvarproxy::colvarproxy  
 

Constructor.

Definition at line 460 of file colvarproxy.C.

References b_delete_requested, b_simulation_continuing, b_simulation_running, colvars, engine_ready_, features_hash, NULL, and version_int.

colvarproxy::~colvarproxy   [virtual]
 

Destructor.

Definition at line 474 of file colvarproxy.C.

References colvarproxy_io::close_output_streams, colvars, and NULL.


Member Function Documentation

void colvarproxy::add_config std::string const &    cmd,
std::string const &    conf
 

Enqueue new configuration text, to be parsed as soon as possible.

Definition at line 509 of file colvarproxy.C.

References conf.

void colvarproxy::add_error_msg std::string const &    message
 

Record error message (used by VMD to collect them after a script call).

Definition at line 678 of file colvarproxy.C.

References error_output.

Referenced by colvarproxy_vmd::error.

void colvarproxy::clear_error_msgs  
 

As the name says.

Definition at line 688 of file colvarproxy.C.

References error_output.

Referenced by colvarmodule::clear_error.

bool colvarproxy::delete_requested   [inline]
 

Whether deallocation was requested.

Definition at line 600 of file colvarproxy.h.

References b_delete_requested.

int colvarproxy::end_of_step  
 

Carry out operations needed before next simulation step is run.

Definition at line 556 of file colvarproxy.C.

References colvarproxy_system::cached_alch_lambda_changed, colvarproxy_atom_groups::compute_max_atom_groups_applied_force, colvarproxy_atoms::compute_max_atoms_applied_force, colvarproxy_volmaps::compute_max_volmaps_applied_force, colvarproxy_atom_groups::compute_rms_atom_groups_applied_force, colvarproxy_atoms::compute_rms_atoms_applied_force, colvarproxy_volmaps::compute_rms_volmaps_applied_force, colvarproxy_system::send_alch_lambda, colvarproxy_atoms::updated_charges_, and colvarproxy_atoms::updated_masses_.

Referenced by colvarmodule::calc.

bool colvarproxy::engine_ready   const [inline]
 

Whether the engine allows to fully initialize Colvars immediately.

Definition at line 615 of file colvarproxy.h.

References engine_ready_.

void colvarproxy::error std::string const &    message [virtual]
 

Print a message to the main log and/or let the host code know about it.

Reimplemented in colvarproxy_vmd.

Definition at line 671 of file colvarproxy.C.

References log.

Referenced by colvarmodule::error.

std::string const & colvarproxy::get_error_msgs  
 

Retrieve accumulated error messages.

Definition at line 694 of file colvarproxy.C.

References error_output.

int colvarproxy::get_version_from_string char const *    version_string
 

Convert a version string "YYYY-MM-DD" into an integer.

Definition at line 700 of file colvarproxy.C.

Referenced by colvarmodule::colvarmodule, colvarproxy_vmd::colvarproxy_vmd, and colvarmodule::read_restart.

bool colvarproxy::io_available   [virtual]
 

Ensure that we're on the main thread (derived class will do actual check).

Reimplemented from colvarproxy_io.

Definition at line 485 of file colvarproxy.C.

References colvarproxy_smp::smp_enabled, and colvarproxy_smp::smp_thread_id.

void colvarproxy::log std::string const &    message [virtual]
 

Print a message to the main log.

Reimplemented in colvarproxy_vmd.

Definition at line 665 of file colvarproxy.C.

Referenced by error, and colvarmodule::log.

int colvarproxy::parse_module_config   [virtual]
 

(Re)initialize the module.

Definition at line 521 of file colvarproxy.C.

References colvars, COLVARS_BUG_ERROR, colvarmodule::error, colvarmodule::read_config_file, and colvarmodule::read_config_string.

int colvarproxy::post_run  
 

Called at the end of a simulation segment (i.e. "run" command).

Definition at line 577 of file colvarproxy.C.

References colvars, colvarproxy_io::flush_output_streams, colvarmodule::output_prefix, colvarmodule::write_output_files, and colvarmodule::write_restart_file.

void colvarproxy::print_input_atomic_data  
 

Print a full list of all input atomic arrays for debug purposes.

Definition at line 589 of file colvarproxy.C.

References colvarproxy_atom_groups::atom_groups_charges, colvarproxy_atom_groups::atom_groups_coms, colvarproxy_atom_groups::atom_groups_ids, colvarproxy_atom_groups::atom_groups_masses, colvarproxy_atom_groups::atom_groups_refcount, colvarproxy_atom_groups::atom_groups_total_forces, colvarproxy_atoms::atoms_charges, colvarproxy_atoms::atoms_ids, colvarproxy_atoms::atoms_masses, colvarproxy_atoms::atoms_positions, colvarproxy_atoms::atoms_refcount, colvarproxy_atoms::atoms_total_forces, colvarmodule::log, colvarproxy_volmaps::volmaps_ids, and colvarproxy_volmaps::volmaps_values.

void colvarproxy::print_output_atomic_data  
 

Print a full list of all applied forces for debug purposes.

Definition at line 640 of file colvarproxy.C.

References colvarproxy_atom_groups::atom_groups_new_colvar_forces, colvarproxy_atoms::atoms_new_colvar_forces, colvarmodule::cv_prec, colvarmodule::cv_width, colvarmodule::log, and colvarproxy_volmaps::volmaps_new_colvar_forces.

int colvarproxy::request_deletion   [virtual]
 

Request deallocation of the module (currently only implemented by VMD).

Reimplemented in colvarproxy_vmd.

Definition at line 501 of file colvarproxy.C.

References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.

int colvarproxy::reset   [virtual]
 

\brief Reset proxy state, e.g. requested atoms.

Reimplemented from colvarproxy_atoms.

Definition at line 492 of file colvarproxy.C.

References colvarproxy_atom_groups::reset, and colvarproxy_atoms::reset.

Referenced by colvarmodule::reset.

int colvarproxy::setup   [virtual]
 

(Re)initialize required member data (called after the module).

Reimplemented in colvarproxy_vmd.

Definition at line 515 of file colvarproxy.C.

Referenced by colvarproxy_vmd::setup.

bool colvarproxy::simulation_continuing   const [inline]
 

Is the current step a repetition of a step just executed? This is set to true when the step 0 of a new "run" command is being executed, regardless of whether a state file has been loaded.

Definition at line 658 of file colvarproxy.h.

References b_simulation_continuing.

Referenced by colvarbias::can_accumulate_data.

bool colvarproxy::simulation_running   const [inline]
 

Whether a simulation is running (warn against irrecovarable errors).

Definition at line 650 of file colvarproxy.h.

References b_simulation_running.

Referenced by colvarbias_abf::init, colvar::init_dependencies, colvarbias_restraint_k_moving::update, colvarbias_restraint_centers_moving::update, colvarbias_restraint_k_moving::update_acc_work, and colvarbias_restraint_centers_moving::update_acc_work.

int colvarproxy::update_input   [virtual]
 

Update data required by Colvars module (e.g. read atom positions) TODO Break up colvarproxy_namd and colvarproxy_lammps function into these.

Reimplemented in colvarproxy_vmd.

Definition at line 544 of file colvarproxy.C.

Referenced by colvarproxy_vmd::update_input.

int colvarproxy::update_output   [virtual]
 

Update data based on the results of a Colvars call (e.g. send forces).

Definition at line 550 of file colvarproxy.C.

int colvarproxy::version_number   const [inline]
 

Get the version number (higher = more recent).

Definition at line 676 of file colvarproxy.h.

References version_int.


Member Data Documentation

bool colvarproxy::b_delete_requested [protected]
 

Whether the entire module should be deallocated by the host engine.

Definition at line 698 of file colvarproxy.h.

Referenced by colvarproxy, delete_requested, and colvarproxy_vmd::request_deletion.

bool colvarproxy::b_simulation_continuing [protected]
 

Is the current step a repetition of a step just executed? This is set to true when the step 0 of a new "run" command is being executed, regardless of whether a state file has been loaded.

Definition at line 695 of file colvarproxy.h.

Referenced by colvarproxy, and simulation_continuing.

bool colvarproxy::b_simulation_running [protected]
 

Whether a simulation is running (warn against irrecovarable errors).

Definition at line 690 of file colvarproxy.h.

Referenced by colvarproxy, colvarproxy_vmd::colvarproxy_vmd, and simulation_running.

colvarmodule* colvarproxy::colvars
 

Pointer to the main object.

Definition at line 586 of file colvarproxy.h.

Referenced by colvarproxy, colvarproxy_vmd::colvarproxy_vmd, colvarmodule::main, parse_module_config, post_run, colvarproxy_vmd::set_frame, colvarproxy_vmd::setup, and ~colvarproxy.

bool colvarproxy::engine_ready_ [protected]
 

Whether the engine allows to fully initialize Colvars immediately.

Definition at line 684 of file colvarproxy.h.

Referenced by colvarproxy, and engine_ready.

std::string colvarproxy::error_output [protected]
 

Collected error messages.

Definition at line 687 of file colvarproxy.h.

Referenced by add_error_msg, clear_error_msgs, and get_error_msgs.

size_t colvarproxy::features_hash [protected]
 

Track which features have been acknowledged during the last run.

Definition at line 704 of file colvarproxy.h.

Referenced by colvarproxy.

int colvarproxy::version_int [protected]
 

Integer representing the version string (allows comparisons).

Definition at line 701 of file colvarproxy.h.

Referenced by colvarproxy, colvarproxy_vmd::colvarproxy_vmd, and version_number.


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