52 virtual void calculate();
53 static void registerKeywords(
Keywords& keys);
56 PLUMED_REGISTER_ACTION(
Template,
"TEMPLATE")
59 Colvar::registerKeywords(keys);
60 keys.addFlag(
"TEMPLATE_DEFAULT_OFF_FLAG",
false,
"flags that are by default not performed should be specified like this");
61 keys.addFlag(
"TEMPLATE_DEFAULT_ON_FLAG",
true,
"flags that are by default performed should be specified like this");
62 keys.add(
"compulsory",
"TEMPLATE_COMPULSORY",
"all compulsory keywords should be added like this with a description here");
63 keys.add(
"optional",
"TEMPLATE_OPTIONAL",
"all optional keywords that have input should be added like a description here");
64 keys.add(
"atoms",
"TEMPLATE_INPUT",
"the keyword with which you specify what atoms to use should be added like this");
71 vector<AtomNumber>
atoms;
74 error(
"Number of specified atoms should be 2");
80 log.
printf(
" between atoms %d %d\n",atoms[0].serial(),atoms[1].serial());
81 if(
pbc)
log.
printf(
" using periodic boundary conditions\n");
82 else log.
printf(
" without periodic boundary conditions\n");
99 const double value=distance.
modulo();
100 const double invvalue=1.0/value;
const Vector & getPosition(int) const
Get position of i-th atom.
void parseFlag(const std::string &key, bool &t)
Parse one keyword as boolean flag.
void setNotPeriodic()
Set your default value to have no periodicity.
Log & log
Reference to the log stream.
double modulo() const
Compute the modulo.
Class implementing fixed size vectors of doubles.
Provides the keyword TEMPLATE
void setAtomsDerivatives(int, const Vector &)
void error(const std::string &msg) const
Crash calculation and print documentation.
void checkRead()
Check if Action was properly read.
void parseAtomList(const std::string &key, std::vector< AtomNumber > &t)
Parse a list of atoms without a numbered keyword.
void addValueWithDerivatives()
Add a value with the name label that has derivatives.
void requestAtoms(const std::vector< AtomNumber > &a)
#define PLUMED_COLVAR_INIT(ao)
void setBoxDerivatives(const Tensor &)
This class holds the keywords and their documentation.
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.
This is the abstract base class to use for implementing new collective variables, within it there is ...
VectorGeneric< n > delta(const VectorGeneric< n > &v1, const VectorGeneric< n > &v2)
void setValue(const double &d)
Set the default value (the one without name)
Vector pbcDistance(const Vector &, const Vector &) const
Compute the pbc distance between two positions.
virtual void calculate()
Calculate an Action.