Collective Variables Module - Developer Documentation
Loading...
Searching...
No Matches
colvarproxy_volmaps.h
1// -*- c++ -*-
2
3#ifndef COLVARPROXY_VOLMAPS_H
4#define COLVARPROXY_VOLMAPS_H
5
6
9
10public:
11
14
16 virtual ~colvarproxy_volmaps();
17
19 int reset();
20
22 virtual int check_volmaps_available();
23
25 int add_volmap_slot(int volmap_id);
26
30 virtual int init_volmap_by_id(int volmap_id);
31
35 virtual int init_volmap_by_name(char const *volmap_name);
36
40 virtual int check_volmap_by_id(int volmap_id);
41
45 virtual int check_volmap_by_name(char const *volmap_name);
46
48 int init_volmap_by_name(std::string const &volmap_name);
49
51 int check_volmap_by_name(std::string const &volmap_name);
52
54 virtual void clear_volmap(int index);
55
57 virtual int get_volmap_id_from_name(char const *volmap_name);
58
60 inline int get_volmap_id(int index) const
61 {
62 return volmaps_ids[index];
63 }
64
66 inline cvm::real get_volmap_value(int index) const
67 {
68 return volmaps_values[index];
69 }
70
72 inline void apply_volmap_force(int index, cvm::real const &new_force)
73 {
74 volmaps_new_colvar_forces[index] += new_force;
75 }
76
84 virtual int compute_volmap(int flags,
85 int volmap_id,
86 cvm::atom_iter atom_begin,
87 cvm::atom_iter atom_end,
88 cvm::real *value,
89 cvm::real *atom_field);
90
92 enum {
93 volmap_flag_null = 0,
94 volmap_flag_gradients = 1,
95 volmap_flag_use_atom_field = (1<<8)
96 };
97
100
103
104protected:
105
107 std::vector<int> volmaps_ids;
108
111 std::vector<size_t> volmaps_refcount;
112
114 std::vector<cvm::real> volmaps_values;
115
118 std::vector<cvm::real> volmaps_new_colvar_forces;
119
122
125};
126
127
128#endif
double real
Defining an abstract real number allows to switch precision.
Definition: colvarmodule.h:95
Container of grid-based objects.
Definition: colvarproxy_volmaps.h:8
int get_volmap_id(int index) const
Get the numeric ID of the given volumetric map (for the MD program)
Definition: colvarproxy_volmaps.h:60
int reset()
Clear volumetric map data.
Definition: colvarproxy_volmaps.cpp:30
cvm::real volmaps_rms_applied_force_
Root-mean-square of the the applied forces.
Definition: colvarproxy_volmaps.h:121
cvm::real get_volmap_value(int index) const
Read the current value of the volumetric map.
Definition: colvarproxy_volmaps.h:66
virtual int check_volmap_by_id(int volmap_id)
Definition: colvarproxy_volmaps.cpp:53
virtual int get_volmap_id_from_name(char const *volmap_name)
Get the numeric ID of the given volumetric map (for the MD program)
Definition: colvarproxy_volmaps.cpp:104
void compute_max_volmaps_applied_force()
Compute the maximum norm among all applied forces.
Definition: colvarproxy_volmaps.cpp:130
void apply_volmap_force(int index, cvm::real const &new_force)
Request that this force is applied to the given volumetric map.
Definition: colvarproxy_volmaps.h:72
std::vector< int > volmaps_ids
Array of numeric IDs of volumetric maps.
Definition: colvarproxy_volmaps.h:107
virtual int check_volmaps_available()
Test whether this implementation can use volumetric maps as CVs.
Definition: colvarproxy_volmaps.cpp:24
std::vector< size_t > volmaps_refcount
Keep track of how many times each vol map is used by a separate colvar object.
Definition: colvarproxy_volmaps.h:111
virtual int init_volmap_by_name(char const *volmap_name)
Definition: colvarproxy_volmaps.cpp:67
void compute_rms_volmaps_applied_force()
Compute the root-mean-square of the applied forces.
Definition: colvarproxy_volmaps.cpp:123
cvm::real volmaps_max_applied_force_
Maximum norm among all applied forces.
Definition: colvarproxy_volmaps.h:124
std::vector< cvm::real > volmaps_values
Current values of the vol maps.
Definition: colvarproxy_volmaps.h:114
virtual void clear_volmap(int index)
Used by the CVC destructors.
Definition: colvarproxy_volmaps.cpp:91
int add_volmap_slot(int volmap_id)
Create a slot for a volumetric map not requested yet.
Definition: colvarproxy_volmaps.cpp:43
virtual ~colvarproxy_volmaps()
Destructor.
Definition: colvarproxy_volmaps.cpp:21
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)
Definition: colvarproxy_volmaps.cpp:112
virtual int check_volmap_by_name(char const *volmap_name)
Definition: colvarproxy_volmaps.cpp:60
virtual int init_volmap_by_id(int volmap_id)
Definition: colvarproxy_volmaps.cpp:73
std::vector< cvm::real > volmaps_new_colvar_forces
Forces applied from colvars, to be communicated to the MD integrator.
Definition: colvarproxy_volmaps.h:118
colvarproxy_volmaps()
Contructor.
Definition: colvarproxy_volmaps.cpp:15