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 request_engine_volmap_by_id (int volmap_id)
 
virtual int request_engine_volmap_by_name (std::string const &volmap_name)
 
virtual int init_internal_volmap_by_id (int volmap_id)
 
virtual int init_internal_volmap_by_name (std::string const &filename)
 
virtual int load_internal_volmap_from_file (std::string const &filename)
 
virtual int clear_volmap (int index)
 Used by the CVC destructors. More...
 
int get_volmap_id (int index) const
 Get the numeric ID of the given volumetric map (for the MD program)
 
cvm::real get_engine_volmap_value (int index) const
 Read the current value of the volumetric map.
 
void apply_engine_volmap_force (int index, cvm::real const &new_force)
 Request that this force is applied to the given volumetric map by the engine.
 
virtual int compute_volmap (int flags, int volmap_index, cvm::atom_group *ag, cvm::real *value, cvm::real *atom_field)
 Re-weigh an atomic field (e.g. a colvar) by the value of a volumetric map. More...
 
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 (-1 if loaded internally)
 
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 total values of the volmaps (when computed by the MD engine)
 
std::vector< cvm::realvolmaps_new_colvar_forces
 Forces applied from colvars, to be communicated to the MD engine.
 
std::vector< std::string > volmaps_filenames
 Names of files containing maps (empty when maps are loaded by MD engine)
 
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_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()

int 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_index,
cvm::atom_group ag,
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_indexIndex of the map in the proxy arrays
agPointer to the SOA atom group
valuePointer to location of total to increment
atom_fieldArray of atomic field values (if NULL, ones are used)

Reimplemented in colvarproxy_namd, and colvarproxy_vmd.

◆ init_internal_volmap_by_id()

int colvarproxy_volmaps::init_internal_volmap_by_id ( int  volmap_id)
virtual

Select a map from the MD engine for internal computation

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_internal_volmap_by_name()

int colvarproxy_volmaps::init_internal_volmap_by_name ( std::string const &  filename)
virtual

Select a map from the MD engine for internal computation

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

Reimplemented in colvarproxy_namd.

◆ load_internal_volmap_from_file()

int colvarproxy_volmaps::load_internal_volmap_from_file ( std::string const &  filename)
virtual

Load a map internally in Colvars, and select it for internal computation

Parameters
filenameName of file containing the map
Returns
Index of the map in the colvarproxy arrays

Reimplemented in colvarproxy_vmd, and colvarproxy_namd.

◆ request_engine_volmap_by_id()

int colvarproxy_volmaps::request_engine_volmap_by_id ( int  volmap_id)
virtual

Request this map for computation by the MD engine

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

Reimplemented in colvarproxy_namd.

◆ request_engine_volmap_by_name()

int colvarproxy_volmaps::request_engine_volmap_by_name ( std::string const &  volmap_name)
virtual

Request this map for computation by the MD engine

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: