Collective Variables Module - Developer Documentation
Loading...
Searching...
No Matches
colvarproxy.h
Go to the documentation of this file.
1// -*- c++ -*-
2
3// This file is part of the Collective Variables module (Colvars).
4// The original version of Colvars and its updates are located at:
5// https://github.com/Colvars/colvars
6// Please update all Colvars source files before making any changes.
7// If you wish to distribute your changes, please submit them to the
8// Colvars repository at GitHub.
9
10#ifndef COLVARPROXY_H
11#define COLVARPROXY_H
12
13#include "colvarmodule.h"
14#include "colvartypes.h"
15#include "colvarproxy_io.h"
16#include "colvarproxy_system.h"
17#include "colvarproxy_tcl.h"
18#include "colvarproxy_volmaps.h"
19
33
34
35// forward declarations
36class colvarscript;
37
38
41
42public:
43
46
48 virtual ~colvarproxy_atoms();
49
52 virtual int init_atom(int atom_number);
53
56 virtual int check_atom_id(int atom_number);
57
60
64 virtual int init_atom(cvm::residue_id const &residue,
65 std::string const &atom_name,
66 std::string const &segment_id);
67
69 virtual int check_atom_id(cvm::residue_id const &residue,
70 std::string const &atom_name,
71 std::string const &segment_id);
72
75 virtual void clear_atom(int index);
76
78 int reset();
79
82 inline int get_atom_id(int index) const
83 {
84 return atoms_ids[index];
85 }
86
89 inline cvm::real get_atom_mass(int index) const
90 {
91 return atoms_masses[index];
92 }
93
96 inline void increase_refcount(int index)
97 {
98 atoms_refcount[index] += 1;
99 }
100
103 inline cvm::real get_atom_charge(int index) const
104 {
105 return atoms_charges[index];
106 }
107
110 inline cvm::rvector get_atom_position(int index) const
111 {
112 return atoms_positions[index];
113 }
114
117 inline cvm::rvector get_atom_total_force(int index) const
118 {
119 return atoms_total_forces[index];
120 }
121
125 inline void apply_atom_force(int index, cvm::rvector const &new_force)
126 {
127 atoms_new_colvar_forces[index] += new_force;
128 }
129
131 inline cvm::rvector get_atom_velocity(int /* index */)
132 {
133 cvm::error("Error: reading the current velocity of an atom "
134 "is not yet implemented.\n",
135 COLVARS_NOT_IMPLEMENTED);
136 return cvm::rvector(0.0);
137 }
138
139 inline std::vector<int> const *get_atom_ids() const
140 {
141 return &atoms_ids;
142 }
143
145 size_t get_num_active_atoms() const;
146
147 inline std::vector<cvm::real> const *get_atom_masses() const
148 {
149 return &atoms_masses;
150 }
151
152 inline std::vector<cvm::real> *modify_atom_masses()
153 {
154 // assume that we are requesting masses to change them
155 updated_masses_ = true;
156 return &atoms_masses;
157 }
158
159 inline std::vector<cvm::real> const *get_atom_charges()
160 {
161 return &atoms_charges;
162 }
163
164 inline std::vector<cvm::real> *modify_atom_charges()
165 {
166 // assume that we are requesting charges to change them
167 updated_charges_ = true;
168 return &atoms_charges;
169 }
170
171 inline std::vector<cvm::rvector> const *get_atom_positions() const
172 {
173 return &atoms_positions;
174 }
175
176 inline std::vector<cvm::rvector> *modify_atom_positions()
177 {
178 return &atoms_positions;
179 }
180
181 inline std::vector<cvm::rvector> const *get_atom_total_forces() const
182 {
183 return &atoms_total_forces;
184 }
185
186 inline std::vector<cvm::rvector> *modify_atom_total_forces()
187 {
188 return &atoms_total_forces;
189 }
190
191 inline std::vector<cvm::rvector> const *get_atom_applied_forces() const
192 {
194 }
195
196 inline std::vector<cvm::rvector> *modify_atom_applied_forces()
197 {
199 }
200
203
206
209 {
211 }
212
215 {
217 }
218
220 inline int max_atoms_applied_force_id() const
221 {
223 }
224
226 inline bool modified_atom_list() const
227 {
228 return modified_atom_list_;
229 }
230
233 {
234 modified_atom_list_ = false;
235 }
236
238 inline bool updated_masses() const
239 {
240 return updated_masses_;
241 }
242
244 inline bool updated_charges() const
245 {
246 return updated_charges_;
247 }
248
249protected:
250
253 std::vector<int> atoms_ids;
255 std::vector<size_t> atoms_refcount;
257 std::vector<cvm::real> atoms_masses;
259 std::vector<cvm::real> atoms_charges;
261 std::vector<cvm::rvector> atoms_positions;
263 std::vector<cvm::rvector> atoms_total_forces;
265 std::vector<cvm::rvector> atoms_new_colvar_forces;
266
269
272
275
278
280 bool updated_masses_, updated_charges_;
281
284 int add_atom_slot(int atom_id);
285
286};
287
288
292
293public:
294
297
299 virtual ~colvarproxy_atom_groups();
300
302 int reset();
303
305 virtual int scalable_group_coms();
306
308 virtual int init_atom_group(std::vector<int> const &atoms_ids);
309
311 virtual void clear_atom_group(int index);
312
314 inline int get_atom_group_id(int index) const
315 {
316 return atom_groups_ids[index];
317 }
318
320 inline cvm::real get_atom_group_mass(int index) const
321 {
322 return atom_groups_masses[index];
323 }
324
326 inline cvm::real get_atom_group_charge(int index) const
327 {
328 return atom_groups_charges[index];
329 }
330
332 inline cvm::rvector get_atom_group_com(int index) const
333 {
334 return atom_groups_coms[index];
335 }
336
339 {
340 return atom_groups_total_forces[index];
341 }
342
344 inline void apply_atom_group_force(int index, cvm::rvector const &new_force)
345 {
346 atom_groups_new_colvar_forces[index] += new_force;
347 }
348
350 inline cvm::rvector get_atom_group_velocity(int /* index */)
351 {
352 cvm::error("Error: reading the current velocity of an atom group is not yet implemented.\n",
353 COLVARS_NOT_IMPLEMENTED);
354 return cvm::rvector(0.0);
355 }
356
357 inline std::vector<int> const *get_atom_group_ids() const
358 {
359 return &atom_groups_ids;
360 }
361
363 size_t get_num_active_atom_groups() const;
364
365 inline std::vector<cvm::real> *modify_atom_group_masses()
366 {
367 // TODO updated_masses
368 return &atom_groups_masses;
369 }
370
371 inline std::vector<cvm::real> *modify_atom_group_charges()
372 {
373 // TODO updated masses
374 return &atom_groups_charges;
375 }
376
377 inline std::vector<cvm::rvector> *modify_atom_group_positions()
378 {
379 return &atom_groups_coms;
380 }
381
382 inline std::vector<cvm::rvector> *modify_atom_group_total_forces()
383 {
385 }
386
387 inline std::vector<cvm::rvector> *modify_atom_group_applied_forces()
388 {
390 }
391
394
397
400 {
402 }
403
406 {
408 }
409
410protected:
411
414 std::vector<int> atom_groups_ids;
416 std::vector<size_t> atom_groups_refcount;
418 std::vector<cvm::real> atom_groups_masses;
420 std::vector<cvm::real> atom_groups_charges;
422 std::vector<cvm::rvector> atom_groups_coms;
424 std::vector<cvm::rvector> atom_groups_total_forces;
426 std::vector<cvm::rvector> atom_groups_new_colvar_forces;
427
430
433
435 int add_atom_group_slot(int atom_group_id);
436};
437
438
439#if defined(_OPENMP)
440#include <omp.h>
441#else
442struct omp_lock_t;
443#endif
444
447
448public:
449
452
454 virtual ~colvarproxy_smp();
455
459
461 virtual int check_smp_enabled();
462
464 virtual int smp_colvars_loop();
465
467 virtual int smp_biases_loop();
468
470 virtual int smp_biases_script_loop();
471
473 virtual int smp_thread_id();
474
476 virtual int smp_num_threads();
477
479 virtual int smp_lock();
480
482 virtual int smp_trylock();
483
485 virtual int smp_unlock();
486
487protected:
488
490 omp_lock_t *omp_lock_state;
491};
492
493
496
497public:
498
501
503 virtual ~colvarproxy_replicas();
504
506 virtual int replica_enabled();
507
509 virtual int replica_index();
510
512 virtual int num_replicas();
513
515 virtual void replica_comm_barrier();
516
518 virtual int replica_comm_recv(char* msg_data, int buf_len, int src_rep);
519
521 virtual int replica_comm_send(char* msg_data, int msg_len, int dest_rep);
522
523};
524
525
528
529public:
530
533
535 virtual ~colvarproxy_script();
536
540
543
545 virtual int run_force_callback();
546
547 virtual int run_colvar_callback(
548 std::string const &name,
549 std::vector<const colvarvalue *> const &cvcs,
550 colvarvalue &value);
551
552 virtual int run_colvar_gradient_callback(
553 std::string const &name,
554 std::vector<const colvarvalue *> const &cvcs,
555 std::vector<cvm::matrix2d<cvm::real> > &gradient);
556};
557
558
559
564 : public colvarproxy_system,
565 public colvarproxy_atoms,
567 public colvarproxy_volmaps,
568 public colvarproxy_smp,
570 public colvarproxy_script,
571 public colvarproxy_tcl,
572 public colvarproxy_io
573{
574
575public:
576
579
581 colvarproxy();
582
584 ~colvarproxy() override;
585
586 inline std::string const &engine_name() const
587 {
588 return engine_name_;
589 }
590
591 bool io_available() override;
592
594 virtual int request_deletion();
595
597 inline bool delete_requested() const
598 {
599 return b_delete_requested;
600 }
601
603 virtual int reset();
604
606 virtual int parse_module_config();
607
614 virtual int load_atoms_pdb(char const *filename, cvm::atom_group &atoms,
615 std::string const &pdb_field, double pdb_field_value);
616
624 virtual int load_coords_pdb(char const *filename, std::vector<cvm::atom_pos> &pos,
625 std::vector<int> const &sorted_ids, std::string const &pdb_field,
626 double pdb_field_value);
627
629 virtual int setup();
630
632 inline bool engine_ready() const
633 {
634 return engine_ready_;
635 }
636
638 void add_config(std::string const &cmd, std::string const &conf);
639
643 virtual int update_input();
644
646 virtual int update_output();
647
649 int end_of_step();
650
652 virtual void log(std::string const &message);
653
655 virtual void error(std::string const &message);
656
658 void add_error_msg(std::string const &message);
659
661 std::string const & get_error_msgs();
662
664 void clear_error_msgs();
665
667 inline bool simulation_running() const
668 {
670 }
671
675 inline bool simulation_continuing() const
676 {
678 }
679
681 int post_run();
682
685
688
690 int get_version_from_string(char const *version_string);
691
693 int version_number() const
694 {
695 return version_int;
696 }
697
698protected:
699
702
704 std::string error_output;
705
708
713
716
719
722
723protected:
724
726 std::string engine_name_ = "standalone";
727
730
731};
732
733
734#endif
Group of atom objects, mostly used by a colvar::cvc object to gather all atomic data.
Definition: colvaratoms.h:159
Arbitrary size array (two dimensions) suitable for linear algebra operations (i.e....
Definition: colvartypes.h:376
vector of real numbers with three components
Definition: colvartypes.h:727
Collective variables module (main class)
Definition: colvarmodule.h:59
double real
Defining an abstract real number allows to switch precision.
Definition: colvarmodule.h:95
int residue_id
Residue identifier.
Definition: colvarmodule.h:193
static int error(std::string const &message, int code=-1)
Print a message to the main log and set global error code.
Definition: colvarmodule.cpp:2032
Container of atom group data (allow collection of aggregated atomic data)
Definition: colvarproxy.h:291
cvm::rvector get_atom_group_total_force(int index) const
Read the current total force of the given atom group.
Definition: colvarproxy.h:338
int get_atom_group_id(int index) const
Get the numeric ID of the given atom group (for the MD program)
Definition: colvarproxy.h:314
virtual void clear_atom_group(int index)
Used by the atom_group class destructor.
Definition: colvarproxy.cpp:206
colvarproxy_atom_groups()
Constructor.
Definition: colvarproxy.cpp:153
cvm::real get_atom_group_charge(int index) const
Get the charge of the given atom group.
Definition: colvarproxy.h:326
std::vector< cvm::real > atom_groups_charges
Total charges of the atom groups (allow redefinition during a run, as done e.g. in LAMMPS)
Definition: colvarproxy.h:420
int add_atom_group_slot(int atom_group_id)
Used by all init_atom_group() functions: create a slot for an atom group not requested yet.
Definition: colvarproxy.cpp:178
virtual int scalable_group_coms()
Whether this proxy implementation has capability for scalable groups.
Definition: colvarproxy.cpp:191
std::vector< cvm::rvector > atom_groups_new_colvar_forces
Forces applied from colvars, to be communicated to the MD integrator.
Definition: colvarproxy.h:426
std::vector< size_t > atom_groups_refcount
Keep track of how many times each group is used by a separate cvc.
Definition: colvarproxy.h:416
void compute_max_atom_groups_applied_force()
Compute the maximum norm among all applied forces.
Definition: colvarproxy.cpp:236
cvm::rvector get_atom_group_velocity(int)
Read the current velocity of the given atom group.
Definition: colvarproxy.h:350
cvm::real atom_groups_max_applied_force_
Maximum norm among all applied group forces.
Definition: colvarproxy.h:432
cvm::real rms_atom_groups_applied_force() const
Get the root-mean-square of the applied forces.
Definition: colvarproxy.h:399
cvm::real get_atom_group_mass(int index) const
Get the mass of the given atom group.
Definition: colvarproxy.h:320
int reset()
Clear atom group data.
Definition: colvarproxy.cpp:165
void compute_rms_atom_groups_applied_force()
Compute the root-mean-square of the applied forces.
Definition: colvarproxy.cpp:229
cvm::real max_atom_groups_applied_force() const
Get the maximum norm among all applied forces.
Definition: colvarproxy.h:405
std::vector< cvm::real > atom_groups_masses
Total masses of the atom groups.
Definition: colvarproxy.h:418
virtual ~colvarproxy_atom_groups()
Destructor.
Definition: colvarproxy.cpp:159
size_t get_num_active_atom_groups() const
Return number of atom groups with positive reference count.
Definition: colvarproxy.cpp:219
cvm::rvector get_atom_group_com(int index) const
Read the current position of the center of mass given atom group.
Definition: colvarproxy.h:332
void apply_atom_group_force(int index, cvm::rvector const &new_force)
Request that this force is applied to the given atom group.
Definition: colvarproxy.h:344
cvm::real atom_groups_rms_applied_force_
Root-mean-square of the applied group forces.
Definition: colvarproxy.h:429
virtual int init_atom_group(std::vector< int > const &atoms_ids)
Prepare this group for collective variables calculation, selecting atoms by internal ids (0-based)
Definition: colvarproxy.cpp:197
std::vector< cvm::rvector > atom_groups_total_forces
Most recently updated total forces on the com of each group.
Definition: colvarproxy.h:424
std::vector< int > atom_groups_ids
Array of 0-based integers used to uniquely associate atom groups within the host program.
Definition: colvarproxy.h:414
std::vector< cvm::rvector > atom_groups_coms
Current centers of mass of the atom groups.
Definition: colvarproxy.h:422
Container of atomic data for processing by Colvars.
Definition: colvarproxy.h:40
cvm::real get_atom_mass(int index) const
Definition: colvarproxy.h:89
int reset()
Clear atomic data.
Definition: colvarproxy.cpp:38
int add_atom_slot(int atom_id)
Definition: colvarproxy.cpp:51
bool updated_masses() const
Record whether masses have been updated.
Definition: colvarproxy.h:238
virtual int init_atom(int atom_number)
Definition: colvarproxy.cpp:65
size_t get_num_active_atoms() const
Return number of atoms with positive reference count.
Definition: colvarproxy.cpp:114
cvm::real atoms_rms_applied_force_
Root-mean-square of the applied forces.
Definition: colvarproxy.h:268
colvarproxy_atoms()
Constructor.
Definition: colvarproxy.cpp:23
void apply_atom_force(int index, cvm::rvector const &new_force)
Definition: colvarproxy.h:125
cvm::rvector get_atom_velocity(int)
Read the current velocity of the given atom.
Definition: colvarproxy.h:131
cvm::real get_atom_charge(int index) const
Definition: colvarproxy.h:103
virtual ~colvarproxy_atoms()
Destructor.
Definition: colvarproxy.cpp:32
void increase_refcount(int index)
Definition: colvarproxy.h:96
cvm::real rms_atoms_applied_force() const
Get the root-mean-square of the applied forces.
Definition: colvarproxy.h:208
virtual int check_atom_name_selections_available()
Check whether it is possible to select atoms by residue number name.
Definition: colvarproxy.cpp:77
bool modified_atom_list_
Whether the atom list has been modified internally.
Definition: colvarproxy.h:277
cvm::rvector get_atom_position(int index) const
Definition: colvarproxy.h:110
bool modified_atom_list() const
Whether the atom list has been modified internally.
Definition: colvarproxy.h:226
void compute_max_atoms_applied_force()
Compute the maximum norm among all applied forces.
Definition: colvarproxy.cpp:131
virtual void clear_atom(int index)
Used by the atom class destructor: rather than deleting the array slot (costly) set the corresponding...
Definition: colvarproxy.cpp:102
int atoms_max_applied_force_id_
ID of the atom with the maximum norm among all applied forces.
Definition: colvarproxy.h:274
void reset_modified_atom_list()
Reset the modified atom list flag.
Definition: colvarproxy.h:232
std::vector< cvm::rvector > atoms_total_forces
Most recent total forces on each atom.
Definition: colvarproxy.h:263
cvm::rvector get_atom_total_force(int index) const
Definition: colvarproxy.h:117
int max_atoms_applied_force_id() const
Get the atom ID with the largest applied force.
Definition: colvarproxy.h:220
bool updated_masses_
Whether the masses and charges have been updated from the host code.
Definition: colvarproxy.h:280
std::vector< cvm::real > atoms_charges
Charges of the atoms (allow redefinition during a run, as done e.g. in LAMMPS)
Definition: colvarproxy.h:259
cvm::real atoms_max_applied_force_
Maximum norm among all applied forces.
Definition: colvarproxy.h:271
std::vector< size_t > atoms_refcount
Keep track of how many times each atom is used by a separate colvar object.
Definition: colvarproxy.h:255
bool updated_charges() const
Record whether masses have been updated.
Definition: colvarproxy.h:244
cvm::real max_atoms_applied_force() const
Get the maximum norm among all applied forces.
Definition: colvarproxy.h:214
void compute_rms_atoms_applied_force()
Compute the root-mean-square of the applied forces.
Definition: colvarproxy.cpp:124
std::vector< cvm::rvector > atoms_positions
Current three-dimensional positions of the atoms.
Definition: colvarproxy.h:261
virtual int check_atom_id(int atom_number)
Definition: colvarproxy.cpp:71
std::vector< cvm::real > atoms_masses
Masses of the atoms (allow redefinition during a run, as done e.g. in LAMMPS)
Definition: colvarproxy.h:257
int get_atom_id(int index) const
Definition: colvarproxy.h:82
std::vector< cvm::rvector > atoms_new_colvar_forces
Forces applied from colvars, to be communicated to the MD integrator.
Definition: colvarproxy.h:265
std::vector< int > atoms_ids
Array of 0-based integers used to uniquely associate atoms within the host program.
Definition: colvarproxy.h:253
Methods for data input/output.
Definition: colvarproxy_io.h:20
Methods for multiple-replica communication.
Definition: colvarproxy.h:495
virtual void replica_comm_barrier()
Synchronize replica with others.
Definition: colvarproxy_replicas.cpp:38
colvarproxy_replicas()
Constructor.
Definition: colvarproxy_replicas.cpp:14
virtual int replica_comm_recv(char *msg_data, int buf_len, int src_rep)
Receive data from other replica.
Definition: colvarproxy_replicas.cpp:41
virtual ~colvarproxy_replicas()
Destructor.
Definition: colvarproxy_replicas.cpp:17
virtual int replica_comm_send(char *msg_data, int msg_len, int dest_rep)
Send data to other replica.
Definition: colvarproxy_replicas.cpp:49
virtual int num_replicas()
Total number of replicas.
Definition: colvarproxy_replicas.cpp:32
virtual int replica_enabled()
Indicate if multi-replica support is available and active.
Definition: colvarproxy_replicas.cpp:20
virtual int replica_index()
Index of this replica.
Definition: colvarproxy_replicas.cpp:26
Methods for scripting language interface (Tcl or Python)
Definition: colvarproxy.h:527
bool have_scripts
Do we have a scripting interface?
Definition: colvarproxy.h:542
virtual ~colvarproxy_script()
Destructor.
Definition: colvarproxy.cpp:414
colvarproxy_script()
Constructor.
Definition: colvarproxy.cpp:407
virtual int run_force_callback()
Run a user-defined colvar forces script.
Definition: colvarproxy.cpp:423
colvarscript * script
Definition: colvarproxy.h:539
Methods for SMP parallelization.
Definition: colvarproxy.h:446
virtual int smp_colvars_loop()
Distribute calculation of colvars (and their components) across threads.
Definition: colvarproxy.cpp:282
virtual int smp_biases_script_loop()
Distribute calculation of biases across threads 2nd through last, with all scripted biased on 1st thr...
Definition: colvarproxy.cpp:329
virtual int smp_thread_id()
Index of this thread.
Definition: colvarproxy.cpp:358
virtual int smp_trylock()
Attempt to lock the proxy's shared data.
Definition: colvarproxy.cpp:387
virtual int smp_lock()
Lock the proxy's shared data for access by a thread, if threads are implemented; if not implemented,...
Definition: colvarproxy.cpp:378
virtual int smp_num_threads()
Number of threads sharing this address space.
Definition: colvarproxy.cpp:368
omp_lock_t * omp_lock_state
Lock state for OpenMP.
Definition: colvarproxy.h:490
virtual int check_smp_enabled()
Whether threaded parallelization is available (TODO: make this a cvm::deps feature)
Definition: colvarproxy.cpp:269
bool b_smp_active
Definition: colvarproxy.h:458
virtual int smp_unlock()
Release the lock.
Definition: colvarproxy.cpp:397
virtual int smp_biases_loop()
Distribute calculation of biases across threads.
Definition: colvarproxy.cpp:306
virtual ~colvarproxy_smp()
Destructor.
Definition: colvarproxy.cpp:257
colvarproxy_smp()
Constructor.
Definition: colvarproxy.cpp:244
Methods for accessing the simulation system (PBCs, integrator, etc)
Definition: colvarproxy_system.h:15
Methods for using Tcl within Colvars.
Definition: colvarproxy_tcl.h:28
Container of grid-based objects.
Definition: colvarproxy_volmaps.h:8
Definition: colvarproxy.h:573
virtual int update_input()
Definition: colvarproxy.cpp:560
colvarproxy()
Constructor.
Definition: colvarproxy.cpp:446
std::string error_output
Collected error messages.
Definition: colvarproxy.h:704
virtual int update_output()
Update data based on the results of a Colvars call (e.g. send forces)
Definition: colvarproxy.cpp:566
void add_config(std::string const &cmd, std::string const &conf)
Enqueue new configuration text, to be parsed as soon as possible.
Definition: colvarproxy.cpp:500
virtual int request_deletion()
Request deallocation of the module (currently only implemented by VMD)
Definition: colvarproxy.cpp:492
colvarmodule * colvars
Pointer to the main object.
Definition: colvarproxy.h:578
bool simulation_continuing() const
Definition: colvarproxy.h:675
void clear_error_msgs()
As the name says.
Definition: colvarproxy.cpp:735
void add_error_msg(std::string const &message)
Record error message (used by VMD to collect them after a script call)
Definition: colvarproxy.cpp:725
int version_int
Integer representing the version string (allows comparisons)
Definition: colvarproxy.h:718
std::string const & get_error_msgs()
Retrieve accumulated error messages.
Definition: colvarproxy.cpp:741
int end_of_step()
Carry out operations needed before next simulation step is run.
Definition: colvarproxy.cpp:572
virtual void log(std::string const &message)
Print a message to the main log.
Definition: colvarproxy.cpp:712
bool b_delete_requested
Whether the entire module should be deallocated by the host engine.
Definition: colvarproxy.h:715
std::string engine_name_
Name of the simulation engine that the derived proxy object supports.
Definition: colvarproxy.h:726
void print_input_atomic_data()
Print a full list of all input atomic arrays for debug purposes.
Definition: colvarproxy.cpp:605
virtual int parse_module_config()
(Re)initialize the module
Definition: colvarproxy.cpp:512
bool engine_ready() const
Whether the engine allows to fully initialize Colvars immediately.
Definition: colvarproxy.h:632
virtual int load_coords_pdb(char const *filename, std::vector< cvm::atom_pos > &pos, std::vector< int > const &sorted_ids, std::string const &pdb_field, double pdb_field_value)
Load a set of coordinates from a PDB file.
Definition: colvarproxy.cpp:547
int get_version_from_string(char const *version_string)
Convert a version string "YYYY-MM-DD" into an integer.
Definition: colvarproxy.cpp:747
bool simulation_running() const
Whether a simulation is running (warn against irrecovarable errors)
Definition: colvarproxy.h:667
virtual int reset()
Reset proxy state, e.g. requested atoms.
Definition: colvarproxy.cpp:478
void * config_queue_
Queue of config strings or files to be fed to the module.
Definition: colvarproxy.h:729
int post_run()
Called at the end of a simulation segment (i.e. "run" command)
Definition: colvarproxy.cpp:593
bool b_simulation_continuing
Definition: colvarproxy.h:712
bool engine_ready_
Whether the engine allows to fully initialize Colvars immediately.
Definition: colvarproxy.h:701
bool delete_requested() const
Whether deallocation was requested.
Definition: colvarproxy.h:597
size_t features_hash
Track which features have been acknowledged during the last run.
Definition: colvarproxy.h:721
void print_output_atomic_data()
Print a full list of all applied forces for debug purposes.
Definition: colvarproxy.cpp:687
int version_number() const
Get the version number (higher = more recent)
Definition: colvarproxy.h:693
bool io_available() override
Ensure that we're on the main thread (derived class will do actual check)
Definition: colvarproxy.cpp:471
virtual int setup()
(Re)initialize required member data (called after the module)
Definition: colvarproxy.cpp:506
virtual int load_atoms_pdb(char const *filename, cvm::atom_group &atoms, std::string const &pdb_field, double pdb_field_value)
Read a selection of atom IDs from a PDB coordinate file.
Definition: colvarproxy.cpp:535
virtual void error(std::string const &message)
Print a message to the main log and/or let the host code know about it.
Definition: colvarproxy.cpp:718
bool b_simulation_running
Whether a simulation is running (warn against irrecovarable errors)
Definition: colvarproxy.h:707
~colvarproxy() override
Destructor.
Definition: colvarproxy.cpp:460
Definition: colvarscript.h:29
Value of a collective variable: this is a metatype which can be set at runtime. By default it is set ...
Definition: colvarvalue.h:43
Collective variables main module.