24 #include "tools/Angle.h"
93 virtual void calculate();
94 static void registerKeywords(
Keywords& keys );
97 PLUMED_REGISTER_ACTION(
Angle,
"ANGLE")
100 Colvar::registerKeywords(keys);
101 keys.add(
"atoms",
"ATOMS",
"the list of atoms involved in this collective variable (either 3 or 4 atoms)");
108 vector<AtomNumber>
atoms;
115 log.
printf(
" between atoms %d %d %d\n",atoms[0].serial(),atoms[1].serial(),atoms[2].serial());
119 }
else if(atoms.size()==4){
120 log.
printf(
" between lines %d-%d and %d-%d\n",atoms[0].serial(),atoms[1].serial(),atoms[2].serial(),atoms[3].serial());
121 }
else error(
"Number of specified atoms should be either 3 or 4");
123 if(
pbc)
log.
printf(
" using periodic boundary conditions\n");
124 else log.
printf(
" without periodic boundary conditions\n");
144 double angle=a.
compute(dij,dik,ddij,ddik);
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 compute(const Vector &v1, const Vector &v2) const
Compute the angle between vectors v1 and v2.
Class implementing fixed size vectors of doubles.
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.
virtual void calculate()
Calculate an Action.
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)
Provides the keyword ANGLE
Vector pbcDistance(const Vector &, const Vector &) const
Compute the pbc distance between two positions.