DIPOLE
This is part of the colvar module

Calculate the dipole moment for a group of atoms.

When running with periodic boundary conditions, the atoms should be in the proper periodic image. This is done automatically since PLUMED 2.5, by considering the ordered list of atoms and rebuilding the molecule with a procedure that is equivalent to that done in WHOLEMOLECULES . Notice that rebuilding is local to this action. This is different from WHOLEMOLECULES which actually modifies the coordinates stored in PLUMED.

In case you want to recover the old behavior you should use the NOPBC flag. In that case you need to take care that atoms are in the correct periodic image.

Examples

The following tells plumed to calculate the dipole of the group of atoms containing the atoms from 1-10 and print it every 5 steps

Click on the labels of the actions for more information on what each action computes
tested on v2.7
d: DIPOLE 
GROUP
the group of atoms we are calculating the dipole moment for.
=1-10 PRINT
FILE
the name of the file on which to output these quantities
=output
STRIDE
compulsory keyword ( default=1 ) the frequency with which the quantities of interest should be output
=5
ARG
the input for this action is the scalar output from one or more other actions.
=d
Attention
If the total charge Q of the group in non zero, then a charge Q/N will be subtracted to every atom, where N is the number of atoms. This implies that the dipole (which for a charged system depends on the position) is computed on the geometric center of the group.
Glossary of keywords and components
Description of components

By default the value of the calculated quantity can be referenced elsewhere in the input file by using the label of the action. Alternatively this Action can be used to calculate the following quantities by employing the keywords listed below. These quantities can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the quantity required from the list below.

Quantity Keyword Description
x COMPONENTS the x-component of the dipole
y COMPONENTS the y-component of the dipole
z COMPONENTS the z-component of the dipole
The atoms involved can be specified using
GROUP the group of atoms we are calculating the dipole moment for. For more information on how to specify lists of atoms see Groups and Virtual Atoms
Options
NUMERICAL_DERIVATIVES ( default=off ) calculate the derivatives for these quantities numerically
NOPBC ( default=off ) ignore the periodic boundary conditions when calculating distances
COMPONENTS

( default=off ) calculate the x, y and z components of the dipole separately and store them as label.x, label.y and label.z