Collective Variables Module - Developer Documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
colvarproxy_volmaps Class Reference

Container of grid-based objects. More...

#include <colvarproxy_volmaps.h>

Inheritance diagram for colvarproxy_volmaps:
Inheritance graph
[legend]

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.
 

Public Member Functions

 colvarproxy_volmaps ()
 Contructor.
 
virtual ~colvarproxy_volmaps ()
 Destructor.
 
int reset ()
 Clear volumetric map data.
 
virtual int check_volmaps_available ()
 Test whether this implementation can use volumetric maps as CVs. More...
 
int add_volmap_slot (int volmap_id)
 Create a slot for a volumetric map not requested yet.
 
virtual int init_volmap_by_id (int volmap_id)
 
virtual int init_volmap_by_name (char const *volmap_name)
 
virtual int check_volmap_by_id (int volmap_id)
 
virtual int check_volmap_by_name (char const *volmap_name)
 
int init_volmap_by_name (std::string const &volmap_name)
 Request and prepare this volumetric map for use by Colvars.
 
int check_volmap_by_name (std::string const &volmap_name)
 Check that the given volmap name is valid (return COLVARS_OK if it is)
 
virtual void clear_volmap (int index)
 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)
 
cvm::real get_volmap_value (int index) const
 Read the current value of the volumetric map.
 
void apply_volmap_force (int index, cvm::real const &new_force)
 Request that this force is applied to the given volumetric map.
 
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)
 
void compute_rms_volmaps_applied_force ()
 Compute the root-mean-square of the applied forces.
 
void compute_max_volmaps_applied_force ()
 Compute the maximum norm among all applied forces.
 

Protected Attributes

std::vector< int > volmaps_ids
 Array of numeric IDs of volumetric maps.
 
std::vector< size_t > volmaps_refcount
 Keep track of how many times each vol map is used by a separate colvar object.
 
std::vector< cvm::realvolmaps_values
 Current values of the vol maps.
 
std::vector< cvm::realvolmaps_new_colvar_forces
 Forces applied from colvars, to be communicated to the MD integrator.
 
cvm::real volmaps_rms_applied_force_
 Root-mean-square of the the applied forces.
 
cvm::real volmaps_max_applied_force_
 Maximum norm among all applied forces.
 

Detailed Description

Container of grid-based objects.

Member Function Documentation

◆ check_volmap_by_id()

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_idNumeric ID used by the MD engine
Returns
Error code

Reimplemented in colvarproxy_vmd, and colvarproxy_namd.

◆ check_volmap_by_name()

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_nameName used by the MD engine
Returns
Error code

Reimplemented in colvarproxy_namd.

◆ check_volmaps_available()

int colvarproxy_volmaps::check_volmaps_available ( )
virtual

Test whether this implementation can use volumetric maps as CVs.

Reimplemented in colvarproxy_vmd, and colvarproxy_namd.

◆ clear_volmap()

void colvarproxy_volmaps::clear_volmap ( int  index)
virtual

Used by the CVC destructors.

Reimplemented in colvarproxy_vmd, and colvarproxy_namd.

◆ compute_volmap()

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
flagsCombination of flags
volmap_idNumeric index of the map (no need to request it)
atom_beginIterator pointing to first atom
atom_endIterator pointing past the last atom
valuePointer to location of total to increment
atom_fieldArray of atomic field values (if NULL, ones are used)

Reimplemented in colvarproxy_vmd, and colvarproxy_namd.

◆ get_volmap_id_from_name()

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)

Reimplemented in colvarproxy_namd.

◆ init_volmap_by_id()

int colvarproxy_volmaps::init_volmap_by_id ( int  volmap_id)
virtual

Request and prepare this volumetric map for use by Colvars

Parameters
volmap_idNumeric ID used by the MD engine
Returns
Index of the map in the colvarproxy arrays

Reimplemented in colvarproxy_vmd, and colvarproxy_namd.

◆ 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_nameName used by the MD engine
Returns
Index of the map in the colvarproxy arrays

Reimplemented in colvarproxy_namd.


The documentation for this class was generated from the following files: