Split up analysis chapter in reference manual
[alexxy/gromacs.git] / docs / reference-manual / topologies / constraint-algorithm-section.rst
1 .. _constraintalg:
2
3 Constraint algorithms
4 ---------------------
5
6 Constraints are defined in the ``[ constraints ]`` section. The format is two atom numbers
7 followed by the function type, which can be 1 or 2, and the constraint
8 distance. The only difference between the two types is that type 1 is
9 used for generating exclusions and type 2 is not (see sec. :ref:`excl`).
10 The distances are constrained using the LINCS or the SHAKE algorithm,
11 which can be selected in the :ref:`mdp` file. Both types of constraints can be
12 perturbed in free-energy calculations by adding a second constraint
13 distance (see :ref:`constraintforce`). Several types of bonds and
14 angles (see :numref:`Table %s <tab-topfile2>`) can be converted automatically to
15 constraints by :ref:`grompp <gmx grompp>`. There are several options for this in the :ref:`mdp`
16 file.
17
18 We have also implemented the SETTLE
19 algorithm \ :ref:`47 <refMiyamoto92>`, which is an analytical solution of SHAKE, specifically for
20 water. SETTLE can be selected in the topology file. See, for instance,
21 the SPC molecule definition:
22
23 ::
24
25     [ moleculetype ]
26     ; molname       nrexcl
27     SOL             1
28
29     [ atoms ]
30     ; nr    at type res nr  ren nm  at nm   cg nr   charge
31     1       OW      1       SOL     OW1     1       -0.82
32     2       HW      1       SOL     HW2     1        0.41
33     3       HW      1       SOL     HW3     1        0.41
34
35     [ settles ]
36     ; OW    funct   doh     dhh
37     1       1       0.1     0.16333
38
39     [ exclusions ]
40     1       2       3
41     2       1       3
42     3       1       2
43
44 The ``[ settles ]`` directive defines the first atom of the
45 water molecule. The settle funct is always 1, and the distance between
46 O-H and H-H distances must be given. **Note** that the algorithm can
47 also be used for TIP3P and TIP4P \ :ref:`128 <refJorgensen83>`. TIP3P just has
48 another geometry. TIP4P has a virtual site, but since that is generated
49 it does not need to be shaken (nor stirred).