#include <colvarproxy_vmd.h>
Inheritance diagram for colvarproxy_vmd:
Public Methods | |||||||||||||
colvarproxy_vmd (Tcl_Interp *interp, VMDApp *vmd, int molid) | |||||||||||||
Constructor
| |||||||||||||
int | update_atomic_properties () | ||||||||||||
\brief Update mass, charge, etc. More... | |||||||||||||
virtual | ~colvarproxy_vmd () | ||||||||||||
virtual int | request_deletion () | ||||||||||||
Request deallocation of the module (currently only implemented by VMD). More... | |||||||||||||
virtual int | setup () | ||||||||||||
(Re)initialize required member data (called after the module). 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 cvm::real | rand_gaussian () | ||||||||||||
\brief Pseudo-random number with Gaussian distribution. More... | |||||||||||||
virtual int | get_molid (int &molid) | ||||||||||||
Get the molecule ID when called in VMD; raise error otherwise
| |||||||||||||
virtual int | get_frame (long int &f) | ||||||||||||
\brief Save the current frame number in the argument given. More... | |||||||||||||
virtual int | set_frame (long int f) | ||||||||||||
\brief Set the current frame number (as well as colvarmodule::it). More... | |||||||||||||
virtual void | init_tcl_pointers () | ||||||||||||
Set Tcl pointers. More... | |||||||||||||
virtual void | add_energy (cvm::real energy) | ||||||||||||
Pass restraint energy value for current timestep to MD engine. More... | |||||||||||||
virtual void | request_total_force (bool yesno) | ||||||||||||
\brief Tell the proxy whether total forces are needed (they may not always be available). 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... | |||||||||||||
virtual int | set_unit_system (std::string const &units_in, bool check_only) | ||||||||||||
\brief Request to set the units used internally by Colvars. More... | |||||||||||||
virtual int | run_force_callback () | ||||||||||||
Run a user-defined colvar forces script. More... | |||||||||||||
virtual int | run_colvar_callback (std::string const &name, std::vector< const colvarvalue * > const &cvcs, colvarvalue &value) | ||||||||||||
virtual int | run_colvar_gradient_callback (std::string const &name, std::vector< const colvarvalue * > const &cvc_values, std::vector< cvm::matrix2d< cvm::real > > &gradient) | ||||||||||||
virtual int | load_atoms (char const *filename, cvm::atom_group &atoms, std::string const &pdb_field, double const pdb_field_value=0.0) | ||||||||||||
\brief Select atom IDs from a file (usually PDB)
| |||||||||||||
virtual int | load_coords (char const *filename, std::vector< cvm::atom_pos > &pos, const std::vector< int > &indices, std::string const &pdb_field, double const pdb_field_value=0.0) | ||||||||||||
virtual int | init_atom (int atom_number) | ||||||||||||
Prepare this atom for collective variables calculation, selecting it by numeric index (1-based). More... | |||||||||||||
virtual int | check_atom_id (int atom_number) | ||||||||||||
Check that this atom number is valid, but do not initialize the corresponding atom yet. More... | |||||||||||||
virtual int | init_atom (cvm::residue_id const &residue, std::string const &atom_name, std::string const &segment_id) | ||||||||||||
Select this atom for collective variables calculation, using name and residue number. Not all programs support this: leave this function as is in those cases. More... | |||||||||||||
virtual int | check_atom_id (cvm::residue_id const &residue, std::string const &atom_name, std::string const &segment_id) | ||||||||||||
Check that this atom is valid, but do not initialize it yet. More... | |||||||||||||
virtual int | init_volmap_by_id (int volmap_id) | ||||||||||||
Request and prepare this volumetric map for use by Colvars
| |||||||||||||
virtual int | check_volmap_by_id (int volmap_id) | ||||||||||||
Check that the given volmap ID is valid (return COLVARS_OK if it is)
| |||||||||||||
virtual void | clear_volmap (int index) | ||||||||||||
\brief Used by the CVC destructors. More... | |||||||||||||
virtual int | compute_volmap (int flags, int volmap_id, cvm::atom_iter atom_begin, cvm::atom_iter atom_end, cvm::real *value, cvm::real *atom_field) | ||||||||||||
Re-weigh an atomic field (e.g. a colvar) by the value of a volumetric map
| |||||||||||||
template<int flags> void | compute_voldata (VolumetricData const *voldata, cvm::atom_iter atom_begin, cvm::atom_iter atom_end, cvm::real *value, cvm::real *atom_field) | ||||||||||||
int | get_alch_lambda (cvm::real *lambda) | ||||||||||||
Get value of alchemical lambda parameter from back-end (stub). More... | |||||||||||||
int | send_alch_lambda (void) | ||||||||||||
Set value of alchemical lambda parameter in back-end (stub). More... | |||||||||||||
int | get_dE_dlambda (cvm::real *dE_dlambda) | ||||||||||||
Get energy derivative with respect to lambda (stub). More... | |||||||||||||
Protected Attributes | |||||||||||||
VMDApp * | vmd | ||||||||||||
pointer to the VMD main object. More... | |||||||||||||
int | vmdmolid | ||||||||||||
VMD molecule ID being used (must be provided at construction). More... | |||||||||||||
DrawMolecule * | vmdmol | ||||||||||||
pointer to VMD molecule (derived from vmdmolid). More... | |||||||||||||
long int | vmdmol_frame | ||||||||||||
current frame (returned by vmdmol->frame()). More... | |||||||||||||
Inform | msgColvars | ||||||||||||
output object. More... |
Definition at line 32 of file colvarproxy_vmd.h.
|
Constructor
Definition at line 71 of file colvarproxy_vmd.C. References colvarproxy_system::angstrom_value_, colvarproxy::b_simulation_running, colvarmodule::cite_feature, COLVARPROXY_VERSION, colvarproxy::colvars, colvarmodule::cv_traj_freq, colvarproxy::get_version_from_string, colvarproxy_script::have_scripts, colvarproxy_system::kcal_mol_value_, colvarmodule::log, colvarmodule::restart_out_freq, colvarproxy_tcl::set_tcl_interp, setup, colvarmodule::setup_input, colvarmodule::setup_output, colvarproxy_atoms::updated_charges_, colvarproxy_atoms::updated_masses_, colvarproxy::version_int, vmd_srandom, and VMDCON_INFO. |
|
Definition at line 123 of file colvarproxy_vmd.C. |
|
Pass restraint energy value for current timestep to MD engine.
Reimplemented from colvarproxy_system. Definition at line 261 of file colvarproxy_vmd.C. |
|
Check that this atom is valid, but do not initialize it yet.
Reimplemented from colvarproxy_atoms. Definition at line 684 of file colvarproxy_vmd.C. References BaseMolecule::atom, BaseMolecule::atomNames, Residue::atoms, COLVARS_INPUT_ERROR, colvarmodule::error, MolAtom::nameindex, BaseMolecule::nResidues, ResizeArray< int >::num, Residue::resid, BaseMolecule::residue, MolAtom::segnameindex, BaseMolecule::segNames, and vmdmol. |
|
Check that this atom number is valid, but do not initialize the corresponding atom yet.
Reimplemented from colvarproxy_atoms. Definition at line 634 of file colvarproxy_vmd.C. References COLVARS_INPUT_ERROR, colvarmodule::debug, colvarmodule::error, colvarmodule::log, BaseMolecule::nAtoms, and vmdmol. Referenced by init_atom. |
|
Check that the given volmap ID is valid (return COLVARS_OK if it is)
Reimplemented from colvarproxy_volmaps. Definition at line 775 of file colvarproxy_vmd.C. References COLVARS_INPUT_ERROR, colvarmodule::error, BaseMolecule::num_volume_data, and vmdmol. Referenced by init_volmap_by_id. |
|
\brief Used by the CVC destructors.
Reimplemented from colvarproxy_volmaps. Definition at line 785 of file colvarproxy_vmd.C. References colvarproxy_volmaps::clear_volmap. |
|
|
Re-weigh an atomic field (e.g. a colvar) by the value of a volumetric map
Reimplemented from colvarproxy_volmaps. Definition at line 855 of file colvarproxy_vmd.C. References BaseMolecule::get_volume_data, NULL, vmdmol, colvarproxy_volmaps::volmap_flag_gradients, colvarproxy_volmaps::volmap_flag_null, and colvarproxy_volmaps::volmap_flag_use_atom_field. |
|
Print a message to the main log and/or let the host code know about it.
Reimplemented from colvarproxy. Definition at line 316 of file colvarproxy_vmd.C. References colvarproxy::add_error_msg, and log. Referenced by setup, update_atomic_properties, and update_input. |
|
Get value of alchemical lambda parameter from back-end (stub).
Reimplemented from colvarproxy_system. Definition at line 127 of file colvarproxy_vmd.h. |
|
Get energy derivative with respect to lambda (stub).
Reimplemented from colvarproxy_system. Definition at line 136 of file colvarproxy_vmd.h. |
|
\brief Save the current frame number in the argument given.
Reimplemented from colvarproxy_io. Definition at line 330 of file colvarproxy_vmd.C. References vmdmol_frame. |
|
Get the molecule ID when called in VMD; raise error otherwise
Reimplemented from colvarproxy_system. Definition at line 323 of file colvarproxy_vmd.C. References vmdmolid. |
|
Select this atom for collective variables calculation, using name and residue number. Not all programs support this: leave this function as is in those cases.
Reimplemented from colvarproxy_atoms. Definition at line 722 of file colvarproxy_vmd.C. References colvarproxy_atoms::add_atom_slot, colvarproxy_atoms::atoms_charges, colvarproxy_atoms::atoms_ids, colvarproxy_atoms::atoms_masses, colvarproxy_atoms::atoms_refcount, BaseMolecule::charge, check_atom_id, colvarmodule::debug, colvarmodule::log, BaseMolecule::mass, and vmdmol. |
|
Prepare this atom for collective variables calculation, selecting it by numeric index (1-based).
Reimplemented from colvarproxy_atoms. Definition at line 653 of file colvarproxy_vmd.C. References colvarproxy_atoms::add_atom_slot, colvarproxy_atoms::atoms_charges, colvarproxy_atoms::atoms_ids, colvarproxy_atoms::atoms_masses, colvarproxy_atoms::atoms_refcount, BaseMolecule::charge, check_atom_id, COLVARS_INPUT_ERROR, BaseMolecule::mass, and vmdmol. |
|
Set Tcl pointers.
Reimplemented from colvarproxy_tcl. Definition at line 353 of file colvarproxy_vmd.C. References colvarproxy_tcl::init_tcl_pointers. |
|
Request and prepare this volumetric map for use by Colvars
Reimplemented from colvarproxy_volmaps. Definition at line 754 of file colvarproxy_vmd.C. References colvarproxy_volmaps::add_volmap_slot, check_volmap_by_id, colvarproxy_volmaps::volmaps_ids, and colvarproxy_volmaps::volmaps_refcount. |
|
\brief Select atom IDs from a file (usually PDB)
Reimplemented from colvarproxy_atoms. Definition at line 565 of file colvarproxy_vmd.C. References atoms, FileSpec::autobonds, BaseMolecule::beta, COLVARS_ERROR, COLVARS_FILE_ERROR, COLVARS_INPUT_ERROR, e_pdb_beta, e_pdb_field, e_pdb_occ, e_pdb_x, e_pdb_y, e_pdb_z, colvarmodule::error, colvarmodule::get_error, DrawMolecule::get_frame, colvarmodule::log, MoleculeList::mol_from_id, VMDApp::molecule_delete, VMDApp::molecule_load, VMDApp::molecule_make_top, VMDApp::moleculeList, BaseMolecule::nAtoms, BaseMolecule::occupancy, pdb_field_str2enum, Timestep::pos, colvarmodule::set_error_bits, vmd, and vmdmolid. |
|
|
Print a message to the main log.
Reimplemented from colvarproxy. Definition at line 306 of file colvarproxy_vmd.C. References msgColvars. Referenced by error. |
|
\brief Pseudo-random number with Gaussian distribution.
Reimplemented from colvarproxy_system. Definition at line 149 of file colvarproxy_vmd.C. References vmd_random_gaussian. |
|
Request deallocation of the module (currently only implemented by VMD).
Reimplemented from colvarproxy. Definition at line 127 of file colvarproxy_vmd.C. References colvarproxy::b_delete_requested. |
|
\brief Tell the proxy whether total forces are needed (they may not always be available).
Reimplemented from colvarproxy_system. Definition at line 295 of file colvarproxy_vmd.C. References colvarmodule::log, and colvarproxy_system::total_force_requested. |
|
Reimplemented from colvarproxy_script. Definition at line 372 of file colvarproxy_vmd.C. References colvarproxy_tcl::tcl_run_colvar_callback. |
|
Reimplemented from colvarproxy_script. Definition at line 380 of file colvarproxy_vmd.C. References colvarproxy_tcl::tcl_run_colvar_gradient_callback. |
|
Run a user-defined colvar forces script.
Reimplemented from colvarproxy_script. Definition at line 367 of file colvarproxy_vmd.C. References colvarproxy_tcl::tcl_run_force_callback. |
|
Set value of alchemical lambda parameter in back-end (stub).
Reimplemented from colvarproxy_system. Definition at line 133 of file colvarproxy_vmd.h. |
|
\brief Set the current frame number (as well as colvarmodule::it).
Reimplemented from colvarproxy_io. Definition at line 337 of file colvarproxy_vmd.C. References colvarproxy::colvars, COLVARS_NO_SUCH_FRAME, DrawMolecule::get_frame, colvarmodule::it, NULL, update_input, vmdmol, and vmdmol_frame. Referenced by setup. |
|
\brief Request to set the units used internally by Colvars.
Reimplemented from colvarproxy_system. Definition at line 155 of file colvarproxy_vmd.C. References colvarproxy_system::angstrom_value_, COLVARS_ERROR, colvarmodule::error, colvarproxy_system::kcal_mol_value_, and colvarproxy_system::units. |
|
(Re)initialize required member data (called after the module).
Reimplemented from colvarproxy. Definition at line 134 of file colvarproxy_vmd.C. References colvarproxy::colvars, COLVARS_ERROR, error, DrawMolecule::frame, MoleculeList::mol_from_id, VMDApp::moleculeList, set_frame, colvarproxy::setup, colvarmodule::update_engine_parameters, vmd, vmdmol, and vmdmolid. Referenced by colvarproxy_vmd. |
|
\brief Update mass, charge, etc.
Definition at line 266 of file colvarproxy_vmd.C. References colvarproxy_atoms::atoms_charges, colvarproxy_atoms::atoms_ids, colvarproxy_atoms::atoms_masses, BaseMolecule::charge, COLVARS_BUG_ERROR, error, BaseMolecule::mass, NULL, and vmdmol. Referenced by update_input. |
|
|
output object.
Definition at line 156 of file colvarproxy_vmd.h. Referenced by log. |
|
pointer to the VMD main object.
Definition at line 144 of file colvarproxy_vmd.h. Referenced by load_atoms, load_coords, setup, and update_input. |
|
pointer to VMD molecule (derived from vmdmolid).
Definition at line 150 of file colvarproxy_vmd.h. Referenced by check_atom_id, check_volmap_by_id, compute_volmap, init_atom, set_frame, setup, update_atomic_properties, and update_input. |
|
current frame (returned by vmdmol->frame()).
Definition at line 153 of file colvarproxy_vmd.h. Referenced by get_frame, set_frame, and update_input. |
|
VMD molecule ID being used (must be provided at construction).
Definition at line 147 of file colvarproxy_vmd.h. Referenced by get_molid, load_atoms, load_coords, setup, and update_input. |