29 void ActionWithVirtualAtom::registerKeywords(
Keywords& keys){
30 Action::registerKeywords(keys);
31 ActionAtomistic::registerKeywords(keys);
32 keys.
add(
"atoms",
"ATOMS",
"the list of atoms which are involved the virtual atom's definition");
64 for(std::map<AtomNumber,Tensor>::const_iterator p=a->
gradients.begin();p!=a->
gradients.end();++p){
std::map< AtomNumber, Tensor > gradients
Simple class to store the index of an atom.
void removeVirtualAtom(ActionWithVirtualAtom *)
AtomNumber addVirtualAtom(ActionWithVirtualAtom *)
void apply()
Apply an Action.
std::vector< Vector > forces
Log & log
Reference to the log stream.
unsigned serial() const
Returns the serial number.
TensorGeneric< n, l > matmul(const TensorGeneric< n, m > &a, const TensorGeneric< m, l > &b)
std::vector< Tensor > derivatives
Class implementing fixed size vectors of doubles.
AtomNumber getAbsoluteIndex(int i) const
Get the absolute index of an atom.
void add(const std::string &t, const std::string &k, const std::string &d)
Add a new keyword of type t with name k and description d.
void requestAtoms(const std::vector< AtomNumber > &a)
Request atoms on which the calculation depends.
This class holds the keywords and their documentation.
This class is used to bring the relevant information to the Action constructor.
Action used to create objects that access the positions of the atoms from the MD code.
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) ...
bool isOptionOn(const std::string &s) const
Check if an option is on.
unsigned index() const
Returns the index number.
bool isVirtualAtom(AtomNumber) const
void requestAtoms(const std::vector< AtomNumber > &a)
Request an array of atoms.
ActionWithVirtualAtom * getVirtualAtomsAction(AtomNumber) const
std::vector< Vector > & modifyForces()
Get a reference to forces array.
unsigned getNumberOfAtoms() const
Get number of available atoms.
void setGradientsIfNeeded()