62 std::vector<double>
at;
70 static void registerKeywords(
Keywords& keys);
73 PLUMED_REGISTER_ACTION(
Restraint,
"RESTRAINT")
76 Bias::registerKeywords(keys);
78 keys.add(
"compulsory",
"SLOPE",
"0.0",
"specifies that the restraint is linear and what the values of the force constants on each of the variables are");
79 keys.add(
"compulsory",
"KAPPA",
"0.0",
"specifies that the restraint is harmonic and what the values of the force constants on each of the variables are");
80 keys.add(
"compulsory",
"AT",
"the position of the restraint");
81 componentsAreNotOptional(keys);
82 keys.addOutputComponent(
"bias",
"default",
"the instantaneous value of the bias potential");
83 keys.addOutputComponent(
"force2",
"default",
"the instantaneous value of the squared force due to this bias potential");
88 at(getNumberOfArguments()),
89 kappa(getNumberOfArguments(),0.0),
90 slope(getNumberOfArguments(),0.0)
100 log.
printf(
" with harmonic force constant");
103 log.
printf(
" and linear force constant");
119 const double k=
kappa[i];
121 const double f=-(k*cv+
m);
122 ene+=0.5*k*cv*cv+m*cv;
Log & log
Reference to the log stream.
void componentIsNotPeriodic(const std::string &name)
Set your value component to have no periodicity.
A class for holding the value of a function together with its derivatives.
double difference(int, double, double) const
Takes the difference taking into account pbc for arg i.
void checkRead()
Check if Action was properly read.
void addComponent(const std::string &name)
Add a value with a name like label.name.
std::vector< double > kappa
void set(double)
Set the value of the function.
This class holds the keywords and their documentation.
Provides the keyword RESTRAINT
This class is used to bring the relevant information to the Action constructor.
int printf(const char *fmt,...)
Formatted output with explicit format - a la printf.
void calculate()
Calculate an Action.
void parseVector(const std::string &key, std::vector< T > &t)
Parse one keyword as std::vector.
void setOutputForce(int i, double g)
double getArgument(const unsigned n) const
Returns the value of an argument.
std::vector< double > slope
This is the abstract base class to use for implementing new simulation biases, within it there is inf...
#define PLUMED_BIAS_INIT(ao)
Value * getPntrToComponent(int i)
Return a pointer to the component by index.
unsigned getNumberOfArguments() const
Returns the number of arguments.