10#ifndef COLVARBIAS_RESTRAINT_H
11#define COLVARBIAS_RESTRAINT_H
13#include "colvarbias.h"
17#pragma warning(disable : 4250)
42 virtual std::ostream &
write_traj(std::ostream &os);
47 virtual int init(std::string
const &conf);
71 virtual int init(std::string
const &conf);
88 virtual int init(std::string
const &conf);
108 virtual int init(std::string
const &conf);
109 virtual int update() {
return COLVARS_OK; }
110 virtual int change_configuration(std::string
const & ) {
return COLVARS_NOT_IMPLEMENTED; }
112 virtual std::string
const get_state_params()
const;
113 virtual int set_state_params(std::string
const &conf);
156 virtual int init(std::string
const &conf);
157 virtual int update();
160 virtual std::string
const get_state_params()
const;
161 virtual int set_state_params(std::string
const &conf);
163 virtual std::ostream &
write_traj(std::ostream &os);
195 virtual int init(std::string
const &conf);
196 virtual int update();
199 virtual std::string
const get_state_params()
const;
200 virtual int set_state_params(std::string
const &conf);
202 virtual std::ostream &
write_traj(std::ostream &os);
238 virtual int init(std::string
const &conf);
239 virtual int update();
240 virtual std::string
const get_state_params()
const;
241 virtual int set_state_params(std::string
const &conf);
243 virtual std::ostream &
write_traj(std::ostream &os);
263 virtual int init(std::string
const &conf);
264 virtual int update();
265 virtual std::string
const get_state_params()
const;
266 virtual int set_state_params(std::string
const &conf);
268 virtual std::ostream &
write_traj(std::ostream &os);
284 virtual cvm::real colvar_distance(
size_t i)
const;
300 virtual int init(std::string
const &conf);
301 virtual int update();
305 virtual std::string
const get_state_params()
const;
306 virtual int set_state_params(std::string
const &conf);
308 virtual std::ostream &
write_traj(std::ostream &os);
325 int init(std::string
const &conf);
332 virtual std::ostream &
write_traj(std::ostream &os);
Options to change the restraint centers over time.
Definition: colvarbias_restraint.h:152
std::vector< colvarvalue > target_centers
New restraint centers.
Definition: colvarbias_restraint.h:168
std::vector< colvarvalue > initial_centers
Initial value of the restraint centers.
Definition: colvarbias_restraint.h:171
virtual int update_centers(cvm::real lambda)
Update the centers by interpolating between initial and target.
Definition: colvarbias_restraint.cpp:329
virtual int change_configuration(std::string const &)
Load new configuration - force constant and/or centers only.
Definition: colvarbias_restraint.h:158
virtual std::ostream & write_traj(std::ostream &os)
Output quantities such as the bias energy to the trajectory file.
Definition: colvarbias_restraint.cpp:493
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias_restraint.cpp:280
int update_acc_work()
Update the accumulated work.
Definition: colvarbias_restraint.cpp:410
std::vector< colvarvalue > centers_incr
Increment of the restraint centers at each step.
Definition: colvarbias_restraint.h:174
bool b_output_centers
Whether to write the current restraint centers to the trajectory file.
Definition: colvarbias_restraint.h:180
virtual std::ostream & write_traj_label(std::ostream &os)
Write a label to the trajectory file (comment line)
Definition: colvarbias_restraint.cpp:474
Definition and parsing of the restraint centers.
Definition: colvarbias_restraint.h:67
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias_restraint.cpp:105
virtual int change_configuration(std::string const &conf)
Load new configuration - force constant and/or centers only.
Definition: colvarbias_restraint.cpp:145
std::vector< colvarvalue > colvar_centers
Restraint centers.
Definition: colvarbias_restraint.h:77
Wall restraint (implementation of colvarbias_restraint)
Definition: colvarbias_restraint.h:259
cvm::real upper_wall_k
If both walls are defined, use this k for the upper.
Definition: colvarbias_restraint.h:282
cvm::real lower_wall_k
If both walls are defined, use this k for the lower.
Definition: colvarbias_restraint.h:279
virtual colvarvalue const restraint_force(size_t i) const
Force function for the i-th colvar.
Definition: colvarbias_restraint.cpp:1102
std::vector< colvarvalue > lower_walls
Location of the lower walls.
Definition: colvarbias_restraint.h:273
virtual cvm::real restraint_potential(size_t i) const
Potential function for the i-th colvar.
Definition: colvarbias_restraint.cpp:1093
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias_restraint.cpp:911
virtual std::ostream & write_traj_label(std::ostream &os)
Write a label to the trajectory file (comment line)
Definition: colvarbias_restraint.cpp:1137
std::vector< colvarvalue > upper_walls
Location of the upper walls.
Definition: colvarbias_restraint.h:276
virtual std::ostream & write_traj(std::ostream &os)
Output quantities such as the bias energy to the trajectory file.
Definition: colvarbias_restraint.cpp:1145
virtual cvm::real d_restraint_potential_dk(size_t i) const
Derivative of the potential function with respect to the force constant.
Definition: colvarbias_restraint.cpp:1110
Harmonic bias restraint (implementation of colvarbias_restraint)
Definition: colvarbias_restraint.h:235
virtual cvm::real restraint_potential(size_t i) const
Potential function for the i-th colvar.
Definition: colvarbias_restraint.cpp:809
virtual cvm::real energy_difference(std::string const &conf)
Calculate change in energy from using alternate configuration.
Definition: colvarbias_restraint.cpp:875
virtual cvm::real d_restraint_potential_dk(size_t i) const
Derivative of the potential function with respect to the force constant.
Definition: colvarbias_restraint.cpp:823
virtual int change_configuration(std::string const &conf)
Load new configuration - force constant and/or centers only.
Definition: colvarbias_restraint.cpp:868
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias_restraint.cpp:766
virtual std::ostream & write_traj_label(std::ostream &os)
Write a label to the trajectory file (comment line)
Definition: colvarbias_restraint.cpp:850
virtual colvarvalue const restraint_force(size_t i) const
Force function for the i-th colvar.
Definition: colvarbias_restraint.cpp:816
virtual std::ostream & write_traj(std::ostream &os)
Output quantities such as the bias energy to the trajectory file.
Definition: colvarbias_restraint.cpp:859
Restrain the 1D histogram of a set of variables (or of a multidimensional one)
Definition: colvarbias_restraint.h:320
int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias_restraint.cpp:1311
cvm::real width
Resolution of the grid.
Definition: colvarbias_restraint.h:352
virtual std::ostream & write_traj_label(std::ostream &os)
Write a label to the trajectory file (comment line)
Definition: colvarbias_restraint.cpp:1547
virtual std::ostream & write_traj(std::ostream &os)
Output quantities such as the bias energy to the trajectory file.
Definition: colvarbias_restraint.cpp:1558
cvm::vector1d< cvm::real > p_diff
Difference between probability density and reference.
Definition: colvarbias_restraint.h:343
cvm::vector1d< cvm::real > ref_p
Reference probability density.
Definition: colvarbias_restraint.h:340
cvm::real force_k
Restraint force constant.
Definition: colvarbias_restraint.h:358
cvm::real lower_boundary
Lower boundary of the grid.
Definition: colvarbias_restraint.h:346
virtual int update()
Definition: colvarbias_restraint.cpp:1426
bool b_write_histogram
Write the histogram to a file.
Definition: colvarbias_restraint.h:361
virtual int write_output_files()
Write any output files that this bias may have (e.g. PMF files)
Definition: colvarbias_restraint.cpp:1516
cvm::vector1d< cvm::real > p
Probability density.
Definition: colvarbias_restraint.h:337
cvm::real gaussian_width
Width of the Gaussians.
Definition: colvarbias_restraint.h:355
cvm::real upper_boundary
Upper boundary of the grid.
Definition: colvarbias_restraint.h:349
Options to change the restraint force constant over time.
Definition: colvarbias_restraint.h:191
cvm::real lambda_exp
Exponent for varying the force constant.
Definition: colvarbias_restraint.h:213
virtual std::ostream & write_traj(std::ostream &os)
Output quantities such as the bias energy to the trajectory file.
Definition: colvarbias_restraint.cpp:741
cvm::real target_equil_steps
Equilibration steps for restraint FE calculation through TI.
Definition: colvarbias_restraint.h:220
cvm::real force_k_incr
Increment of the force constant at each step.
Definition: colvarbias_restraint.h:223
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias_restraint.cpp:532
int update_acc_work()
Update the accumulated work.
Definition: colvarbias_restraint.cpp:674
cvm::real starting_force_k
Restraint force constant (starting value)
Definition: colvarbias_restraint.h:210
virtual std::ostream & write_traj_label(std::ostream &os)
Write a label to the trajectory file (comment line)
Definition: colvarbias_restraint.cpp:731
cvm::real target_force_k
Restraint force constant (target value)
Definition: colvarbias_restraint.h:207
virtual int change_configuration(std::string const &)
Load new configuration - force constant and/or centers only.
Definition: colvarbias_restraint.h:197
cvm::real restraint_FE
Intermediate quantity to compute the restraint free energy (in TI, would be the accumulating FE deriv...
Definition: colvarbias_restraint.h:217
Definition and parsing of the force constant.
Definition: colvarbias_restraint.h:84
cvm::real force_k
Restraint force constant.
Definition: colvarbias_restraint.h:94
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias_restraint.cpp:166
bool check_positive_k
Whether the force constant should be positive.
Definition: colvarbias_restraint.h:97
virtual int change_configuration(std::string const &conf)
Load new configuration - force constant and/or centers only.
Definition: colvarbias_restraint.cpp:177
Linear bias restraint (implementation of colvarbias_restraint)
Definition: colvarbias_restraint.h:296
virtual std::ostream & write_traj(std::ostream &os)
Output quantities such as the bias energy to the trajectory file.
Definition: colvarbias_restraint.cpp:1291
virtual cvm::real restraint_potential(size_t i) const
Potential function for the i-th colvar.
Definition: colvarbias_restraint.cpp:1240
virtual std::ostream & write_traj_label(std::ostream &os)
Write a label to the trajectory file (comment line)
Definition: colvarbias_restraint.cpp:1282
virtual colvarvalue const restraint_force(size_t i) const
Force function for the i-th colvar.
Definition: colvarbias_restraint.cpp:1247
virtual int change_configuration(std::string const &conf)
Load new configuration - force constant and/or centers only.
Definition: colvarbias_restraint.cpp:1216
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias_restraint.cpp:1168
virtual cvm::real d_restraint_potential_dk(size_t i) const
Derivative of the potential function with respect to the force constant.
Definition: colvarbias_restraint.cpp:1255
virtual cvm::real energy_difference(std::string const &conf)
Calculate change in energy from using alternate configuration.
Definition: colvarbias_restraint.cpp:1223
Options to change the restraint configuration over time (shared between centers and k moving)
Definition: colvarbias_restraint.h:103
int stage
Number of current stage of the perturbation.
Definition: colvarbias_restraint.h:131
bool b_chg_centers
Moving target?
Definition: colvarbias_restraint.h:118
std::vector< cvm::real > lambda_schedule
Lambda-schedule for custom varying force constant.
Definition: colvarbias_restraint.h:134
bool b_decoupling
Perform decoupling of the restraint?
Definition: colvarbias_restraint.h:124
cvm::real acc_work
Accumulated work (computed when outputAccumulatedWork == true)
Definition: colvarbias_restraint.h:144
cvm::step_number target_nsteps
Number of steps required to reach the target force constant or restraint centers.
Definition: colvarbias_restraint.h:138
cvm::step_number first_step
Timestep at which the restraint starts moving.
Definition: colvarbias_restraint.h:141
bool b_chg_force_k
Changing force constant?
Definition: colvarbias_restraint.h:121
int target_nstages
Number of stages over which to perform the change If zero, perform a continuous change.
Definition: colvarbias_restraint.h:128
Most general definition of a colvar restraint: see derived classes for specific types (implementation...
Definition: colvarbias_restraint.h:26
virtual cvm::real d_restraint_potential_dk(size_t i) const =0
Derivative of the potential function with respect to the force constant.
virtual int set_state_params(std::string const &conf)
Read the values of specific mutable properties from a string.
Definition: colvarbias_restraint.cpp:80
virtual colvarvalue const restraint_force(size_t i) const =0
Force function for the i-th colvar.
virtual cvm::real energy_difference(std::string const &)
Calculate change in energy from using alternate configuration.
Definition: colvarbias_restraint.h:37
virtual int update()
Retrieve colvar values and calculate their biasing forces.
Definition: colvarbias_restraint.cpp:45
virtual std::string const get_state_params() const
Write the values of specific mutable properties to a string.
Definition: colvarbias_restraint.cpp:74
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias_restraint.cpp:28
virtual cvm::real restraint_potential(size_t i) const =0
Potential function for the i-th colvar.
virtual std::ostream & write_traj_label(std::ostream &os)
Write a label to the trajectory file (comment line)
Definition: colvarbias_restraint.cpp:86
virtual std::ostream & write_traj(std::ostream &os)
Output quantities such as the bias energy to the trajectory file.
Definition: colvarbias_restraint.cpp:92
virtual int change_configuration(std::string const &)
Load new configuration - force constant and/or centers only.
Definition: colvarbias_restraint.h:34
Base class for unconstrained thermodynamic-integration FE estimator.
Definition: colvarbias.h:333
Collective variable bias, base class.
Definition: colvarbias.h:23
Parent class for a member object of a bias, cv or cvc etc. containing features and their dependencies...
Definition: colvardeps.h:34
Arbitrary size array (one dimensions) suitable for linear algebra operations (i.e....
Definition: colvartypes.h:37
double real
Defining an abstract real number allows to switch precision.
Definition: colvarmodule.h:95
long long step_number
Use a 64-bit integer to store the step number.
Definition: colvarmodule.h:92
Base class containing parsing functions; all objects which need to parse input inherit from this.
Definition: colvarparse.h:27
Value of a collective variable: this is a metatype which can be set at runtime. By default it is set ...
Definition: colvarvalue.h:43