24 #include "core/PlumedMain.h"
25 #include "core/Atoms.h"
64 static void registerKeywords(
Keywords& keys );
67 PLUMED_REGISTER_ACTION(
COM,
"COM")
70 ActionWithVirtualAtom::registerKeywords(keys);
77 vector<AtomNumber>
atoms;
79 if(atoms.size()==0)
error(
"at least one atom should be specified");
82 for(
unsigned i=0;i<atoms.size();++i)
log.
printf(
" %d",atoms[i].serial());
92 if(
plumed.getAtoms().chargesWereSet() ){
const Vector & getPosition(int) const
Get position of i-th atom.
Log & log
Reference to the log stream.
void setPosition(const Vector &)
Set position of the virtual atom.
Class implementing fixed size vectors of doubles.
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 setMass(double)
Set its mass.
void requestAtoms(const std::vector< AtomNumber > &a)
Request atoms on which the calculation depends.
static TensorGeneric< n, n > identity()
return an identity tensor
This class holds the keywords and their documentation.
void setAtomsDerivatives(const std::vector< Tensor > &d)
Set the derivatives of virtual atom coordinate wrt atoms on which it dependes.
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.
Base class for all the input Actions.
Inherit from here if you are calculating the position of a virtual atom (eg a center of mass) ...
double getCharge(int i) const
Get charge of i-th atom.
void setCharge(double)
Set its charge.
unsigned getNumberOfAtoms() const
Get number of available atoms.
double getMass(int i) const
Get mass of i-th atom.
void calculate()
Calculate an Action.