59 virtual void calculate();
60 static void registerKeywords(
Keywords& keys);
63 PLUMED_REGISTER_ACTION(
Dipole,
"DIPOLE")
66 Colvar::registerKeywords(keys);
67 keys.add(
"atoms",
"GROUP",
"the group of atoms we are calculating the dipole moment for");
79 for(
unsigned int i=0;i<
ga_lista.size();++i){
95 for(
unsigned i=0;i<charges.size();++i){
100 ctot/=charges.size();
102 for(
unsigned i=0;i<charges.size();++i) charges[i]-=ctot;
106 for(
unsigned int i=0;i<
ga_lista.size();i++) {
111 for(
unsigned int i=0;i<
ga_lista.size();i++) {
112 double dfunc=charges[i]/dipole;
113 deriv[i] = deriv[i] + (dfunc)*dipje;
const Vector & getPosition(int) const
Get position of i-th atom.
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.
void setAtomsDerivatives(int, const Vector &)
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)
virtual void calculate()
Calculate an Action.
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 ...
void setValue(const double &d)
Set the default value (the one without name)
double getCharge(int i) const
Get charge of i-th atom.
void setBoxDerivativesNoPbc()
Set box derivatives automatically.
Provides the keyword DIPOLE
vector< AtomNumber > ga_lista
unsigned getNumberOfAtoms() const
Get number of available atoms.
std::vector< double > charges