next up previous contents index
Next: Defining collective variables Up: Collective Variable-based Calculations (Colvars) Previous: A crash course   Contents   Index


General parameters

Here, we document the syntax of the commands and parameters used to set up and use the Colvars module in NAMD. One of these parameters is the configuration file or the configuration text for the module itself, whose syntax is described in 10.2.3 and in the following sections.

NAMD parameters

To enable a Colvars-based calculation, two parameters must be added to the NAMD configuration file, colvars and colvarsConfig. An optional third parameter, colvarsInput, can be used to continue a previous simulation.

Using the cv command

At any moment during the execution of NAMD, several options in the Colvars module can be read or modified by the command cv with the following syntax:
cv $ <$ subcommand$ >$ [args...]
For example, to record the value of a collective variable named myVar into the Tcl variable value, use the following syntax:
set value [cv colvar myVar value]
All subcommands of cv are documented below.

Managing the Colvars module

Input and output commands

Managing collective variables

Managing biases

Configuration syntax

All the parameters defining variables and their biasing or analysis algorithms are read from the file specified by the configuration option colvarsConfig, or by the Tcl commands cv config and cv configfile. None of the keywords described in the remainder of this manual are recognized directly in the NAMD configuration file, unless as arguments of cv config. The syntax of the Colvars configuration is ``keyword value'', where the keyword and its value are separated by any white space. The following rules apply:

Global keywords

The following keywords are available in the global context of the Colvars configuration, i.e. they are not nested inside other keywords:

To illustrate the flexibility of the Colvars module, a non-trivial setup is represented in Figure 6. The corresponding configuration is given below. The options within the colvar blocks are described in 10.3, those within the harmonic and histogram blocks in 10.5. Note: except colvar, none of the keywords shown is mandatory.

Figure 6: Graphical representation of a Colvars configuration. The colvar called ``$ d$ '' is defined as the difference between two distances: the first distance ($ d_{1}$ ) is taken between the center of mass of atoms 1 and 2 and that of atoms 3 to 5, the second ($ d_{2}$ ) between atom 7 and the center of mass of atoms 8 to 10. The difference $ d = d_{1} - d_{2}$ is obtained by multiplying the two by a coefficient $ C = +1$ or $ C = -1$ , respectively. The colvar called ``$ c$ '' is the coordination number calculated between atoms 1 to 10 and atoms 11 to 20. A harmonic restraint is applied to both $ d$ and $ c$ : to allow using the same force constant $ K$ , both $ d$ and $ c$ are scaled by their respective fluctuation widths $ w_d$ and $ w_c$ . A third colvar ``alpha'' is defined as the $ \alpha$ -helical content of residues 1 to 10. The values of ``$ c$ '' and ``alpha'' are also recorded throughout the simulation as a joint 2-dimensional histogram.

colvar {
  # difference of two distances
  name d
  width 0.2 # 0.2 Å of estimated fluctuation width
  distance {
    componentCoeff 1.0
    group1 { atomNumbers 1 2 }
    group2 { atomNumbers 3 4 5 }
  distance {
    componentCoeff -1.0
    group1 { atomNumbers 7 }
    group2 { atomNumbers 8 9 10 }

colvar {
  name c
  coordNum {
    cutoff 6.0
    group1 { atomNumbersRange 1-10 }
    group2 { atomNumbersRange 11-20 }

colvar {
  name alpha
  alpha {
    psfSegID PROT
    residueRange 1-10

harmonic {
  colvars d c
  centers 3.0 4.0
  forceConstant 5.0

histogram {
  colvars c alpha

Section 10.3 explains how to define a colvar and its behavior, regardless of its specific functional form. To define colvars that are appropriate to a specific physical system, Section 10.4 documents how to select atoms, and section 10.3 lists all of the available functional forms, which we call ``colvar components''. Finally, section 10.5 lists the available methods and algorithms to perform biased simulations and multidimensional analysis of colvars.

Output files

During a simulation with collective variables defined, the following three output files are written:

Other output files may also be written by specific methods, e.g. the ABF or metadynamics methods (10.5.1, 10.5.3). Like the trajectory file, they are needed only for analyzing, not continuing a simulation. All such files' names also begin with the prefix outputName.

Lastly, the total energy of all biases or restraints applied to the colvars appears under the NAMD standard output, under the MISC column.

next up previous contents index
Next: Defining collective variables Up: Collective Variable-based Calculations (Colvars) Previous: A crash course   Contents   Index