CENTER_OF_MULTICOLVAR
This is part of the multicolvar module

Calculate a a weighted average position based on the value of some multicolvar.

This action calculates the position of a new virtual atom using the following formula:

\[ x_\alpha = \frac{1}{2\pi} \arctan \left[ \frac{ \sum_i w_i f_i \sin\left( 2\pi x_{i,\alpha} \right) }{ \sum_i w_i f_i \cos\left( 2\pi x_{i,\alpha} \right) } \right] \]

Where in this expression the \(w_i\) values are a set of weights calculated within a multicolvar action and the \(f_i\) are the values of the multicolvar functions. The \(x_{i,\alpha}\) values are the positions (in scaled coordinates) associated with each of the multicolvars calculated.

Bug:
The virial contribution for this type of virtual atom is not currently evaluated so do not use in bias functions unless the volume of the cell is fixed
Examples

Lets suppose that you are examining the formation of liquid droplets from gas. You may want to determine the center of mass of any of the droplets formed. In doing this calculation you recognize that the atoms in the liquid droplets will have a higher coordination number than those in the surrounding gas. As you want to calculate the position of the droplets you thus recognize that these atoms with high coordination numbers should have a high weight in the weighted average you are using to calculate the position of the droplet. You can thus calculate the position of the droplet using an input like the one shown below:

Click on the labels of the actions for more information on what each action computes
tested on v2.8
c1: COORDINATIONNUMBER 
LOWMEM
( default=off ) lower the memory requirements
SPECIES
this keyword is used for colvars such as coordination number.
=1-512
SWITCH
This keyword is used if you want to employ an alternative to the continuous switching function defined above.
={EXP D_0=4.0 R_0=0.5} cc: CENTER_OF_MULTICOLVAR
DATA
compulsory keyword find the average value for a multicolvar
=c1

The first line here calculates the coordination numbers of all the atoms in the system. The virtual atom then uses the values of the coordination numbers calculated by the action labelled c1 when it calculates the Berry Phase average described above. (N.B. the \(w_i\) in the above expression are all set equal to 1 in this case)

The above input is fine we can, however, refine this somewhat by making use of a multicolvar transform action as shown below:

Click on the labels of the actions for more information on what each action computes
tested on v2.8
c1: COORDINATIONNUMBER 
SPECIES
this keyword is used for colvars such as coordination number.
=1-512
SWITCH
This keyword is used if you want to employ an alternative to the continuous switching function defined above.
={EXP D_0=4.0 R_0=0.5} cf: MTRANSFORM_MORE
DATA
compulsory keyword The multicolvar that calculates the set of base quantities that we are interested in
=c1
SWITCH
This keyword is used if you want to employ an alternative to the continuous switching function defined above.
={RATIONAL D_0=2.0 R_0=0.1}
LOWMEM
( default=off ) lower the memory requirements
cc: CENTER_OF_MULTICOLVAR
DATA
compulsory keyword find the average value for a multicolvar
=cf

This input once again calculates the coordination numbers of all the atoms in the system. The middle line then transforms these coordination numbers to numbers between 0 and 1. Essentially any atom with a coordination number larger than 2.0 is given a weight of one and below this value the transformed value decays to zero. It is these transformed coordination numbers that are used to calculate the Berry phase average described in the previous section.

Glossary of keywords and components
The atoms involved can be specified using
ATOMS the list of atoms which are involved the virtual atom's definition. For more information on how to specify lists of atoms see Groups and Virtual Atoms
Compulsory keywords
DATA find the average value for a multicolvar
Options
COMPONENT if your input multicolvar is a vector then specify which component you would like to use in calculating the weight