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

colvarproxy_volmaps Class Reference

\brief Container of grid-based objects. More...

#include <colvarproxy_volmaps.h>

Inheritance diagram for colvarproxy_volmaps:

colvarproxy colvarproxy_vmd List of all members.

Public Types

enum  { volmap_flag_null = 0, volmap_flag_gradients = 1, volmap_flag_use_atom_field = (1<<8) }
 Flags controlling what computation is done on the map. More...


Public Methods

 colvarproxy_volmaps ()
 Contructor. More...

virtual ~colvarproxy_volmaps ()
 Destructor. More...

int reset ()
 Clear volumetric map data. More...

virtual int volmaps_available ()
 \brief Whether this implementation has capability to use volumetric maps. More...

int add_volmap_slot (int volmap_id)
 Create a slot for a volumetric map not requested yet. More...

virtual int init_volmap_by_id (int volmap_id)
 Request and prepare this volumetric map for use by Colvars
Parameters:
volmap_id  Numeric ID used by the MD engine
Returns:
Index of the map in the colvarproxy arrays.
More...


virtual int init_volmap_by_name (char const *volmap_name)
 Request and prepare this volumetric map for use by Colvars
Parameters:
volmap_name  Name used by the MD engine
Returns:
Index of the map in the colvarproxy arrays.
More...


virtual int check_volmap_by_id (int volmap_id)
 Check that the given volmap ID is valid (return COLVARS_OK if it is)
Parameters:
volmap_id  Numeric ID used by the MD engine
Returns:
Error code.
More...


virtual int check_volmap_by_name (char const *volmap_name)
 Check that the given volmap name is valid (return COLVARS_OK if it is)
Parameters:
volmap_name  Name used by the MD engine
Returns:
Error code.
More...


int init_volmap_by_name (std::string const &volmap_name)
 Request and prepare this volumetric map for use by Colvars. More...

int check_volmap_by_name (std::string const &volmap_name)
 Check that the given volmap name is valid (return COLVARS_OK if it is). More...

virtual void clear_volmap (int index)
 \brief Used by the CVC destructors. More...

virtual int get_volmap_id_from_name (char const *volmap_name)
 Get the numeric ID of the given volumetric map (for the MD program). More...

int get_volmap_id (int index) const
 Get the numeric ID of the given volumetric map (for the MD program). More...

cvm::real get_volmap_value (int index) const
 Read the current value of the volumetric map. More...

void apply_volmap_force (int index, cvm::real const &new_force)
 Request that this force is applied to the given volumetric map. 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
Parameters:
flags  Combination of flags
volmap_id  Numeric index of the map (no need to request it)
atom_begin  Iterator pointing to first atom
atom_end  Iterator pointing past the last atom
value  Pointer to location of total to increment
atom_field  Array of atomic field values (if NULL, ones are used).
More...


void compute_rms_volmaps_applied_force ()
 Compute the root-mean-square of the applied forces. More...

void compute_max_volmaps_applied_force ()
 Compute the maximum norm among all applied forces. More...


Protected Attributes

std::vector< int > volmaps_ids
 \brief Array of numeric IDs of volumetric maps. More...

std::vector< size_t > volmaps_refcount
 \brief Keep track of how many times each vol map is used by a separate colvar object. More...

std::vector< cvm::realvolmaps_values
 \brief Current values of the vol maps. More...

std::vector< cvm::realvolmaps_new_colvar_forces
 \brief Forces applied from colvars, to be communicated to the MD integrator. More...

cvm::real volmaps_rms_applied_force_
 Root-mean-square of the the applied forces. More...

cvm::real volmaps_max_applied_force_
 Maximum norm among all applied forces. More...


Detailed Description

\brief Container of grid-based objects.

Definition at line 8 of file colvarproxy_volmaps.h.


Member Enumeration Documentation

anonymous enum
 

Flags controlling what computation is done on the map.

Enumeration values:
volmap_flag_null 
volmap_flag_gradients 
volmap_flag_use_atom_field 

Definition at line 92 of file colvarproxy_volmaps.h.


Constructor & Destructor Documentation

colvarproxy_volmaps::colvarproxy_volmaps  
 

Contructor.

Definition at line 15 of file colvarproxy_volmaps.C.

References volmaps_max_applied_force_, and volmaps_rms_applied_force_.

colvarproxy_volmaps::~colvarproxy_volmaps   [virtual]
 

Destructor.

Definition at line 21 of file colvarproxy_volmaps.C.


Member Function Documentation

int colvarproxy_volmaps::add_volmap_slot int    volmap_id
 

Create a slot for a volumetric map not requested yet.

Definition at line 43 of file colvarproxy_volmaps.C.

References volmaps_ids, volmaps_new_colvar_forces, volmaps_refcount, and volmaps_values.

Referenced by colvarproxy_vmd::init_volmap_by_id.

void colvarproxy_volmaps::apply_volmap_force int    index,
cvm::real const &    new_force
[inline]
 

Request that this force is applied to the given volumetric map.

Definition at line 72 of file colvarproxy_volmaps.h.

References volmaps_new_colvar_forces.

Referenced by colvar::map_total::apply_force.

int colvarproxy_volmaps::check_volmap_by_id int    volmap_id [virtual]
 

Check that the given volmap ID is valid (return COLVARS_OK if it is)

Parameters:
volmap_id  Numeric ID used by the MD engine
Returns:
Error code.

Reimplemented in colvarproxy_vmd.

Definition at line 53 of file colvarproxy_volmaps.C.

References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.

Referenced by colvar::map_total::init.

int colvarproxy_volmaps::check_volmap_by_name std::string const &    volmap_name
 

Check that the given volmap name is valid (return COLVARS_OK if it is).

Definition at line 85 of file colvarproxy_volmaps.C.

References check_volmap_by_name.

virtual int colvarproxy_volmaps::check_volmap_by_name char const *    volmap_name [virtual]
 

Check that the given volmap name is valid (return COLVARS_OK if it is)

Parameters:
volmap_name  Name used by the MD engine
Returns:
Error code.

Referenced by check_volmap_by_name, get_volmap_id_from_name, and colvar::map_total::init.

void colvarproxy_volmaps::clear_volmap int    index [virtual]
 

\brief Used by the CVC destructors.

Reimplemented in colvarproxy_vmd.

Definition at line 91 of file colvarproxy_volmaps.C.

References COLVARS_INPUT_ERROR, colvarmodule::error, volmaps_ids, and volmaps_refcount.

Referenced by colvarproxy_vmd::clear_volmap, and reset.

void colvarproxy_volmaps::compute_max_volmaps_applied_force  
 

Compute the maximum norm among all applied forces.

Definition at line 130 of file colvarproxy_volmaps.C.

References volmaps_max_applied_force_.

Referenced by colvarproxy::end_of_step.

void colvarproxy_volmaps::compute_rms_volmaps_applied_force  
 

Compute the root-mean-square of the applied forces.

Definition at line 123 of file colvarproxy_volmaps.C.

References volmaps_rms_applied_force_.

Referenced by colvarproxy::end_of_step.

int colvarproxy_volmaps::compute_volmap int    flags,
int    volmap_id,
cvm::atom_iter    atom_begin,
cvm::atom_iter    atom_end,
cvm::real   value,
cvm::real   atom_field
[virtual]
 

Re-weigh an atomic field (e.g. a colvar) by the value of a volumetric map

Parameters:
flags  Combination of flags
volmap_id  Numeric index of the map (no need to request it)
atom_begin  Iterator pointing to first atom
atom_end  Iterator pointing past the last atom
value  Pointer to location of total to increment
atom_field  Array of atomic field values (if NULL, ones are used).

Reimplemented in colvarproxy_vmd.

Definition at line 112 of file colvarproxy_volmaps.C.

References COLVARS_NOT_IMPLEMENTED.

Referenced by colvar::map_total::calc_value.

int colvarproxy_volmaps::get_volmap_id int    index const [inline]
 

Get the numeric ID of the given volumetric map (for the MD program).

Definition at line 60 of file colvarproxy_volmaps.h.

References volmaps_ids.

int colvarproxy_volmaps::get_volmap_id_from_name char const *    volmap_name [virtual]
 

Get the numeric ID of the given volumetric map (for the MD program).

Definition at line 104 of file colvarproxy_volmaps.C.

References check_volmap_by_name.

Referenced by colvar::map_total::init.

cvm::real colvarproxy_volmaps::get_volmap_value int    index const [inline]
 

Read the current value of the volumetric map.

Definition at line 66 of file colvarproxy_volmaps.h.

References volmaps_values.

Referenced by colvar::map_total::calc_value.

int colvarproxy_volmaps::init_volmap_by_id int    volmap_id [virtual]
 

Request and prepare this volumetric map for use by Colvars

Parameters:
volmap_id  Numeric ID used by the MD engine
Returns:
Index of the map in the colvarproxy arrays.

Reimplemented in colvarproxy_vmd.

Definition at line 73 of file colvarproxy_volmaps.C.

Referenced by colvar::map_total::init.

int colvarproxy_volmaps::init_volmap_by_name std::string const &    volmap_name
 

Request and prepare this volumetric map for use by Colvars.

Definition at line 79 of file colvarproxy_volmaps.C.

References init_volmap_by_name.

int colvarproxy_volmaps::init_volmap_by_name char const *    volmap_name [virtual]
 

Request and prepare this volumetric map for use by Colvars

Parameters:
volmap_name  Name used by the MD engine
Returns:
Index of the map in the colvarproxy arrays.

Definition at line 67 of file colvarproxy_volmaps.C.

Referenced by colvar::map_total::init, and init_volmap_by_name.

int colvarproxy_volmaps::reset  
 

Clear volumetric map data.

Reimplemented in colvarproxy.

Definition at line 30 of file colvarproxy_volmaps.C.

References clear_volmap, volmaps_ids, volmaps_new_colvar_forces, volmaps_refcount, and volmaps_values.

int colvarproxy_volmaps::volmaps_available   [virtual]
 

\brief Whether this implementation has capability to use volumetric maps.

Definition at line 24 of file colvarproxy_volmaps.C.

References COLVARS_NOT_IMPLEMENTED.


Member Data Documentation

std::vector<int> colvarproxy_volmaps::volmaps_ids [protected]
 

\brief Array of numeric IDs of volumetric maps.

Definition at line 107 of file colvarproxy_volmaps.h.

Referenced by add_volmap_slot, clear_volmap, get_volmap_id, colvarproxy_vmd::init_volmap_by_id, colvarproxy::print_input_atomic_data, and reset.

cvm::real colvarproxy_volmaps::volmaps_max_applied_force_ [protected]
 

Maximum norm among all applied forces.

Definition at line 124 of file colvarproxy_volmaps.h.

Referenced by colvarproxy_volmaps, and compute_max_volmaps_applied_force.

std::vector<cvm::real> colvarproxy_volmaps::volmaps_new_colvar_forces [protected]
 

\brief Forces applied from colvars, to be communicated to the MD integrator.

Definition at line 118 of file colvarproxy_volmaps.h.

Referenced by add_volmap_slot, apply_volmap_force, colvarproxy::print_output_atomic_data, and reset.

std::vector<size_t> colvarproxy_volmaps::volmaps_refcount [protected]
 

\brief Keep track of how many times each vol map is used by a separate colvar object.

Definition at line 111 of file colvarproxy_volmaps.h.

Referenced by add_volmap_slot, clear_volmap, colvarproxy_vmd::init_volmap_by_id, and reset.

cvm::real colvarproxy_volmaps::volmaps_rms_applied_force_ [protected]
 

Root-mean-square of the the applied forces.

Definition at line 121 of file colvarproxy_volmaps.h.

Referenced by colvarproxy_volmaps, and compute_rms_volmaps_applied_force.

std::vector<cvm::real> colvarproxy_volmaps::volmaps_values [protected]
 

\brief Current values of the vol maps.

Definition at line 114 of file colvarproxy_volmaps.h.

Referenced by add_volmap_slot, get_volmap_value, colvarproxy::print_input_atomic_data, and reset.


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